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
Post a Comment