cancel
Showing results for 
Search instead for 
Did you mean: 

Are single quotes allowed in comments ?

reimer_pods
Participant
2,332

I encountered an error executing a CREATE PROCEDURE statement and burned it down to the following example:

create procedure CommentTest 
as 
begin
  -- a comment's text may not contain any single quotes
  select 1 from dummy
end

If I try to execute that with ISQL (Java) 11.0.1.2467 it gives me an error:

Could not execute statement.
Syntax error or access violation
SQLCODE=0, ODBC 3 State="42000"

The same statement works with the C-Version of ISQL (dbisqlc.exe).
Might I call this a bug or a feature?

Breck_Carter
Participant
0 Kudos

Works for me, in the dbisql that ships with 11.0.1.2276 and 12.0.0.2483. What version are you using? FWIW I have bazillions of -- comments containing embedded quotes, never a problem.

justin_willey
Participant
0 Kudos

Fine in 10.0.1.3931

reimer_pods
Participant
0 Kudos

Must be version specific, it works too in 12.00.2483

0 Kudos

Works on 11.0.1.2467

Breck_Carter
Participant
0 Kudos

@Vincent: Please re-confirm that Reimer's exact procedure (which is in Transact SQL syntax) works for you on 11.0.1.2467... since that fails for Reimer.

0 Kudos

@Breck: I copied and executed Reimer's code above on 11.0.1.2467 without a glitch. I also have tons of comments with single quotes in them

Accepted Solutions (1)

Accepted Solutions (1)

Breck_Carter
Participant

Yes, single quotes are allowed inside -- comments.

There may (must?) be something else going wrong with your example... what version of SQL Anywhere are you using?

Breck_Carter
Participant
0 Kudos

You've convinced me to stay on 11.0.1.2276 🙂

reimer_pods
Participant
0 Kudos

Re-Edited my question to fix version info: it's really 11.0.1.2467. Same thing on another machine using 11.0.1.2376.

Answers (0)