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 -> How to include a '%' in a PL/SQL script?

How to include a '%' in a PL/SQL script?

From: Ramon F Herrera <ramon_at_conexus.net>
Date: 30 Mar 2004 22:45:18 -0800
Message-ID: <c9bc36ff.0403302245.6820f3e9@posting.google.com>


What's the correct syntax to include a percentage sign in a PL/SQL script like the one below?

In sqlplus the line would be something like this:

SQL> SELECT parent_id FROM family WHERE company_id like '%1234';

Thanks,

-Ramon F. Herrera


CREATE OR REPLACE PROCEDURE fullid IS

BEGIN   DECLARE
    CURSOR traverse IS SELECT claim_id, company_id FROM hearing;     identify VARCHAR2(512);
    parentID VARCHAR2(512);

  BEGIN     FOR tab IN traverse LOOP

      identify :=
        'SELECT parent_id FROM family WHERE company_id like ''%:here''';

      EXECUTE IMMEDIATE identify INTO parentID USING tab.company_id;

     DBMS_OUTPUT.PUT_LINE('Child ' || tab.company_id || ' Parent ' || parentID);

    END LOOP;   END; END fullid; Received on Wed Mar 31 2004 - 00:45:18 CST

Original text of this message

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