C-Style Comment Indicator with DB-Access
Earlier versions of Informix Dynamic Server (IDS) had restriction with C-style comment indicators ( /* ... */ ) in SQL statements, within the DB–Access operations.
Without the C-style comment indicator it was not compliance with SQL-99 standard and caused problems while migrate from other databases server.
Starting with IDS Version 11.10, restrictions with C-style comment are no longer in effect. Any of the following styles SQL comment indicators can be use in all DB–Access statements.
- Double hyphen ( -- ) complies with the ANSI/ISO standard for SQL
- Braces ( { } ) are an Informix extension to the ANSI/ISO standard
- C-style slash-and-asterisk ( /* . . . */ ) comply with the SQL-99 standard
The comment symbol indicator can be choosing depends on ANSI/ISO compliance requirements.
Comment symbol indicator can be use on the same line with the SQL statement. It can spans across single-line or multiple-line, but cannot be nested.
DB-Access will filter any comments before sending SQL statement to the database server.
Examples: -- Double hyphen comment SELECT * FROM orders; -- Selects all columns and rows -- from the orders table
{ Comment using braces } SELECT * FROM orders; { Selects all columns and rows from the orders table }
/* C-style comment */ SELECT * FROM orders; /* Selects all columns and rows from the orders table */
Sanjit Chakraborty|
|