SQL statements

This section contains syntax diagrams, semantic descriptions, rules, and examples of the use of the SQL statements.

Start of changeThe SQL support for COBOL provides the underlying SQL functions for the IBM® IMS Data Provider for Microsoft .NET. All SQL statements supported for COBOL application programs and their syntax and rules also apply to .NET applications.End of change
Table 1. SQL statements
SQL statement Function Supported application program type
Start of changeALTER DATABASEEnd of change Start of changeChanges an existing databaseEnd of change Start of changeJava™End of change
Start of changeALTER TABLESPACEEnd of change Start of changeChanges attributes of a data set group within a database or an area for a DEDBEnd of change Start of changeJavaEnd of change
Start of changeALTER TABLEEnd of change Start of changeChanges attributes of a table within a database. End of change Start of changeJavaEnd of change
CLOSE Closes a cursor COBOL, .NET
Start of changeCOMMENT ONEnd of change Start of changeAdds a comment to the definition of a resource or objectEnd of change Start of changeJavaEnd of change
Start of changeCREATE DATABASEEnd of change Start of changeDefines a new database to IMSEnd of change Start of changeJavaEnd of change
Start of changeCREATE PROGRAMVIEWEnd of change Start of changeDefines a new program viewEnd of change Start of changeJavaEnd of change
Start of changeCREATE TABLEEnd of change Start of changeDefines a new tableEnd of change Start of changeJavaEnd of change
Start of changeCREATE TABLESPACEEnd of change Start of changeDefines a data set group or Fast Path Area.End of change Start of changeJavaEnd of change
DECLARE CURSOR Defines an SQL cursor COBOL, .NET
DECLARE STATEMENT Declares names used to identify prepared SQL statements COBOL, .NET
DELETE Deletes one or more rows from a table COBOL, .NET, Java
DESCRIBE OUTPUT Describes the result columns of a prepared statement COBOL, .NET
Start of changeDROP DATABASEEnd of change Start of changeRemoves a database from IMSEnd of change Start of changeJavaEnd of change
Start of changeDROP PROGRAMVIEWEnd of change Start of changeRemoves a program viewEnd of change Start of changeJavaEnd of change
Start of changeDROP TABLEEnd of change Start of changeRemoves an existing table from a databaseEnd of change Start of changeJavaEnd of change
Start of changeDROP TABLESPACEEnd of change Start of changeRemoves a data set group within the database or an area for a DEDBEnd of change Start of changeJavaEnd of change
EXECUTE Executes a prepared SQL statement COBOL, .NET
FETCH Positions the cursor, returns data, or both positions the cursor and returns data COBOL, .NET
INCLUDE Inserts declarations into a source program COBOL, .NET
INSERT Inserts one or more rows into a table COBOL, .NET, Java
OPEN Opens a cursor COBOL, .NET
PREPARE Prepares an SQL statement (with optional parameters) for execution COBOL, .NET
SELECT Specifies the SELECT statement of the cursor COBOL, .NET, Java
UPDATE Updates the values of one or more columns in one or more rows of a table COBOL, .NET, Java
WHENEVER Defines actions to be taken on the basis of SQL return codes COBOL, .NET