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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Literal SQL and sys.dual

RE: Literal SQL and sys.dual

From: Jamadagni, Rajendra <Rajendra.Jamadagni_at_espn.com>
Date: Wed, 03 Apr 2002 05:18:21 -0800
Message-ID: <F001.00439BFF.20020403051821@fatcity.com>


The error is in your code, you are explicitly telling oracle that the bind variables are varchar2, so why would Oracle evaluate it?

Try this ...

DECLARE

nnum1         NUMBER;
nnum2         NUMBER;
nresult       NUMBER;

BEGIN
    BEGIN
    nnum1 := 0;
    EXECUTE IMMEDIATE
        USING nnum1, OUT nresult;
        dbms_output.put_line(TO_CHAR(nresult));
     END; 

    BEGIN
    nnum1 := 1;
    nnum2 := 1;
    EXECUTE IMMEDIATE
        'begin SELECT :1 + :2 INTO :0 FROM dual; END;'
        USING nnum1, nnum2, OUT nresult;
        dbms_output.put_line(TO_CHAR(nresult));
     END; 

END;
/

Raj



Rajendra Jamadagni MIS, ESPN Inc.
Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.

QOTD: Any clod can have facts, but having an opinion is an art!


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jamadagni, Rajendra
  INET: Rajendra.Jamadagni_at_espn.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Received on Wed Apr 03 2002 - 07:18:21 CST

Original text of this message

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