Sunday, June 17, 2007

Cheetah spot by spot: C style comments in dbaccess

Another quick note on another minor (from my point of view) feature of IDS 11.10.
Beginning with v11.10 dbaccess will accept C language style multi-line comments.

As such, you can write things like:

SELECT * /* this is the
select clause */
FROM customer /* This is the FROM clause */

This will allow for better compatibility with other RDBMS SQL scripts, and it's also SQL-99 compliant.

The other forms of comments recognized by dbaccess will still be available:
  • "-- comments" for single line comments
  • "{ comments }" for multi-line comments
The introduction of this commenting style also affects the ways to specify optimizer directives.
The syntax /*+ */ are also accepted in the new version. So, you could use this:

SELECT /*+ FULL ( customer ) */ *
customer_num = 101;

to force the query to make a full table scan.

No comments: