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!

execute immediately

800528Apr 1 2011 — edited Apr 1 2011
hi,

declare
smt varchar2(2000);
ta varchar2(20) := &ta1;
empno1 number := &empno2;
ename1 varchar2(25);
job varchar2(25);
begin
smt := 'select emame,job from '||ta||
'where '||ta||'no = :1';
execute immediate smt
into ename1,job
using empno1;
dbms_output.put_line(ename1||' '||job);
end;
/


Enter value for ta1: emp
Enter value for empno2: 7369


ERROR at line 3:
ORA-06550: line 3, column 20:
PLS-00357: Table,View Or Sequence reference 'EMP' not allowed in this context
ORA-06550: line 3, column 4:
PL/SQL: Item ignored
ORA-06550: line 8, column 34:
PLS-00320: the declaration of the type of this expression is incomplete or malform
ORA-06550: line 8, column 1:
PL/SQL: Statement ignored



please help me in regard..
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2011
Added on Apr 1 2011
12 comments
375 views