ORA-01756 with 10g's "q" String Literal Syntax
273435May 7 2007 — edited May 7 2007OK, this one's got me confused.
In 10g, you're supposed to be able to get around the awkward doubling up of single quotes within string literals by defining your own delimiter.
This works when my string literal has two single quotes in it, but not when I have just one! Can someone please explain this to me?
scott@XE_10g> SELECT banner FROM v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
scott@XE_10g> VARIABLE x VARCHAR2(80);
scott@XE_10g> EXEC :x := q'!I've got an idea; let's use two single quotes.!';
PL/SQL procedure successfully completed.
scott@XE_10g> EXEC :x := q'!Now, we'll use just one.!';
ERROR:
ORA-01756: quoted string not properly terminated
scott@XE_10g>
Is this a bug?