plsql - how to create and execute a procedure dynamically having schema name and table name as in parameter in oracle -


update statement using dyanmic sql passing schema name , table name in parameter stored procedure. working.

create or replace procedure p11(v_sal in number,v_schema varchar2,v_tab varchar2) v_sql varchar2(100); begin v_sql:='update '|| v_schema||'.'||v_tab||' set sal= '||v_sal||' empno= :1 '; dbms_output.put_line(v_sql); execute immediate v_sql using 7839; end; 

you should consider spaces @ least.

create or replace procedure p11(v_sal in number,v_schema varchar2,v_tab varchar2) begin execute immediate 'update '|| v_schema.v_tab||' set sal='||v_sal||' empno= :1' using 7839; end; 

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -