Ask the Expert

Other ways to call variable name packages

I asked this question about calling variable name packages to you on May 27. You suggested to use 'IF-THEN-ELSE'. But the name of the packages can be changed or new states can be added. If I use 'IF-THEN-ELSE', in every change I must to modify the packages, and I must not to forget to change the packages. So this method is not so useful. Is there another way to call the variable name packages?

    Requires Free Membership to View

Another method that you can try is to use the EXECUTE IMMEDIATE statement in your PL/SQL block. In your case, v_pck_name contains the name of the procedure's package that you want to run. You can execute this dynamically as follows:

EXECUTE IMMEDIATE v_pck_name;
This would probably be a much cleaner solution than the one that I originally gave to you.

For More Information


This was first published in June 2003

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.