Sunteți pe pagina 1din 2

SQL Commands The DB2 <db_desc> clause syntax is:

RIS SQL Commands Quick Reference db2, dbname <dbname>, ostype=unix,


This quick reference card is designed to give you an easy way alter schema [osuser=<user>[.<password>]]
to find the RIS SQL commands. Detailed descriptions can be alter schema <schema>[.<passwd>] gateway ([arch=<arch>,] [os=<os>,]
found in the RIS SQL Users Guide for 32-Bit Applications { to secure | {host_program= <host_program>,
(DNA1116). modify schema password <passwd> | ris_lu= <ris_lu>, host_lu= <host_lu>,
modify user password <passwd> | mode= <mode>
Schema Creation View Manipulation [ , osuser <osuser>[.<passwd>] [net_protocol=<lu 6.2>,]
Create Schema Drop View [ , remote ( {<protocol> <node> } [, ...])] | [env=<cics>,]
Schema Manipulation Declare View modify db2 password from <passwd> | net_protocol=tcp, node=<node>, port=<port>
Alter Schema Undeclare View to <passwd> [ using mode <mode> ] | [env=native,] })
Declare Schema Data Manipulation
include {table [<dbmsuser>. ] <dbmstable> The Rdb <db_desc> clause syntax is:
Default Schema Insert
[ as <ristable> [ (riscolum> [, ...] )] | rdb, dbname <dbname>, ostype <vms>
Drop Schema Delete
view [<dbmsuser>. ] <dbmsview> [as <risview> The SYBASE <db_desc> clause syntax is:
Open Schema Select
Close Schema Update [<riscolumn> [, ...])] | sybase, dbname <dbname>,
Undeclare Schema Additional SQL Statements index [<dbmsuser>. ] <dbmsindex> [osuser <osuser>[.<passwd>],]
Table Creation Grant [as <risindex> ] } | ostype <ostype>, dir <sybase-interfaces-
Create Table Revoke exclude {table <ristable> | view <risview> | file-path>
Table Manipulation Commit index <risindex> }; [, option (dsquery=<sybase-server-name>,
Alter Table Rollback alter table filename=<sybase-interfaces-file-name>)]
Drop Table Exec alter table <table> add <riscolumn> <datatype>[not null] The OS400 <db_desc> clause syntax is:
Declare Table Set Database [extern <dbmscolumn>]; os400, dbname <dbname>, ris_dict_dbname
Undeclare Table Set Mode close schema <ris_dictdbname>, ostype <unix>,
Lock Tables Set Transaction close schema {<schema> [, ...] } | ALL; [osuser=<userid>[.<password>],]
Create Index Set Network commit gateway { net_protocol=<appc | APPC>,
Drop Index Nested Queries commit [work] [ for <schema> ]; mode=<mode>, ris_lu=<local_LU>,
View Creation SQL Functions create index host_lu=<remote_LU>,
Create View Union create [unique] index <risindex> host_program=<host_program>}
Where Conditions
extern <dbmsindex> on <ristable> create table
RIS Datatypes (<riscolumn> [, ...]); create table <ristable> ({<riscolumn> <datatype>
create schema [not null] }[, ...]) [extern <dbmstable>
SQL String SQL code Description create [secure] schema [authorization] <schema> {<dbmscolumn> [, ...])]];
char[acter](n) CHARACTER Maximum of 240 ASCII [.<passwd>] create view
characters. [on database (<db_desc> [, remote create view <risview> [(<column-list>)]
int[eger] INTEGER Range -2,147,483,648 to (<protocol> <node> [extern <dbmsview>[(<dbmscolumn-list>)] as
2,147,483,647. [, <protocol> <node> ...])], <select-statement>;
smallint SMALLINT Range -32,768 to 32,767. [server version <maj>[.<feature>]] declare table
double DOUBLE Real number in double [user <username>[.<feature>]] declare table [<schema>.] <table> ({<riscolumn>
[precision] precision floating point [force] [include | exclude] <datatype> [not null]}[, ...]) [extern
format. [using <user>]; [<dbmsuser>.<dbmstable>[ (dbmscolumn> [, ...])]]
real REAL Real number in single The INFORMIX <db_desc> clause syntax is: [with [partial] verify option];
precision floating point informix, dbname <dbname>, dir <dir> declare view
format.
[, option ([sqlexec= <sqlexec>] declare view [<schema>.]<view> ({<riscolumn>
decimal[(p[, s]) DECIMAL Maximum precision is 15.
[, dbtemp=< dbtemp>] <datatype>[not null]}[, ...]) [extern
timestamp TIMESTAMP Consists of year, month,
[, tbconfig= <tbconfig> ])] [<dbmsuser>.]<dbmsview>[(<dbmscolumn>
day, hour, minute, second
(timestamp yyyy-mm- The INGRES <db_desc> clause syntax is: [, ...])]] [with [partial] verify option];
dd:hh:mm:ss or ingres, dbname <dbname>, ostype declare schema
current_timestamp). <ostype>, dir <dir> declare schema <schema>.[<passwd>] [user<username>
ris_blob(n) RIS_BLOB Maximum of 2 gigabytes of The ORACLE <db_desc> clause syntax is: [.<passwd>]] [osuser <osusername>[.<passwd>]];
binary data. oracle, dbname <dbname>, default schema
ris_text(n) RIS_TEXT Maximum of 2 gigabytes of dir <oracle_home> | dbms_net, default schema <schema>[.<passwd>];
variable length character [osuser <osuser>[.<passwd>],]
data. ostype <ostype>
delete set network
delete from [<schema>.] <relation> set network verification
[where <conditions>];
drop index
[timestamp interval <value>,]
[initial timeout <value>,]
RIS SQL Commands
drop index <index>; [timestamp tolerance <value>,]
Quick Reference
drop schema [buffer full size <value>,]
drop schema <schema> [.<passwd>][force]; [buffer full timeout <value>,]
drop table [response interval <value>] DNA100340
drop table <table>; [for <schema> [,...]]; August 1995
drop view set transaction
Version 5
drop view <view>; set transaction autocommit {on | off };
exec undeclare schema
exec <database-type> <string>; undeclare schema [ALL | <schname1, schname2, ...>];
grant (to schema) undeclare table
grant <rel-privileges> on [<schema>.] <relation> to undeclare table [<schema>.] <table>;
<schema-list> [with grant option]; undeclare view
grant (to user) undeclare view [<schema>.] <view>;
grant <rdbmsuser-privilege> to [<rdbmsuser>]; union
insert <select-statement> union [all] <select-statement>
insert into [<schema>.] <relation> [(<column-list>)] [union [all] <select-statement] [ ... ];
values (<values-list>); update
--OR-- update [<schema>.]<relation> set
insert into [<schema>.] <relation> [(<column-list>)] {<column> = <value>} [, ...] [where <conditions>];
<select-statement>; where
lock tables where <condition>;
lock tables [{[<schema>.]<table>}[, ...] in share mode] The condition identifier consists of one of the following:
[{[ <schema> .] <table> }[, ...] in exclusive mode] <condition> <boolean> <condition>
[{[ <schema> .] <table> }[, ...] in default mode]; not <condition>
open schema <expr> <comparison-op> <expr>
open schema <schema> [, ...]; <expr> [not] between <expr> and <expr>
revoke (from schema) <expr> [not] in (<value-list>)
revoke <rel-privileges> on [<schema>.] <relation> <column> is [not] null
from <schema-list>; <char column> [not] like <wildcard-string>
revoke (from user) <nested-query>
revoke <rdbmsuser-privilege> from [<username>]; Nested Query
rollback
rollback [work] [for <schema> ]; <expr> <comparison-op> all (<select-statement>)
select <expr> <comparison-op> any (<select-statement>)
select [all | distinct] <column-list> from <relation-list> <expr> <comparison-op> some (<select-statement>)
[ where <conditions>] [not] exists (<select-statement>)
[ group by <column> [,...] ] <expr> [not] in (<select-statement>)
[ having <conditions>]
[ order by {<column> | <num> [{asc | desc}]}
SQL Functions
[, ... ]; count(*) RIS and Intergraph are registered trademarks of
set database --OR-- Intergraph Corporation.
set database enable [all | only <database> [, ...] ]; {avg | max | min | sum | count} (distinct <column>)
set mode --OR--
set mode [ansi {on | off}] [verify {on | off}] {avg | max | min | sum} ([all <expr>)
[blank strip {on | off}] [autorename {on | off}]; --OR--
user
--OR--
current_timestamp

S-ar putea să vă placă și