SQL statements
This section contains syntax diagrams, semantic descriptions, rules, and examples of the use of the SQL statements.
The 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.
| SQL statement | Function | Supported application program type |
|---|---|---|
ALTER DATABASE![]() |
Changes an existing database![]() |
Java™![]() |
ALTER TABLESPACE![]() |
Changes attributes of a data set group within
a database or an area for a DEDB![]() |
Java![]() |
ALTER TABLE![]() |
Changes attributes of a table within a database. ![]() |
Java![]() |
| CLOSE | Closes a cursor | COBOL, .NET |
COMMENT ON![]() |
Adds a comment to the definition of a resource
or object![]() |
Java![]() |
CREATE DATABASE![]() |
Defines a new database to IMS![]() |
Java![]() |
CREATE PROGRAMVIEW![]() |
Defines a new program view![]() |
Java![]() |
CREATE TABLE![]() |
Defines a new table![]() |
Java![]() |
CREATE TABLESPACE![]() |
Defines a data set group or Fast Path Area.![]() |
Java![]() |
| 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 |
DROP DATABASE![]() |
Removes a database from IMS![]() |
Java![]() |
DROP PROGRAMVIEW![]() |
Removes a program view![]() |
Java![]() |
DROP TABLE![]() |
Removes an existing table from a database![]() |
Java![]() |
DROP TABLESPACE![]() |
Removes a data set group within the database
or an area for a DEDB![]() |
Java![]() |
| 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 |