Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: QUESTION - "Rulebook" for character delimiting...??
chris.hulan_at_gmail.com wrote:
> double-quotes inside single-quotes should work:
>
> select 'a "test" b' from dual;
>
> 'A"TEST"B'
> ----------
> a "test" b
Unless double quotes are used to delimit the entire string, such as in php, asp, etc. Then such constructs would prematurely terminate the text:
sqlStr="select 'a "test" 'b' from dual";
would not work. There is an alternative:
sqlStr="select 'a '||chr(34)||'test'||chr(34)||' b' from dual";
Yes, it's a long way around the pool, but it will work when a programming language requires strings to be enclosed in double quotes:
SQL> select 'a '||chr(34)||'test'||chr(34)||' b' from dual;
'A'||CHR(3
My two cents.
David Fitzjarrell Received on Wed Jun 07 2006 - 14:27:46 CDT