Execute Procedure Dynamic
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Execute Procedure Dynamic

  1. #1
    Join Date
    Mar 2001
    Location
    Reading, U.K
    Posts
    598

    Execute Procedure Dynamic

    Hi
    "need to execute a procedure dynamically."

    I get the Procedure name as an input parameter...

    this procedure has to be executed...

    create or replace procedure jegan(proc_name in varchar2) as
    a number;
    begin

    ......need to execute <> procedure
    dbms_output.put_line('Test');
    a := 1000;
    dbms_output.put_line('Test >>> a = ' || a);
    end;

    I have a table which maintains a list of procedure name that has to be executed. Entries are those of procedures which did not run.

    cheers!
    Cheers!
    OraKid.

  2. #2
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    Hi,
    an example follows.
    Code:
    scott@oracle> create or replace procedure jegan0 as
      2  begin
      3     dbms_output.put_line('Test0');
      4  end;
      5  /
    
    Procedure created.
    
    scott@oracle> create or replace procedure jegan(proc_name in varchar2) as
      2  a number;
      3  begin
      4  --......need to execute <> procedure
      5  execute immediate 'begin '||proc_name||'; end;';
      6  dbms_output.put_line('Test');
      7  a := 1000;
      8  dbms_output.put_line('Test >>> a = ' || a);
      9  end;
     10  /
    
    Procedure created.
    
    scott@oracle> exec jegan('jegan0');
    Test0
    Test
    Test >>> a = 1000
    
    PL/SQL procedure successfully completed.
    Ales
    The whole difference between a little boy and an adult man is the price of toys

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width