Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Dumb Question, how to insert ' into varchar2 field
Norm,
Yes you are correct. This behavior reminds me as being similar to how perl does the quoting.
But to run some tests:
ORA10.1> select q'{abcd ' efgh}' from dual;
Q'{ABCD'EFGH}'
ORA10.1> select q'[abcd ' efgh]' from dual;
Q'[ABCD'EFGH]'
ORA10.1> select q'=abcd ' efgh=' from dual;
Q'=ABCD'EFGH='
ORA10.1> select q''abcd ' efgh'' from dual;
Q''ABCD'EFGH''
ORA10.1> select Q'{abcd ' efgh}' from dual;
Q'{ABCD'EFGH}'
ORA10.1> select q'<abcd ' efgh>' from dual;
Q'<ABCD'EFGH>'
ORA10.1> select q'<abcd ' efgh?' from dual;
ERROR:
ORA-01756: quoted string not properly terminated
ORA10.1> select q'(abcd ' efgh)' from dual;
Q'(ABCD'EFGH)'
Anurag Received on Tue Feb 15 2005 - 12:26:43 CST