| File Name | Type | Description |
|---|---|---|
| EX01 | RPGLE | RPG CLI example, uses SQLExecDirect to run an SQL statement. |
| EX02 | RPGLE | RPG CLI example, uses SQLPrepare, SQLExecute to prepare and run an SQL statement with a parameter marker |
| CSQLCLI_HX | RPGLE | Include member of CLI defines and prototypes for RPGLE programs |
| CTYPES | RPGLE | Include member that defines basic C data types, referenced in CSQLCLI_HX |
| RPG_CLI.PDF | PDF file of the PowerPoint presentation |
Click a file name to view it in your browser as a text file.
To save the file to your PC, right-click and select the "Save" option.
Create library RPG_SQL on your iSeries.
Create source file RPG_SQL/QSQLCLI.
Upload the four source files shown above to source file RPG_SQL/QSQLCLI. The source member type for all of the source members is RPGLE.
In example programs EX01 and EX02, change the value of the szDSN field name to the name of your iSeries Relational Database Directory Entry (the field value is set to M270 in the example programs). Use the WRKRDBDIRE command to view the name of the Relational Database Directory Entry on your iSeries.
Use the following CRTBNDRPG commands to create the two example programs:
CRTBNDRPG PGM(RPG_SQL/EX01) SRCFILE(RPG_SQL/QSQLCLI)
CRTBNDRPG PGM(RPG_SQL/EX02) SRCFILE(RPG_SQL/QSQLCLI)
Note: if database file QIWS/QCUSTCDT is not your iSeries system, substitute another database file in the SQL SELECT statements in the example programs. You will also need to adjust the bound column names and attributes for the database file that you use.
** END **
Copyright © 2005, Bits & Bytes Programming, Inc., ALL RIGHTS RESERVED