3 Replies Latest reply: Nov 3, 2012 4:12 PM by Vite DBA RSS

    Executing Procedure From APEX

    Nirvana
      Hi Gurus,
      I have created a paramterized procedure: ( SQL Worskshop-> Object Browser -> Create-> Procedure)

      create or replace procedure "PRC_INV_DELETE"
      (param1 IN NUMBER,
      param2 IN NUMBER)
      is
      begin
      DELETE FROM INVOICE where INV_NUMBER IN ( param1, param2);
      end;


      Can any one please tell how to execute this simple procedure with parameters from APEX,

      Thanks in advance
        • 1. Re: Executing Procedure From APEX
          Bas de Klerk
          Hi,

          which APEX version are you using ?
          When would you like to execute the procedure ?

          A simple example would be to create a button and a dynamic action ( on-click of the button ) which fires PL/SQL.

          PL/SQL should look like this :

          begin
            PRC_INV_DELETE(:P_APEXITEM1, :P_APEXITEM2);
          end;
          P_APEXITEM1 and P_APEXITEM2 should be (page) items in your APEX application.

          Regards
          Bas
          • 2. Re: Executing Procedure From APEX
            mobra
            Can any one please tell how to execute this simple procedure with parameters from APEX,
            1. Create a page, let's say page 1.
            2. Create a region and two page items which are text input boxes, let's say P1_PARAM1 and P1_PARAM2
            3. Create a region button that submits the page
            4. Create a process (of type PL/SQL) with processing point "On Submit - After Computations and Validations"
            5. Enter your PL/SQL code in the process definition:
            begin
              prc_inv_delete (:p1_param1, :p1_param2);
            end;
            6. Set the process to execute conditionally on pressing the button.
            7. Run the page and see it work.. :-)

            - Morten

            http://ora-00001.blogspot.com
            • 3. Re: Executing Procedure From APEX
              Vite DBA
              Hi,

              the easiest way is to create a page or a region based on a procedure. Its all in the wizard.

              Regards
              Andre