You can add comments to clarify the purpose or effect of particular SQL statements. You can also use comment symbols during program development to disable individual statements without deleting them from your source code.
Your comments can help you or others to understand the role of the statement within a program, SPL routine, or command file. The code examples in this manual sometimes include comments that clarify the role of an SQL statement within the code, but your own SQL programs will be easier to read and to maintain if you document them with frequent comments.
The following table shows the SQL comment indicators that you can enter in your code. Here a Y in a column signifies that you can use the symbol with the product or with the type of database identified in the column heading. An N in a column signifies that you cannot use the symbol with the indicated product or with a database of the indicated ANSI-compliance status.
Characters within the comment are ignored by the database server.
The section Optimizer Directives describes a context where information within comments can influence query plans of Dynamic Server.
If the product that you use supports all of these comment symbols, your choice of a comment symbol depends on requirements for ANSI/ISO compliance:
If ANSI/ISO compliance is not an issue, your choice of comment symbols is a matter of personal preference.
In DB–Access, you can use any of these comment symbols when you enter SQL statements with the SQL editor and when you create SQL command files with the SQL editor or a system editor. C-style ( /* . . . */ ) comments, however, are not supported by DB–Access within CONNECT, DISCONNECT, INFO, LOAD, OUTPUT, SET CONNECT, nor UNLOAD statements.
An SQL command file is an operating-system file that contains one or more SQL statements. Command files are also known as command scripts. For more information about command files, see the discussion of command scripts in the IBM Informix Guide to SQL: Tutorial. For information on how to create and modify command files with the SQL editor or a system editor in DB–Access, see the IBM Informix DB–Access User's Guide.
You can use either comment symbol in any line of an SPL routine. See the discussion of how to comment and document an SPL routine in the IBM Informix Guide to SQL: Tutorial.
In ESQL/C, the double hyphen ( -- ) can begin a comment that extends to the end of the same line. For information on language-specific comment symbols in ESQL/C programs, see the IBM Informix ESQL/C Programmer's Manual.
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]