Menu

#62 ParseException with new 10g "Q" function.

next_release
open
5
2006-11-30
2006-11-30
No

Oracle 10g has introduced a new "Q" function that allow convenient enclosure of strings containing single-quotes within a different set of string delimiters so you don't have to double the single-quotes to get a single literal one in the string value. For example...

string1 VARCHAR2(100) := 'That''s all folks';

is the same as

string2 VARCHAR2(100) := Q'"That's ALL folks"';
string3 VARCHAR2(100) := Q'[That's ALL folks]';
string4 VARCHAR2(100) := Q'(That's ALL folks)';
string5 VARCHAR2(100) := Q'{That's ALL folks}';
string6 VARCHAR2(100) := Q'<That's ALL folks>';
string7 VARCHAR2(100) := Q'~That's ALL folks~';
etc...

Nothing really parses this very well, but neither does PLDoc so I figured I'd pass this along.

Parsing file kaboom2.pks ...
ParseException at package <kaboom2.pks>: net.sourceforge.pldoc.parser.ParseException: Encountered "\'\"\r\nThis string uses THE NEW Q FUNCTION!\r\n\"\'" at line 3, column 40.
Was expecting one of:
"/" ...
<...stuff omitted for brevity...>
":=" ...

Last consumed token: "Q"
net.sourceforge.pldoc.parser.ParseException: Encountered "\'\"\r\nThis string uses THE NEW Q FUNCTION!\r\n\"\'" at line 3, column 40.
Was expecting one of:
"/" ...
<...stuff omitted for brevity...>
":=" ...

at net.sourceforge.pldoc.parser.PLSQLParser.generateParseException(PLSQLParser.java:10862)
at net.sourceforge.pldoc.parser.PLSQLParser.jj_consume_token(PLSQLParser.java:10721)
at net.sourceforge.pldoc.parser.PLSQLParser.variableOrConstantDeclaration(PLSQLParser.java:5331)
at net.sourceforge.pldoc.parser.PLSQLParser.declarativeSection(PLSQLParser.java:1510)
at net.sourceforge.pldoc.parser.PLSQLParser.packageSpec(PLSQLParser.java:723)
at net.sourceforge.pldoc.parser.PLSQLParser.input(PLSQLParser.java:399)
at net.sourceforge.pldoc.PLDoc.processPackage(PLDoc.java:391)
at net.sourceforge.pldoc.PLDoc.run(PLDoc.java:172)
at net.sourceforge.pldoc.PLDoc.main(PLDoc.java:109)
Package kaboom2.pks skipped.

An illustrative sample file is attached.

Discussion

  • Rick Wiggins

    Rick Wiggins - 2006-11-30

    Package containing new 10g Q function.

     
  • Stuart Turton

    Stuart Turton - 2011-09-09

    Test Case pldoc-1606392.sql

    Fixed

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.