Adding /*comments*/ to sql

Forums:

I'm trying to add comments to SQl queries in Custom SQL Reports and using either
--comments--
or
/*comments*/
breaks the query. Is there a way to add comments or to comment-out a line of code?

Bob Owens
Addison NW SU

Just curious if anyone knows off the top the sql to update the custom fields on the log table..

thanks,
Bonnie

Bonnie

Default PL/SQL comments use the double dash:

SELECT FIELD1,
FIELD2,
--FIELD3,
FIELD4
FROM TABLE;

A word of caution, if the line you comment causes an incomplete statement, you'll need to move the statement modifiers appropriately. In my example, FIELD3 has a comma. If it were the last item (no FIELD4), the statement would look as such and error on FIELD2, because there is no "FROM" in the select statement.

SELECT FIELD1,
FIELD2,
--FIELD3
From Table

J Bartee
Westside Union School District
Software and Web Specialist
j.bartee@westside.k12.ca.us

Subscribe to Comments for "Adding /*comments*/ to sql"