Kiran wrote:
PHP driver is written using CLI/ODBC so It should support /* */
comments as Serge poined out if you are using v8 FP12
Just a quick correction here: C-style /*...*/ comments are supported
since FP11 (is there an FP12? I thought 11 was the latest?)
As pointed out by Knut, SQL-style -- comments can be problematic as
some clients strip line breaks (which obviously means that anything
after the first -- comment becomes part of the comment ... d'oh!).
Furthermore, as I understand it, DB2 strictly interprets the SQL
standard's definition of SQL-style comments which apparently (I don't
have a copy of the SQL standard, so I can't verify) states that the
opening "--" in SQL-style comments must be the first non-whitespace
characters in the line.
This can be verified by trying it in the CLP (not sure what Serge meant
when he said SQL-style comments will be supported in CLP in Viper as
they've been supported in CLP for several versions now, provided they
adhere to the above rule):
db2 => SELECT
db2 (cont.) => -- This is a valid comment
db2 (cont.) => VARCHAR(SCHEMANAME,8) AS SCHEMANAME
db2 (cont.) => FROM SYSCAT.SCHEMATA;
SCHEMANAME
----------
DOCCAT
DOCDATA
DOCTOOLS
NULLID
SQLJ
SYSCAT
SYSFUN
SYSIBM
SYSPROC
SYSSTAT
SYSTOOLS
11 record(s) selected.
db2 => SELECT -- This is NOT a valid comment
db2 (cont.) => VARCHAR(SCHEMANAME,8) AS SCHEMANAME
db2 (cont.) => FROM SYSCAT.SCHEMATA;
SQL0104N An unexpected token "END-OF-STATEMENT" was found following
"SELECT".
Expected tokens may include: "JOIN <joined_table>". SQLSTATE=42601
HTH,
Dave.
--