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

 

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