This discussion is archived
7 Replies Latest reply: Dec 28, 2012 12:22 PM by TexasApexDeveloper RSS

to call a package

680807 Newbie
Currently Being Moderated
Hello

I am trying to call a package.
Any one can help me out?

Thanks in advance,

Sam
  • 1. Re: to call a package
    TexasApexDeveloper Guru
    Currently Being Moderated
    You call PROCEDURES & FUNCTIONS inside the package, not the package itself.. Example:

    Package SamplePackage has a procedure called y and a function called z, to call procedure y you do this: Execute SamplePackage.y(Parameters, Go, Here);

    to call a function you would do this:

    (q is a declared local variable of type varchar2(100))

    q := SamplePackage.z(Parameters,Go,Here);


    Thank you,

    Tony Miller
    Webster, TX

    "I am a Ranger. We walk in the dark places no others will enter. We stand on the bridge and no one may pass. We live for the One, we die for the One."
  • 2. Re: to call a package
    680807 Newbie
    Currently Being Moderated
    Thank Tony Miller,

    I have to use page process or anything else.

    I create a region and apex made sql statements. I convert the SQL to PLSQL store procedure as a procedure in package.

    I want to call it. Please let me know step by step how to call it.

    Thanks,

    Sam
  • 3. Re: to call a package
    627206 Explorer
    Currently Being Moderated
    Hi Sam,

    You can convert the existing page P/SQL process like this

    Declare

    v1 varcahr2(10);
    v2 varcahr2(10);
    v3 varcahr2(10);

    Begin

    /*
    select into ...

    update table set ...

    commit ;
    */

    pkg_name.pkg_procedure( v1, v2,v3 OUT);

    :P1_PROCESS_RESULT := V3;

    end;

    so "pkg_name.pkg_procedure" is taking care all process

    Hope this clarifies.

    Regards,
    Benz
  • 4. Re: to call a package
    680807 Newbie
    Currently Being Moderated
    Thank Benz,

    When I create a form, I am able to choose from procedure.
    I want to select the option when I build a form.

    I would like to know how to call from APEX the procedure is in DB.

    Thanks again,

    Sam
  • 5. Re: to call a package
    484566 Newbie
    Currently Being Moderated
    Do you mean you want a drop down list of the procedures in the package to select from?
    I imagine that if that is the case and you had the right authorization, you could use a query from the DBA_* (or ALL or USER) views to get a list and build a dynamic call that way. Haven't tried it though.
  • 6. Re: to call a package
    981957 Newbie
    Currently Being Moderated
    Solved.

    Edited by: ARGGH99 on Dec 28, 2012 11:59 AM
  • 7. Re: to call a package
    TexasApexDeveloper Guru
    Currently Being Moderated
    Please refrain from posting to a LONG SINCE DEAD thread..

    Thank you,

    Tony Miller
    Ruckersville, VA

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points