Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding comments to query in Crystal SQL Designer???

Status
Not open for further replies.

KellyStee

Technical User
Jul 30, 2001
106
US
Is there a way to comment out text in Crystal SQL Designer?
In Crystal Reports, with formulas, I know this can be done with two forward-slashes "//", but I can't seem to figure out how to make this work in the SQL Designer!

Thanks!

Kelly
kelly.steensma@us.pwcglobal.com
PricewaterhouseCoopers
 
Use SQL sytax for comments, rather than Crystal.
Sometimes it will depend on the database, however, generally two dashes "--" will comment out a single line. Oracle supports enclosing multi-line comments enclosed between /* and */

Also, I have had a number of problems if I try and put comments first, before any part of the SQL statement.

Good luck.
 
Thanks, Chris! I played around with that and you're right, it does work, but also seems a bit screwy. It seems all lines that appear after the commented line are commented out. So you can't comment out just one single line in the middle of a piece of code. Like I did:

SELECT employee_nbr, salary
FROM employees
--where terminated = 'N'
WHERE salary > 100000

and even though the second 'Where' clause isn't commented out (it brings back one record in SQL Plus), in SQL Designer, it ignores everything that is after the double-hyphen (meaning BOTH 'Where' clauses) and brings back all data ). Rather screwy, eh?

Let me know if you get different results.

Kelly
 
Kelly,

As you already know, you are right. I had never noticed that behavior before. The workaround would be to use the multi-line comments tags (/* */) to enclose comments. That way Crystal sees a definite end to the comments. It seemed to work for me.
 
Ohhhhh, you're right! The /* and */ work correctly.
Thanks for the help!

Kelly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top