Richard wrote:
Quote:
Thanks. :-) That worked on my 9.1 server. A coworker tried on an 8.x
server and got
an error with the (= , so I'll assume it only works in 9.x.
>
So what am I intrepreting incorrectly. In the 9.0 SQL Reference
Manual is says use /* */, yet the CLP manual says (= =). Since I'm
running a SQL script in the CLP, shouldn't either work? Maybe I'm
misunderstanding the audience of the SQL Reference manual.
>
Thanks.
|
To be precise:
SQL Reference states:
SQL comments
Static SQL statements can include host language or SQL comments. Dynamic
SQL statements can include SQL comments. There are two types of SQL
comments:
simple comments
Simple comments are introduced by two consecutive hyphens (--) and
end with the end of line.
bracketed comments
Bracketed comments are introduced by /* and end with */.
The following rules apply to the use of simple comments:
* The two hyphens must be on the same line and must not be
separated by a space.
* Simple comments can be started wherever a space is valid (except
within a delimiter token or between 'EXEC' and 'SQL').
* Simple comments cannot be continued to the next line.
* In COBOL, the hyphens must be preceded by a space.
The following rules apply to the use of bracketed comments:
* The /* must be on the same line and must not be separated by a space.
* The */ must be on the same line and must not be separated by a space.
* Bracketed comments can be started wherever a space is valid
(except within a delimiter token or between 'EXEC' and 'SQL').
* Bracketed comments can be continued to subsequent lines.
Let me show this again:
*Static SQL statements* can include host language or SQL comments.
*Dynamic SQL statements* can include SQL comments.
This would be correct:
select /* I am using
SELECT keyword
*/
count /* I am going
to count
rows
*/
(*) from /* I will use
Sample database
ORG table
here
*/
ORG;
but you *WERE NOT* including bracketed comments in Static or dynamic SQL
statement; you were trying to comment out lines in CLP script - hence
you have to use CLP syntax.
Jan M. Nelken