Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: get a single quote in PL/SQL stmt.

Re: get a single quote in PL/SQL stmt.

From: Richard Foote <richard.foote_at_bigpond.com>
Date: Sat, 16 Nov 2002 10:35:52 +1000
Message-ID: <kkfB9.77354$g9.218389@newsfeeds.bigpond.com>


Hi Alan,

To put a ' (single quote), use two '' together.

Example (basic but you get the drift):

SQL> declare
  2 v_string varchar2(100);
  3 begin
  4 v_string := 'This contains a '' and one over here as well '' ';   5 dbms_output.put_line(v_string);
  6 end;
  7 /
This contains a ' and one over here as well '

PL/SQL procedure successfully completed.

Cheers

Richard
"Alan" <desertflowerln_at_yahoo.com> wrote in message news:b1217045.0211151422.3c28736a_at_posting.google.com...
> I am trying to put a ' (single quote) in my PL/SQL statement, but
> couldn't figure out the exact syntax. Here is an example:
>
> DBMS_OUTPUT.put_line ('ALTER DATABASE BACKUP CONTROLFILE TO ' ??? ||
> backup_location || ???);
>
> in above stmt, backup_location is predefined, e.g.
> d:\oracle\oradata\bu_ctrl.ctl. But I need a single quote around this
> value. What should I put in in the ??? area?
> Any suggestios?
>
> Thanks
> Alan
Received on Fri Nov 15 2002 - 18:35:52 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US