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!

Native Dynamic SQL, PL/SQL

IniyavanFeb 19 2010 — edited Feb 19 2010
Hi all,

When I try the follwing block to perform a PL/SQL block, it gives the error ORA-06536: IN bind variable bound to an OUT position.

DECLARE
V_SQL VARCHAR2(4000);
V_E_NAME VARCHAR2(100);
BEGIN
V_SQL := 'BEGIN
SELECT EMP_NAME
INTO :1
FROM EMP
WHERE EMP_CODE = :2;
END;';
EXECUTE IMMEDIATE V_SQL USING V_E_NAME, 101;
DBMS_OUTPUT.PUT_LINE('EMP NAME - '||V_E_NAME);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('ERR - '||SQLERRM);
END;

Please help me to overcome this.

Thanks in advance.
This post has been answered by 730428 on Feb 19 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 19 2010
Added on Feb 19 2010
8 comments
672 views