Command line processor SQL statements
Execute SQL statements in the command line processor after you issue the CONNECT command.
The SQL statements that can be executed in the command line processor have the same
syntax as SQL statements that are executed in application programs.
>>-+-ALTER statement--+---------------------------------------->< +-CALL statement---+ +-CREATE statement-+ +-DELETE statement-+ +-DROP statement---+ +-GRANT statement--+ +-INSERT statement-+ +-REVOKE statement-+ +-SELECT statement-+ '-UPDATE 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 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 DSN8A10.EMP
- Example: Calling a stored procedure with the 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,?,?)