Call a procedure in a package

Hello

I need help to call a procedure within a package.

I have an ABC package in which I have 3 X Y and Z I procedures I need to call the procedure procedure Y X that belongs to the same package.

Thanks in advance

I have an ABC package in which I have 3 X Y and Z I procedures I need to call the procedure procedure Y X that belongs to the same package.

This forum, as the title suggests, is for developer Sql questions only and NOT for questions of SQL or PL/SQL.

If this is not related to Sql Developer then please mark ANSWERED and repost it in SQL and PL/SQL forum

https://community.Oracle.com/community/Developer/English/oracle_database/sql_and_pl_sql

During the validation you must provide your name and full version.

You must also explain why even need help because procedure X can call just procedure Y directly since they are in the same package.

For an Oracle DB, see documentation and examples of ' packages of PL/SQL to help "in the doc of the PL/SQL language

http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/packages.htm#CIHIJECJ

Tags: Database

Similar Questions

  • How to call the procedure in the package

    Hi all!

    The situation!

    I received a package with body priview 'Change_utility '.
    In this package, I had procedure, changing the data when triger calls a package, it is all ok and working

    Now, I need to call a procedure in a single package gave him.

    I need to run the sta_death procedure in the 'Change_utility' package with no code 112233-4455

    How do I run that?


    Thanks for the help!

    ID

    Maybe (guessing)

    begin
    
      change_utility.sta_death('112233-4455');
    
    end;
    

    Concerning

    Etbin

  • call a procedure of package DB type complicated if the type defined in the package itself

    Hello world

    I use jdev 11.1.1.7.0

    I defined a package of data with a procedure and internal two types as follows:

    Create Or Replace Package Db_Package As 
    
    Type rec Is Record(Rec_Type Varchar2(10), Rec_Desc varchar2(10) );                        
    Type recordList Is Table Of rec;
    
    Procedure Test_Procedure(p_out out recordList);
    END db_package;
    
    
    

    evil

    I want to call this procedure in the module of the application. I know how to call a procedure or function db AM,

    but in this case that I've defined two types in the package itself and I use one of these types as to the procedure output parameter, I had a problem.

    below is the example of code to call the db procedure, but it does not work because the plsqlBlock.registerOutParameter () setting will not

            CallableStatement plsqlBlock = null;
            String statement = "Begin DB_PACKAGE.Test_Procedure(:1); END;";
            try {
                plsqlBlock = getDBTransaction().createCallableStatement(statement, 0);
                plsqlBlock.registerOutParameter(1, OracleTypes.ARRAY);// it doesn't work
                plsqlBlock.executeUpdate();
                Object object = plsqlBlock.getObject(1);      
    
    
            } catch (Exception e) {
                e.printStackTrace();
            }
    
    
    
    

    I know that if I set the types of packets (rec, recordList) as types of oracle (instead of setting in the packaging itself) so I can call the procedure with success, in this case I should use below:

    plsqlBlock.registerOutParameter(1, OracleTypes.ARRAY,"Recordlist");
    

    but I wonder how you can call a procedure from the package if the types defined in the package itself.

    Kind regards

    Habib

    JDBC supports the types of oracle level package only from 12 c database and jdbc driver ojdbc7 (which requires java 7).

    Dario

  • Procedure call to the procedure in one package

    Hello

    I need help to call a procedure within a package.

    I have an ABC package in which I have 3 X Y and Z I procedures I need to call the procedure procedure Y X that belongs to the same package.

    Thanks in advance

    I need to call the procedure procedure Y X that belongs to the same package.

    Just make sure that this procedure that is has been defined before the X procedure in the package body. However, there no need this if the two procedures are also defined in the package specification.

  • Problems trying to call the procedure in a PL/SQL package.

    We use BI Publisher 10.1.3.4.1.

    I am trying to call a procedure in a package by using a data model, as I read it is the best way to do it.

    Here's the package. Very straightforward, just insertion of a row in a table to try this out. I tested the procedure and that it works correctly.

    -----
    CREATE OR REPLACE PACKAGE JM_PKG_OBIEE_ETL_TEST

    -Declarations of function and public procedure
    PROCEDURE INSERT_TEST_ROW;


    END JM_PKG_OBIEE_ETL_TEST;
    /
    CREATE OR REPLACE PACKAGE BODY JM_PKG_OBIEE_ETL_TEST

    -Function and procedure implementations
    PROCEDURE INSERT_TEST_ROW IS

    NUMBER OF NEXT_ID;

    BEGIN

    SELECT COUNT ()) + 1 IN EDDWMAN NEXT_ID. JM_OBIEE_ETL_TEST;

    INSERT INTO EDDWMAN. JM_OBIEE_ETL_TEST
    (ID, VALUE, DATE_STAMP)
    VALUES
    (NEXT_ID, 'Test' |) NEXT_ID, SYSDATE);

    COMMIT;

    EXCEPTION
    WHILE OTHERS THEN
    RAISE_APPLICATION_ERROR (-20001,
    "An error occurred"; SQLCODE.
    "- ERROR -" | SQLERRM);

    END INSERT_TEST_ROW;

    END JM_PKG_OBIEE_ETL_TEST;
    -----

    Here is the data model that I use. When I run it, I get a syntax error. If I change the "defaultPackage' to"defaultPackage", thus eliminating the appeal of the package, the data model works very well and I get an xml output of what is in the table.

    -----
    < name of dataTemplate = 'test' than one dataSourceRef = 'Oracle BI EE"defaultpackage ="JM_PKG_OBIEE_ETL_TEST">
    < name dataTrigger = source "beforeReport" = "JM_PKG_OBIEE_ETL_TEST. INSERT_TEST_ROW "/ >"
    < dataQuery >
    < SQLStatement instance name = "test_results" >
    <! [CDATA [SELECT ID, saw_2, DATE_STAMP SDS saw_3 VALUE saw_1. JM_OBIEE_ETL_TEST]] >
    < / sqlStatement >
    < / dataQuery >
    < dataStructure >
    < name of group = "G_TEST_RESULTS" source = "test_results" >
    < element name = "test_ID" value = "saw_1" / >
    < element name = "test_value" value = "saw_2" / >
    < element name = "test_DATE_STAMP" value = "saw_3" / >
    < / Group >
    < / dataStructure >
    < / dataTemplate >
    -----

    Any suggestions? Y at - it configuration settings that can be disabling package calls? This package is located in the same schema as the table is in and I can see the data in this table to OBIEE & BI Publisher.

    Thoughts?

    Published by: Jared Moe on June 30, 2011 12:42

    Published by: Jared Moe on June 30, 2011 12:45

    Yes you must change the procedure in function first. In addition, even if you do not use parameters here if passing them in you must also declare their in the package specification in the exact order you have set them up in your data source. Change your name to BeforeReportTrigger function (and note the case-sensitive characters). Here is the code that I modified.












    I hope this helps.

    Steve

    Published by: Steve P on July 1, 2011 14:12

    Published by: Steve P on July 1, 2011 14:14

    Published by: Steve P on July 1, 2011 14:14

  • fusion of procedures in the package and calling with common proc?

    Hello

    I wrote similar procedures... and I'm calling each procedure separately and transmitting his values...

    something like that
     
    
       begin 
       mov_tbl1(1234); 
       end 
    
    then again similarly for 
    
       begin 
       mov_tbl2(1234); 
       end;    
       
    My question is how to merge these two procedures in one package and call them with a common procedure and pass the value (var_id) once for procedures?
     
    create or replace procedure mov_tbl1 ( var_id number)  is 
             
             cursor tbl1_cur as 
             select  src.col1, 
                     src.col2, 
              from abc_tbl1 tbl1, 
                   abc_tbl2 tbl2 
              where tbl1.no = var_id  -- this is variable i m trying to make it as a paramter in common proc 
                    tbl1.id = tbl.id 
                   -- the record variable declaration is implicit in FOR LOOP 
          begin 
                for  tbl1_cur_rec  in tbl1_cur 
                loop 
                  begin 
                    insert into tgt.tabl1(col1,col2) 
                                values (tbl1_cur_rec.col1, 
                                    tbl1_cur_reccol2, 
                            ); 
                            exception 
                         when others then 
                           null; 
                  end; 
                end loop; 
          end; 
    
    
    create or replace procedure mov_tbl2(var_id number) is 
        
           cursor cur_tbl2 
             select col3,col4, col5 
               ...... 
             from abc_tbl1 tbl1, 
                   abc_tbl2 tbl2, 
                   abc_tbl3 tbl3 
            where   tbl1.no = var_id and   --this is variable i m trying to make it as a paramter in common proc 
                    tbl1.id = tbl.id and 
                    tbl2.dept = tbl3.dept 
              begin 
                  for ... 
                    loop ... 
                      insert into ... 
                         values.... 
             .... 
              end; 
      
    I m bit confused, if you want to use the parameter or parameter... .i am beginner in writing packages... :))
    Ideas or examples is greatly appreciated! Thank you very much!!

    Check if all parameters have been assigned to certain values.

    And call the procedure that is packaged with the following syntax.

    Begin
    .(parameter_value);
    end;
    
    i.e.
    Begin
    TEST_PACK.COMMON_PROC(1234);
    End;
    

    Can you post the code here so that we can have a look at what goes wrong.

    Here is a test package I ran

    PRAZY@11gR1> create or replace package test_pack as
      2  procedure common_proc(var_id number);
      3  end;
      4  /
    
    Package created.
    
    Elapsed: 00:00:00.00
    PRAZY@11gR1> create or replace package body test_pack as
      2  procedure private_proc1(var_id number) as
      3  begin
      4  dbms_output.put_line('FROM PROC1 :'||var_id);
      5  end;
      6
      7  procedure private_proc2(var_id number) as
      8  begin
      9  dbms_output.put_line('FROM PROC2 :'||var_id);
     10  end;
     11
     12  procedure common_proc(var_id number) as
     13  begin
     14  private_proc1(var_id);
     15  private_proc2(var_id);
     16  end;
     17
     18  end;
     19  /
    
    Package body created.
    
    Elapsed: 00:00:00.04
    PRAZY@11gR1> begin
      2  test_pack.common_proc(100);
      3  end;
      4  /
    FROM PROC1 :100
    FROM PROC2 :100
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.01
    

    Kind regards
    Prazy

  • ORA-06508, procedure cannot call the procedure of package

    I have a large stored procedure that calls a package (procedure) that manages a number of procedures to determine whether the process can continue or not.  (It checks authorization of the student to enroll in a class).  We have a web process calling the stored procedure, and that works fine.  What does not work, is a call to the package.  Oracle returned ORA-06508: PL? SQL: could not find program unit called.

    I have included instructions for debugging, so I know that it is the specific call to a procedure in the package fails with ORA-06508.  Thinking it's perhaps something in the package, I inserted a debug statement as the first line in the procedure called in the package.    (Debugging instructions call a procedure inserts of rows in a table of debugging with independent validation).

    When I log in the user account with sqlplus and run a test, everything works fine.  But when the web process is running under the same user, the process fails to call the procedure of package and fails with ORA-06508.

    It seems as if the web process runs with the rights of the appellant, or a role is not granted.

    Can someone help me understand what the problem is?

    offered hv, I appreciate your comments.

    We solved the problem: remove the package that couldn't be cited, then re-create.   That's all!

    Apparently, something in the database was tangled upward.   The server recently had problems with disk space, then it might have been related to that.  But we'll never know for sure.

    The stored procedure and packaging (procedures) which he called were owned by the same schema, and there is no mechanism that I can find to prevent one of the other appellant.  But that was the case - Oracle threw the ORA-06508 exception when the stored procedure called the package procedure.

    I replaced the stored procedure and package several times fine-tuning debugging code, but this has not fixed the problem.

    Finally let it drop and then re-create the package, it's which solved the problem.

    Regarding requests to view the code, there is no way that I could reproduce the problem, since the error that occurred was against the permissions and rules which packages run and the procedures of the Oracle.  Thanks for all the tips and suggestions.

  • Calling a procedure of package with only Date setting

    Hi all

    Please, help me to call a procedure of package with Date from the sql command prompt parameter.


    Arif

    Check the procedure below.

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure procdate (p_date_in date)
      2  is
      3  p_date_out date;
      4  begin
      5  p_date_out := add_months(p_date_in,6);
      6  dbms_output.put_line(p_date_out);
      7* end;
    SQL> /
    
    Procedure created.
    
    SQL> exec procdate('01-JAN-2010');
    01-JUL-10
    
    PL/SQL procedure successfully completed.
    
    SQL> exec procdate(to_date('01/01/2010','DD-MM-YYYY'));
    01-JUL-10
    
    PL/SQL procedure successfully completed.
    
    SQL> exec procdate('31-DEC-2010');
    30-JUN-11
    
    PL/SQL procedure successfully completed.
    
  • ODP 12 c version 3 with EF 6.1.1 I can't add Stored Procedure of a package to my model

    I use the ODP 12 c Release 3 (12.1.0.2.1), with Entity Framework 6.1.1 with the first database in MS Visual Studio 2013 update 4

    I have a MVC 5 (.Net Framework 4.5.2) project that connects to Oracle 11 G R2 Database server, an existing database (Tables, views and a pack of Stored procedures)

    I can add tables and use them successfully in my model
    I can add a simple stored procedure

    Here's the problem:
    I have my .edmx file right click and click on "update model from database...". «, on the 'Add' tab, I chose «Stored procedures and functions»
    I can see the list of procedures stored in the package (format packageName.usp) and check the box for the stored procedure of my package, then click 'Finish' to start the update process.

    No stored procedures have been added to my Model.Store


    The only possible exit I get the 'entity data model' is:
    Generated template file: Model1.edmx.
    Loading metadata from the database took 00:00:00.5803351.
    The model generation took 00:00:00.3761861.

    How to add a stored procedure from a package with the Entity Framework 6.1.1?

    I found the answer.

    When in the edmx model and you right click "Update Model database.

    Uncheck "Import selected stored procedures and functions in the entity model", select the package and update procedures. (It works)

    Then in "Model Explorer" under "Model. Store\ stored procedures/functions" you will see your procedures in the package (finally). Then their card in "Function Imports".

    I don't understand why unchecking import stored procedures works, but it does.

    I also found easier to simply call the procedure directly and not using Entity Framework, as all my procedures are: insertion, update and deletions and not all parameters mapped on the model for the view.

  • How to call the procedure Oracle in ODI

    Hello

    I use ODI 10 g.

    Before you run the interface in a package, I wanted to place my procedure.

    I created the procedure in d/b (target)

    CREATE OR REPLACE PROCEDURE TEST_MY_NEW_PROCE
    AS
    BEGIN
    REMOVE FROM EMPLOYEE_TABLE
    WHERE EMPLOPYEE_ID LIKE '% P ';
    COMMIT;
    END;
    /

    The procedure works well in the target database.

    Now, before the execution of my interface, I want to run this procedure in my package. So can some please help me how to call this oracle (creation in target schema) ODI procedure and run it.

    Thank you.

    Hi, GRK,.

    You can create an ODI procedure, add one step, choose Oracle as technology and your target schema.
    Then just call it through a pl/sql block:

    BEGIN
     TEST_MY_NEW_PROCE;
    END;
    

    In your package, then drag this ODI procedure.

    Kind regards
    JeromeFr

  • CALL a procedure

    Hi all
    How to call the procedure using CALL with the data type of parameter directory?
    for example, there are a DBMS_FGA procedure. ADD_POLICY with these settings:
    PROCEDURE ADD_POLICY
     Argument Name                  Type                    In/Out Default?
     ------------------------------ ----------------------- ------ --------
     OBJECT_SCHEMA                  VARCHAR2                IN     DEFAULT
     OBJECT_NAME                    VARCHAR2                IN
     POLICY_NAME                    VARCHAR2                IN
     AUDIT_COLUMN_OPTS              BINARY_INTEGER          IN     DEFAULT
    and I call this statement:
    It works
    CALL DBMS_FGA.ADD_POLICY(POLICY_NAME => 'POL1',OBJECT_SCHEMA => 'USER1',OBJECT_NAME => 'TABLE1');
    But this one does not work for me: (.) I have only to add the AUDIT_COLUMN_OPTS parameter with the type of directory data.
    CALL DBMS_FGA.ADD_POLICY(POLICY_NAME => 'POL1',OBJECT_SCHEMA => 'USER1',OBJECT_NAME => 'TABLE1',AUDIT_COLUMN_OPTS => DBMS_FGA.ALL_COLUMNS);
    
    ERROR at line 1:
    ORA-06553: PLS-221: 'ALL_COLUMNS' is not a procedure or is undefined
    I know that I can use BEGIN... END or EXECUTE in sqlplus, however I have to test it by using the CALL. If possible, it would be much easier for me to appeal through my code in PHP.

    Oracle version: 11 GR 2

    Any help would be appreciated.

    Thank you
    Yusata.

    Published by: Yusata on June 18, 2012 04:57

    CALL is SQL statement. Therefore, you cannot reference package variables directly. And DBMS_FGA. ALL_COLUMNS is a global package variable. One way to do it is of DBMS_FGA. ALL_COLUMNS value:

    SQL> set serveroutput on
    SQL> exec dbms_output.put_line(DBMS_FGA.ALL_COLUMNS);
    1
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    Now, you can:

    DIAL THE DBMS_FGA. ADD_POLICY (POLICY_NAME-online 'POL1', OBJECT_SCHEMA => "USER1", OBJECT_NAME-online 'TABLE1', AUDIT_COLUMN_OPTS-online 1);

    Or, if you're worried value could change in future versions, you can create a getter function:

    CREATE OR REPLACE
      FUNCTION GET_DBMS_FGA_ALL_COLUMNS
        RETURN NUMBER
        IS
        BEGIN
            RETURN DBMS_FGA.ALL_COLUMNS;
    END;
    /
    

    However, you grant run on DBMS_FGA to the owner of the function directly, without going through the role. Now, you can:

    DIAL THE DBMS_FGA. ADD_POLICY (POLICY_NAME-online 'POL1', OBJECT_SCHEMA => "USER1", OBJECT_NAME 'TABLE1', AUDIT_COLUMN_OPTS-online GET_DBMS_FGA_ALL_COLUMNS =>)

    );

    SY.

  • Execution of a procedure in a package

    Hello

    How to run a procedure in a package? Here is the package

    CREATE OR REPLACE PACKAGE BODY POPULATE_GLTD_TABLES
    IS
    -LOCAL VARIABLES
    VARCHAR2 (10) val1;
    -Create work items:
    v_job1_str VARCHAR2 (4000);
    v_job1 XXMCK. XXMCK_JOB_OT;

    PROCEDURE populate_gltd_tabs1
    IS
    BEGIN
    dbms_output.put_line ('Get_status = > v_job1: ');
    val1: = F_CHECK_GLTD_RECORD_EXISTS ('MCK_GLTD_1');
    IF Val1! s ="THEN
    --
    -Understand the value of details message - TRUE if yes and FALSE if no
    --
    xxmck.mck_write_log_msg.set_msg_tail (true);
    --
    xxmck.mck_write_log_msg.purge('GLTD-TASK1');
    --
    -together framework will define the source so that inserts data into the table of output cont
    --
    xxmck.mck_write_log_msg.set_Context(v_parent_program,v_prog_desc,'GLTD-TASK1');
    --
    xxmck.mck_write_log_msg.log (v_parent_program, "enter in LOAD_GLTD_TABLES.populate_gltd_tabs1', 'prg', 'GLTD-TASK1', 1");
    --
    xxmck.mck_write_log_msg.log_tail (v_parent_program, "enter in LOAD_GLTD_TABLES.populate_gltd_tabs1', 'prg', 'GLTD-TASK1'");
    --

    v_job1_str: = ' XXCOGNOS. LOAD_GLTD_TABLES.populate_gltd_tabs1;';

    v_job1: = NEW XXMCK. XXMCK_JOB_OT ('GLTD-TASK1', v_job1_str, ' test of substantive work: LOAD_GLTD_TABLES.populate_gltd_tabs1 ', INTERVAL ' 60' SECOND ');
    v_job1. PRINT(); -Display of the basic information about the work
    v_job1. SUBMIT(); -Propose in the background
    v_job1. WAIT();
    v_job1. PRINT();
    v_job1.get_Status (v_code, v_message);
    dbms_output.put_line ('Get_status = > v_job1: ' | v_code |) ':' || v_message);

    -SELECT DECODE (cont_exit, 'cont', 'cont', 'err', 'err', 'cont') IN v_result of MCK_LOG_CONT_EXIT_CHK WHERE source = 'GLTD-TASK1;

    -IF v_result = "err" THEN
    -raise_application_error ("-20000, ' program Aborted");
    -END IF;
    END IF;
    EXCEPTION
    WHEN OTHER THEN NULL;
    END populate_gltd_tabs1;

    PROCEDURE mainproc
    IS
    BEGIN
    populate_gltd_tabs1; -CALL to FILL in mck_gltd_1 TABLE
    --
    -Mailing
    --
    xxmck.mck_write_log_msg.send_mail (p_source_prg = > v_parent_program)
    , p_source = > 'GLTD-TASK1.
    , p_msg_type = > 'prg '.
    , p_from = > '[email protected] '.
    , p_to = > '[email protected] '.
    , p_server = > 'mailhub.mckinsey.com '.
    );
    EXCEPTION
    WHEN OTHER THEN NULL;
    END mainproc;

    END POPULATE_GLTD_TABLES;
    /





    And here's my anonymous block to run above package

    BEGIN
    POPULATE_MCK_GLTDFILE.mainproc;
    EXCEPTION - begin exception handler
    WHEN OTHER THEN NULL;
    END;


    I am trying to run above the code into a toad. But I get the error message like: identifier 'POPULATE_MCK_GLTDFILE.mainproc' must be declared.
    There is no parameter to pass.
    The package is compiled successfully.
    I think this must be the easiest question anyone I can ask, but I can't understand the solution.

    Help, please
    Aditya

    Try this (you are using the wromg package name)

    BEGIN
    POPULATE_GLTD_TABLES.mainproc;
    EXCEPTION
    WHEN OTHER THEN NULL;
    END;

    Published by: Saran on January 13, 2012 01:38

    Published by: Saran on January 13, 2012 01:38

    Published by: Saran on January 13, 2012 01:40

  • Execution of a stored procedure in a Package in an Oracle schema?

    I found solutions to guidance how to run stored procedures to an Oracle DB, for example http://blogs.oracle.com/adf/entry/call_db_stored_procedure_using.

    However, I have a database where procedures are in the packages and I want to know if there a way, that they can be run using enterprise Java Bean.


    See you soon.

    Published by: 893478 on October 27, 2011 05:46

    Calling stored procedures has nothing to do with the Enterprise Javabeans directly. What you want to do, is to use JDBC to create a callable statement and follow these steps:

         Connection conn = ...; // fetch from a datasource for example
         CallableStatement ps = conn.prepareCall("call PACKAGENAME.PROCEDURENAME(?,?,?)");
    
          ps.setString(1, "InputParam1");
          ps.setString(2, "InputParam2");
          ps.registerOutParameter(3, java.sql.Types.VARCHAR);
    
          ps.execute();
          String res = ps.getString(3);
    

    This example accepts two input parameters and an output parameter. Adapt to your own needs. And don't forget to add exceptions and a finally clause in which you close the statement and connection.

  • Call a procedure only once for the last place of the trigger FOR EACH ROW

    Hello world

    I wonder if someone could help me in the execution of the trigger. My use case what follows:

    -a trigger after each INSERT or UPDATE operation;
    -use FOR EACH ROW algorithm for relaxation;
    -collect certain values inserted/updated fields as: new.uuid and store in a set defined on the layer of the package;
    -only for the last inserted/updated line call a procedure from the global collection with the values collected as a parameter;

    Is it possible to be implemented for the type of the LINE FOR EACH of the trigger? Fact one: new identifier or trigger itself have special attributes such as COUNTY, SIZE to set a size of data inserted or changed to conditional logic? Is there another solution to possible workaround for thoughtful use cases.

    Thank you

    Andrey

    Hi, Andrey,

    I suggest you use 2 triggers:
    (1) A FOR EACH ROW trigger, as you described, to collect relevant data and store it in a temporary table overall or variable poackage. Whenever the trigger is activated, it will overwrite all the data from the previous row.
    (2) AFTER ( NOT FOR EACH ROW) trigger that calls the procedure by using the saved data.

  • Calling stored procedures

    I have a package with the procedures below.


    I have 12 instructions insert (named procedures P1 to P12) which insert in the TABLE A and TABLE B, each insert another condition where.
    I created P13 procedure in each package so that every month instead of every procedure P1 - P12 I call all the procedures in P13 and P14.
    Are there disadvantages to do? Any suggestions?

    package A

    P1
    (
    INSERT statement... INSERT into TABLE A
    )

    P2
    (
    INSERT statement... INSERT into TABLE A
    )

    P3
    (
    INSERT statement... INSERT into TABLE A
    )

    P4
    (
    INSERT statement... INSERT into TABLE A
    )

    P5
    (
    INSERT statement... INSERT into TABLE A
    )

    P6
    (
    INSERT statement... INSERT into TABLE A
    )

    P7
    (
    INSERT statement... INSERT into TABLE A
    )

    P8
    (
    INSERT statement... INSERT into TABLE A
    )

    P10
    (
    INSERT statement... INSERT into TABLE A
    )

    P11
    (
    INSERT statement... INSERT into TABLE b.
    )


    P12
    (
    INSERT statement... INSERT into TABLE b.
    )

    P13
    (
    P1
    P2
    P3
    P4
    P5
    P6
    P7
    P8
    P9
    P10
    )


    P14
    (
    P11
    P12
    )

    Published by: user7988 on March 17, 2010 06:49

    Are queries for table a similar inserts? Is the using the same tables and joins, but the different criteria? If yes then that Frank pointed out you should look combining queries. You can combine the criteria and use instructions BOX when it is required.

    You may also be able to combine a and b inserts using a multi-tableau insert.

    Not sure what look like queries, but here is a small example of how you might be able to combine the table an inserts;

    create table source_data as (
       select 'CA' state, 'F' payment from dual union all
       select 'CT', 'T' from dual union all
       select 'XX', 'F' from dual);
    
    Table created
    insert into a
      select my_seq.nextval id,
             state,
             case
                when state = 'CA'
                     and payment = 'F' then
                 'REPORT1'
                when state = 'CT' then
                 'REPORT9'
                else
                 null
              end report_num
      from source_data
      where state in ('CA', 'CT');
    
    2 rows inserted
    select * from a;
    
            ID STATE REPORT_NUM
    ---------- ----- ----------
             1 CA    REPORT1
             2 CT    REPORT9
    

Maybe you are looking for