Start of change

SQL statements (Db2 command line processor)

Execute SQL statements in the Db2 command line processor after you issue the CONNECT command.

The SQL statements that can be executed in the Db2 command line processor have the same syntax as SQL statements that are executed in application programs.
Read syntax diagramSkip visual syntax diagramALTER statementCALL statementCREATE statementDELETE statementDROP statementGRANT statementINSERT statementREVOKE statementSELECT statementUPDATE statement

Notes

Specifying output parameters in a CALL statement
To specify an output parameter in a CALL statement, use a question mark (?).

Examples

Example: Executing a query with the Db2 command line processor
Suppose that the sample tables are installed on a Db2 server with connection URL syszos1.abc.com:5021/ABCLOC1. Use the following commands to connect to that server, and isse a SELECT statement to display all the rows in the sample employee table.
CONNECT TO syszos1.abc.com:5021/ABCLOC1 USER myid01 USING mypw01
SELECT * FROM DSN8C10.EMP
Example: Calling a stored procedure with the Db2 command line processor
Suppose that you want to display information about all of the subsystem parameters, application programming defaults, and IRLM parameters for a Db2 server. The Db2-supplied stored procedure SYSPROC.ADMIN_INFO_SYSPARM provides that information. Use the following commands to connect to the server, and call the stored procedure.
CONNECT TO syszos1.abc.com:5021/ABCLOC1 USER myid01 USING mypw01
CALL SYSPROC.ADMIN_INFO_SYSPARM(NULL,?,?)
End of change