SQL Statements

Alter Table Statement

The Alter table statement changes a table definition.
alter table statement ::=
    ALTER TABLE table spec
    { { ADD|MODIFY|ALTER [ COLUMN ] column def list } |
      { DROP [ COLUMN ] column name list }
    }+ ';'

Connect Statement

The Connect statement creates a Pass-Through connection.
connect statement ::=
    CONNECT TO libref name [ [ AS ]
    alias name ] '('
    dbms options ')' ] ';'

Create Index Statement

The Create Index statement creates an index on a table.
create index statement ::=
    CREATE [ UNIQUE ] INDEX index name ON
    table spec '(' column name list ')' ';'

Create Table Statement

The Create Table statement creates a table definition.
create table statement ::=
    CREATE TABLE table spec
    { '(' column def list ')' | AS
select spec | LIKE
table spec } ';'

Create View Statement

The Create View statement creates a view upon one or more tables.
create view statement ::= CREATE VIEW
table spec AS
select spec ';'
 

Delete Statement

The Delete statement deletes records.
delete statement ::= DELETE FROM
table spec [
where clause ] ';'

Describe Table Statement

The Describe Table statement describes a table definition.
describe table statement ::=
    DESCRIBE TABLE table spec [ [',']
    table spec ]* ';'

Describe View Statement

The Describe View statement describes a view definition.
describe view statement ::=
    DESCRIBE VIEW table spec [ [',']
    table spec ]* ';'

Disconnect Statement

The Disconnect statement is a Pass-Through statement.
disconnect statement ::= DISCONNECT FROM
libref name ';'

Drop Index Statement

The Drop Index statement drops an index from a table.
drop index statement ::=
    DROP INDEX index name [ [',']
    index name ]* FROM
    table spec ';'

Drop Table Statement

The Drop Table statement drops a table definition.
drop table statement ::= DROP TABLE
table spec [ [',']
table spec ]* ';'

Drop View Statement

The Drop View statement drops a view definition.
drop view statement ::=
    DROP VIEW table spec [ [',']
    table spec ]* ';'

Execute Statement

The Execute statement is a Pass-Through statement.
execute statement ::= EXECUTE '('
passthru spec ')' BY
libref name ';'

Insert Statement

The Insert statement adds records.
insert statement ::=
    INSERT INTO table spec [ '('
    column name list ')' ]
    insert source ';'

Reset Statement

The Reset statement resets session options and flags.
set option statement ::=
    { SET OPTION  | RESET }
    { identifier
 [ '=' { constant |
identifier |
truth value
| DEFAULT } ] }+

Select Statement

The Select statement retrieves information.
select statement::=
select spec ';'

Truncate Table Statement

The Truncate Table statement drops a table definition.
truncate teble statement::= TRUNCATE TABLE
table spec [ [',']
table spec ]* ';'

Update Statement

The Update statement updates records.
update statement ::=
    UPDATE table spec
    SET column name '='
scalar expr [ ','
column name '='
scalar expr ]*
    [ where clause ] ';'

Validate Statement

The Validate statement validates a given select specification.
validate statement ::= VALIDATE
select spec ';'