CWBRUNSQL - Run batch SQL commands and procedures using an ODBC DSN
Use this command to run batch SQL commands and procedures using an ODBC DSN.
Syntax
cwbrunsql [/DSN:<ODBC DSN="">] [/I:<fileName>]
Parameters
- [/DSN:<ODBC DSN="">] = Use the specified ODBC DSN.
- [/I:<fileName>] = Use the specified file name.
- [/SYSTEM:<system>] = Use the specified system name. Can be used in place of (or in addition to) DSN.
- [/USER:<userID>] = Use the specified userid.
- [/PASSWORD:<password>] = Use the specified password.
- [/DFTLIB:<library>] = Use the specified default library.
- [/Z] = No banners.
Example
A file named myfile.sql contains the following:
CREATE TABLE QGPL.MYTABLE (COL1 INT, COL2 CHAR(10)); INSERT INTO QGPL.MYTABLE VALUES ( 1, 'ABC' ); INSERT INTO QGPL.MYTABLE VALUES ( 2, 'DEF' ); INSERT INTO QGPL.MYTABLE SET COL2= 'XXX' WHERE COL1=2; SELECT * FROM QGPL.MYTABLE;Note that each SQL statement is separated by a semicolon. To run this .sql file, enter the following, where myODBCDSN is the name of the ODBC Data Source.
cwbrunsql /DSN:myODBCDSN /I:myfile.sql
Parent topic:
iSeries Access for Linux utilities