Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2006
    Posts
    4

    Unanswered: executing procedures within a procedure

    for example, i have a table containing the list of procedures suitable for each person
    e.g.
    NICK / PROCEDURES
    NICK, SP_NICK
    JAS, SP_JAS

    If I'd be putting the procedure names into the same table, would there be a possiblity to call the procedures inside the nick/procedures table?

    e.g.
    SELECT CUSTOMERNAME, CUSTOMERPROC INTO DANNY
    FROM TABBLE
    WHERE BLAH BLAH BLAH

    Since the variable DANNY contains the procedure name, how can I invoke DANNY?

    an error always pops up reminding me that DANNY IS NOT A VARIABLE ETC ETC

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    execute immediate danny;

  3. #3
    Join Date
    May 2004
    Location
    Dominican Republic
    Posts
    721
    Quote Originally Posted by andrewst
    execute immediate danny;
    In 10gR2, that fails with ORA-00900. I had to enclose it within a pl/sql anonymous block (execute immediate 'begin ' || danny || '; end;') in order to make it work. Which leads me wondering, I always thought execute immediate will always execute the command parameter as BEGIN <the command> END;.

  4. #4
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    My mistake: yes, you need to wrap begin/end around a procedure call using execute immediate.

Posting Permissions

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