Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Escape character inside a select
<screwbai_at_my-deja.com> wrote:
> I am making an "sql from and sql" and need to "reproduce" the single
> quotation mark: '. Like this.
>
> I put SET ESCAPE ON or SET ESCAPE \ before I do the select. Then the
> select statement:
>
> select 'select \'Fred is \' || age from test2 ' from test1;
>
> The hard workaround to this is to use double quotes " instead of single
> '. And then do a searh and replease from the file that I spool this sql
> statement to. Trying to avoid that. Using Oracle release 7.3
>
> Any ideas?
select 'select ''Fred is '' || age from test2 ' from test1;
In other words, use two single quotes (not a double quote!) to represent
a quote inside a quoted string.
--
Kevin Michael Vail | I would rather have a mind opened by wonder
kevin_at_vailstar.com | than one closed by belief. -- Gerry Spence
Received on Sat Sep 04 1999 - 23:03:04 CDT
![]() |
![]() |