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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: