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

Home -> Community -> Usenet -> comp.databases.oracle -> escaping those darn ' in a package/procedure

escaping those darn ' in a package/procedure

From: robert <gnuoytr_at_rcn.com>
Date: 8 Jun 2004 12:35:07 -0700
Message-ID: <da3c2186.0406081135.739824dc@posting.google.com>


this block is from a (successful) implementation of FGAC. that is a good thing.

      
      IF l_context <> 'FOOBAR'  THEN
         retval := 'user_id = '' ' || USER || '''';
      ELSE
         retval := '1 = 1';
      END IF;

now, they want this:

      IF l_context <> 'FOOBAR'  THEN
         retval := 'user_id like '' ' || USER || % '''';
      ELSE
         retval := '1 = 1';
      END IF;

but i can't figure out (and the error msgs don't help much) how to balance the % and the 's to get it to parse. help?

i submit it from SQL*Plus, 8.1.7.

thanks,
robert Received on Tue Jun 08 2004 - 14:35:07 CDT

Original text of this message

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