#1092 apostrophe in comment prevents SQuirreL from recognizing parameters on any following lines

3.4.0
open
nobody
None
5
2013-10-07
2013-07-16
Joel
No

(I am using version 3.5.0)

If you have an apostrophe in an SQL comment, SQuirreL does not seem to recognize any parameters on any following lines. The following SQL code illustrates the problem. SQuirreL sends the code straight to the JDBC driver without prompting for a value for :zip. Remove the apostrophe, and it finds the :zip parameter.

SELECT
-- the ' in this comment keeps SQuirreL from finding the :zip parameter
*
FROM Company
WHERE ZipCode = :zip

SQuirreL is an awesome tool. I happened to notice a peculiar but reproducible bug, so I thought I would submit it. I realize that this issue is probably not a high priority.

Discussion

  • sfst
    sfst
    2013-10-07

    An odd number of apostrophes causes problems. My problem is in reverse, I don't have parameters in my select, but SQuirreL sees it different:

    --One apostrophe ' in this comment causes being prompted for parameter values
    --only blank values work; consequently no minutes or seconds are shown
    select to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') FROM dual;

    /* such comments stuck to the SQL make it fail,
    even if the multi-line comment removal for Oracle is checked */
    select to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') FROM dual;

    --works fine:
    select to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') /* some info */ FROM dual;

    --fails
    select to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') /* some info ' */ FROM dual;

    --works fine:
    select to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') --some info '
    FROM dual;

    The single SELECT commands are not a real problem, but when writing procedures I prefer heavy commenting, which brought up the problem.

    My current workaround is not using any apostrophes in the comments or make their number even in each comment block.

    I agree: low priority