IBM Books

Call Level Interface Guide and Reference


Appendix I. Supported SQL Statements


Table 215. SQL Statements (DB2 Universal Database)
SQL Statement Dynamic1 Command Line Processor (CLP) Call Level Interface3 (CLI)
ALTER { BUFFERPOOL, NODEGROUP, TABLE, TABLESPACE, TYPE, VIEW  } X X X
BEGIN DECLARE SECTION2      
CALL   X9 X4
CLOSE   X SQLCloseCursor(), SQLFreeStmt()
COMMENT ON X X X
COMMIT X X SQLEndTran, SQLTransact()
Compound SQL     X4
CONNECT (Type 1)   X SQLBrowseConnect(), SQLConnect(), SQLDriverConnect()
CONNECT (Type 2)   X SQLBrowseConnect(), SQLConnect(), SQLDriverConnect()
CREATE { ALIAS, BUFFERPOOL, DISTINCT TYPE, EVENT MONITOR, FUNCTION, INDEX, NODEGROUP, PROCEDURE, SCHEMA, TABLE, TABLESPACE, TRIGGER, TYPE, VIEW } X X X
DECLARE CURSOR2   X SQLAllocStmt()
DELETE X X X
DESCRIBE8   X SQLColAttributes(), SQLDescribeCol(), SQLDescribParam()6
DISCONNECT   X SQLDisconnect()
DROP X X X
END DECLARE SECTION2      
EXECUTE     SQLExecute()
EXECUTE IMMEDIATE     SQLExecDirect()
EXPLAIN X X X
FETCH   X SQLExtendedFetch()7, SQLFetch(), SQLFetchScroll()7
FREE LOCATOR     X4
GRANT X X X
INCLUDE2      
INSERT X X X
LOCK TABLE X X X
OPEN   X SQLExecute(), SQLExecDirect()
PREPARE     SQLPrepare()
RELEASE   X  
RENAME TABLE X X X
REVOKE X X X
ROLLBACK X X SQLEndTran(), SQLTransact()
select-statement X X X
SELECT INTO      
SET CONNECTION   X SQLSetConnection()
SET CONSTRAINTS X X X
SET CURRENT DEGREE X X X
SET CURRENT EXPLAIN MODE X X X, SQLSetConnectAttr()
SET CURRENT EXPLAIN SNAPSHOT X X X, SQLSetConnectAttr()
SET CURRENT FUNCTION PATH X X X
SET CURRENT PACKAGESET      
SET CURRENT QUERY OPTIMIZATION X X X
SET EVENT MONITOR STATE X X X
SET transition-variable5 X X X
SIGNAL SQLSTATE5 X X X
UPDATE X X X
VALUES INTO      
WHENEVER2      
Notes:
  1. You can code all statements in this list as static SQL, but only those marked with X as dynamic SQL.
  2. You cannot execute this statement.
  3. An X indicates that you can execute this statement using either SQLExecDirect() or SQLPrepare() and SQLExecute(). If there is an equivalent DB2 CLI function, the function name is listed.
  4. Although this statement is not dynamic, with DB2 CLI you can specify this statement when calling either SQLExecDirect(), or SQLPrepare() and SQLExecute().
  5. You can only use this within CREATE TRIGGER statements.
  6. You can only use the SQL DESCRIBE statement to describe output, whereas with DB2 CLI you can also describe input (using the SQLDescribeParam() function).
  7. You can only use the SQL FETCH statement to fetch one row at a time in one direction, whereas with the DB2 CLI SQLExtendedFetch() and SQLFetchScroll() functions, you can fetch into arrays. Furthermore, you can fetch in any direction, and at any position in the result set.
  8. The DESCRIBE SQL statement has a different syntax than that of the CLP DESCRIBE command. For information on the DESCRIBE SQL statement, refer to the SQL Reference. For information on the DESCRIBE CLP command, refer to the Command Reference.
  9. When CALL is issued through the command line processor, only certain procedures and their respective parameters are supported .


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]