Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Call function using Execute immediate

user13739095Jan 5 2018 — edited Jan 8 2018

Hi,

i have a function which is returning boolean and i am trying to run that in execute immediate statement and it is throwing error "invalid data type".

I am using Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit

Below is the code i am trying to do.

CREATE OR REPLACE FUNCTION CallFunc(p1 IN VARCHAR2)

RETURN boolean AS

BEGIN

  DBMS_OUTPUT.PUT_LINE('CallFunc called with ' || p1);

  RETURN true;

END CallFunc;

DECLARE

    myResult boolean;

  BEGIN

  EXECUTE IMMEDIATE

       'CALL CallFunc(''Hello from PL/SQL'') INTO :myResult'

     USING OUT myResult;

   END;

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 3 2018
Added on Jan 5 2018
24 comments
13,630 views