>>  <<  Ndx  Usr  Pri  Phr  Dic  Rel  Voc  !:  wd  Help  User

SQL Statements

The following SQL statements define the base ODBC SQL grammar.

Statement

Min

Core

Ext

alter-table-statement ::=
ALTER TABLE base-table-name
{ADD column-identifier data-type
|ADD (column-identifier data-type [, column-identifier data-type]... ) }

 

X

 

create-index-statement ::=
CREATE [UNIQUE] INDEX index-name
ON base-table-name
( column-identifier [ASC | DESC]
[, column-identifier [ASC | DESC] ]... )

 

X

 

create-table-statement ::=
CREATE TABLE base-table-name-1
(column-element [, column-element] ...)
column-element ::= column-definition | table-constraint-definition
column-definition ::=
column-identifier data-type
DEFAULT default-value
[column-constraint-definition [,column-constraint-definition]...]
column-constraint-definition ::=
NOT NULL
| UNIQUE | PRIMARY KEY )
| REFERENCES base-table-name-2 referenced-columns
| CHECK (search-condition)
default-value ::= literal | NULL | USER
table-constraint-definition ::=
UNIQUE (column-identifier [, column-identifier] ...)
| PRIMARY KEY (column-identifier
[, column-identifier] ...)
| CHECK (search-condition)
| FOREIGN KEY referencing-columns REFERENCES
base-table-name-2 referenced-columns

X

   

create-view-statement ::=
CREATE VIEW viewed-table-name
[( column-identifier [, column-identifier]... )] AS
query-specification

 

X

 

delete-statement-positioned ::=
DELETE FROM table-name WHERE CURRENT OF cursor-name

 

X

X

(v2)X

delete-statement-searched ::=
DELETE FROM table-name [WHERE search-condition]

X

   

drop-index-statement ::=
DROP INDEX index-name

 

X

 

drop-table-statement ::=
DROP TABLE base-table-name
[ CASCADE | RESTRICT ]

X

   

drop-view-statement ::=
DROP VIEW viewed-table-name
[ CASCADE | RESTRICT ]

 

X

 

grant-statement ::=
GRANT {ALL | grant-privilege [, grant-privilege]... }
ON table-name
TO {PUBLIC | user-name [, user-name]... }
grant-privilege ::=
DELETE
| INSERT
| SELECT
| UPDATE [( column-identifier [, column-identifier]... )]
| REFERENCES [( column-identifier
[, column-identifier]... )]

 

X

 

insert-statement ::=
INSERT INTO table-name [( column-identifier [, column-identifier]...)]
VALUES (insert-value[,insert-value]... )

X

   

insert-statement ::=
INSERT INTO table-name [( column-identifier [, column-identifier]... )]
{ query-specification | VALUES (insert-value [, insert-value]...}

 

X

 

ODBC-procedure-extension ::=
ODBC-std-esc-initiator [?=]call procedure ODBC-std-esc-terminator
| ODBC-ext-esc-initiator [?=]call procedure ODBC-ext-esc-terminator

   

X

revoke-statement ::=
REVOKE {ALL | revoke-privilege [, revoke-privilege]... }
ON table-name
FROM {PUBLIC | user-name [, user-name]... }
[ CASCADE | RESTRICT ]
revoke-privilege ::=
DELETE
| INSERT
| SELECT
| UPDATE | REFERENCES

 

X

 

select-statement ::=
SELECT [ALL | DISTINCT] select-list
FROM table-reference-list[
[WHERE search-condition]
[order-by-clause]

X

   

select-statement ::=
SELECT [ALL | DISTINCT] select-list
FROM table-reference-list
[WHERE search-condition]
[GROUP BY column-name [, column-name]... ]
[HAVING search-condition]
[UNION select-statement]...
[order-by-clause]

 

X

 

select-for-update-statement ::=
SELECT [ALL | DISTINCT] select-list
FROM table-reference-list
[WHERE search-condition]
FOR UPDATE OF [column-name [, column-name]...]

 

X

(v1)

X

(v2)

statement ::= create-table-statement
| delete-statement-searched | drop-table-statement
| insert-statement | select-statement
| update-statement-searched

X

   

statement ::= alter-table-statement
| create-index-statement
| create-table-statement
| create-view-statement
| delete-statement-positioned
| delete-statement-searched
| drop-index-statement
| drop-table-statement
| drop-view-statement
| grant-statement
| insert-statement
| revoke-statement
| select-statement
| select-for-update-statement
| update-statement-positioned
| update-statement-searched

 

X

 

statement ::= alter-table-statement
| create-index-statement
| create-table-statement
| create-view-statement
| delete-statement-positioned
| delete-statement-searched
| drop-index-statement
| drop-table-statement
| drop-view-statement
| grant-statement
| insert-statement
| ODBC-procedure-extension
| revoke-statement
| select-statement
| select-for-update-statement
| statement-list
| update-statement-positioned
| update-statement-searched

   

X

statement-list ::= statement | statement;statement-list

   

X

update-statement-positioned ::=
UPDATE table-name
SET column-identifier = {expression | NULL}
[, column-identifier = {expression | NULL}]...
WHERE CURRENT OF cursor-name

 

X

(v1)

X

(v2)

update-statement-searched
UPDATE table-name
SET column-identifier = {expression | NULL }
[, column-identifier = {expression | NULL}]...
[WHERE search-condition]

X

   


>>  <<  Ndx  Usr  Pri  Phr  Dic  Rel  Voc  !:  wd  Help  User