最近在研究SQL99标准,在ISO/IEC 9075-2:1999中查select into 语句用法如下:
<select statement: single row> ::=
SELECT [ <set quantifier> ] <select list>
INTO <select target list>
<table expression>
<select target list> ::=
<target specification> [ { <comma> <target specification> }... ]
Syntax Rules
1) <select target list> shall not contain a <target specification> that specifies a <column reference>.
2) The number of elements in the <select list> shall be the same as the number of elements in the
<select target list>. The i-th <target specification> in the <select target list> corresponds with
the i-th element of the <select list>.
3) For each <target specification> TS that is the <SQL parameter name> of a parameter of an
SQL-invoked routine, the Syntax Rules of Subclause 9.2, ‘‘Store assignment’’, apply to TS and
the corresponding element of the <select list>, as TARGET and VALUE, respectively.
4) For each <target specification> TS that is a <host parameter name>, the Syntax Rules of
Subclause 9.1, ‘‘Retrieval assignment’’, apply to TS and the corresponding element of the <select
list>, as TARGET and VALUE, respectively.
5) A <select statement: single row> is possibly non-deterministic if it contains a <routine invocation>
whose subject routines is an SQL-invoked routine that is possibly non-deterministic.
6) Let S be a <query specification> whose <select list> and <table expression> are those specified
in the <select statement: single row> and that specifies the <set quantifier> if it is specified in
the <select statement: single row>. S shall be a valid <query specification>.
Access Rules
None.
General Rules
1) Let Q be the result of <query specification> S.
2) Case:
a) If the cardinality of Q is greater than 1 (one), then an exception condition is raised: cardinality
violation. It is implementation-dependent whether or not SQL-data values are
assigned to the targets identified by the <select target list>.
Data manipulation 665
ISO/IEC 9075-2:1999 (E) ©ISO/IEC
14.5 <select statement: single row>
b) If Q is empty, then no SQL-data values are assigned to any targets identified by the <select
target list>, and a completion condition is raised: no data.
c) Otherwise, values in the row of Q are assigned to their corresponding targets.
3) If a completion condition no data has been raised, then no further General Rules of this
Subclause are applied.
4) For each <target specification> TS that is the <SQL parameter name> of a parameter of an
SQL-invoked routine, the corresponding value in the row of Q is assigned to TS according to the
General Rules of Subclause 9.2, ‘‘Store assignment’’, as VALUE and TARGET, respectively. The
assignment of values to targets in the <select target list> is in an implementation-dependent
order.
5) For each <target specification> TS that is a <host parameter name>, the corresponding value
in the row of Q is assigned to TS according to the General Rules of Subclause 9.1, ‘‘Retrieval
assignment’’, as VALUE and TARGET, respectively. The assignment of values to targets in the
<select target list> is in an implementation-dependent order.
6) If an exception condition is raised during the assignment of a value to a target, then the values
of all targets are implementation-dependent.
Conformance Rules
None.不知是不是我看得不仔细,反正在标准中未看到举例,所以还是不知如何用,感觉比SQL Server2000的联机帮助差远了。
有哪位高人告诉我如何学习SQL99标准,如何查看相关语句的用法,或哪里有好的SQL标准学习网站。