How to execute a pl/sql stored procedure as a concurrent program

Hi all


I created a PURGE_DEAL_REQUESTS package. It contains a QPR_DELETE_CANCELLED_REQUESTS procedure. I want to execute this stored procedure as simultaneous program in suite ebs...

Can someone tell me how to perform this procedure as a simultaneous program (in the suite of BSE)...?


Thank you
Swathi.

Switch to the responsibility at the request of the group to which you assigned the request of Conurrent.
Navigate to view > query > submit a new request to the toolbar.

Kind regards
Ousseni

Tags: Oracle Applications

Similar Questions

  • Error on the definition of the stored procedure in the simultaneous program

    Hello

    I created a stored procedure and wanted it attached to the concurrent program. The purpose of this stored procedure when you run it in simultaneous program, the system retrieves the data from the csv file downloaded from the server, then it will insert in the tables of SO / the Interface API. Below, the error occurred.


    * Starts * 18 April 2012 18:18:42
    Error ORACLE 6550 in FDPSTP

    Cause: FDPSTP failed due to the ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in the call to 'SPKO1 '.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    Steps I did to set the stored proc
    < < simultaneous executable program > >

    Executable: RDRAGON_SO_IMPORT
    Short name: RDRAGON_SO_IMPORT
    Application: Order management
    Method of execution: PL/SQL, stored procedure
    Run file name: SPKO1

    < < concurrent program - set > >

    Program: RDRAGON SO IMPORT
    Short name: RDRAGON_SO_IMPORT
    Application: Order management
    Name of executable: RDRAGON_SO_IMPORT
    Method: PL/SQL, stored procedure

    Format: text
    No set

    -Here are my stored procedure-


    CREATE OR REPLACE PROCEDURE APPS. SPKO1 IS
    FH UTL_FILE. TYPE_DE_FICHIER;
    v_line VARCHAR2 (32767).
    v_source_id NUMBER (10);
    v_created_by NUMBER (10);
    v_creation_date DATE;

    v_org_id NUMBER (10);
    v_orig_sys_docref VARCHAR2 (50);
    V_Customer VARCHAR2 (360);
    v_customer_prev VARCHAR2 (360);
    v_sold_to_org NUMBER (10);

    v_orig_line_ref NUMBER (10);
    v_item_code VARCHAR2 (2000);
    v_ordered_qty NUMBER (10);
    v_selling_price NUMBER (10);
    v_count NUMBER (10);
    v_stat NUMBER;


    /******************************************************************************
    NAME: SPKO
    PURPOSE:

    REVISIONS:
    Worm Date Description of the author
    --------- ---------- --------------- ------------------------------------
    1.0 16/04/2012 administrator 1. Created this procedure.

    NOTES:

    Keywords to replace automatically available Auto:
    Object name: SPKO
    SYSDATE: 16/04/2012
    Date and time: 16/04/2012, 17:55:42 and 16/04/2012 17:55:42
    Username: admin (set in Options of TOAD, editor of the procedure)
    Name of the table: (defined in the dialog box "New PL/SQL object")

    ******************************************************************************/
    BEGIN
    v_source_id: = 6;
    v_created_by: = - 1;
    v_org_id: = 204;
    v_customer_prev: = null;
    v_orig_line_ref: = 0;
    v_stat: = 0;

    SELECT header_id in (DE) v_orig_sys_docref
    Select header_id
    of OE_ORDER_HEADERS_ALL
    creation_date desc order
    ) WHERE ROWNUM = 1;


    FH: = UTL_FILE. FOPEN ('XXANDDIR2', 'myfile1.csv', 'R', 32767);
    < < file_read_lines > >
    LOOP
    BEGIN
    UTL_FILE. GET_LINE (fh, v_line);

    V_Customer: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 1") ',' "') ','" ');
    v_creation_date: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 2") ',' "') ','" ');
    v_item_code: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 3") ',' "') ','" ');
    v_ordered_qty: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 4") ',' "') ','" ');
    v_selling_price: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 5") ',' "') ','" ');
    v_orig_line_ref: = (v_orig_line_ref + 1);

    If v_stat = 0 then
    v_orig_sys_docref: = (v_orig_sys_docref + 1);
    end if;

    SELECT hca.cust_account_id from v_sold_to_org
    OF hz_cust_accounts AOB.
    HP hz_parties
    WHERE hca.party_id = hp.party_id
    AND hca.request_id is null
    AND hp.party_name = v_customer;

    If v_stat = 0 then
    INSERT INTO OE_HEADERS_IFACE_ALL)
    order_source_id,
    orig_sys_document_ref,
    org_id,
    CREATION_DATE,
    created_by,
    last_update_date,
    last_updated_by,
    operation_code,
    sold_to_org_id,
    booked_flag)
    VALUES)
    v_source_id,
    ('TEST' | v_orig_sys_docref).
    v_org_id,
    v_creation_date,
    v_created_by,
    v_creation_date,
    v_created_by,
    "INSERT."
    v_sold_to_org,
    'Y') ;
    commit;
    end if;

    INSERT INTO OE_LINES_IFACE_ALL)
    order_source_id,
    orig_sys_document_ref,
    orig_sys_line_ref,
    inventory_item,
    org_id,
    ordered_quantity,
    unit_selling_price,
    unit_list_price,
    CREATION_DATE,
    created_by,
    last_update_date,
    last_updated_by,
    operation_code)
    VALUES)
    v_source_id,
    ('TEST' | v_orig_sys_docref).
    v_orig_line_ref,
    v_item_code,
    v_org_id,
    v_ordered_qty,
    v_selling_price,
    v_selling_price,
    v_creation_date,
    v_created_by,
    v_creation_date,
    v_created_by,
    "INSERT");
    commit;

    v_customer_prev: = v_customer;
    If v_customer_prev = v_customer then
    v_stat: = 1;
    on the other
    v_stat: = 0;
    end if;
    -DBMS_OUTPUT. Put_line ('Col1: ' | v_source_id |', Col2: ' | v_creation_date |', Col3: ' | v_created_by |', Col4: ' | v_updated_date |', Col5: ' | v_updated_by);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    OUTPUT file_read_lines;
    END;
    END LOOP;
    SELECT count (*) in the OE_HEADERS_IFACE_ALL v_count;
    DBMS_OUTPUT. Put_line (' record Total inserted successfully: ' | v_count);
    UTL_FILE. FCLOSE (FH);

    END SPKO1;
    /


    But when I run the stored procedure using TOAD his work.

    Help, please. This is my first time to attach the stored procedure in the concurrent program.

    Thank you very much.

    Kind regards
    Diane

    Published by: peopsquik08 on April 18, 2012 03:58

    as clive_t solier
    >
    You must explicitly reference the settings out
    >

    Try

    DECLARE
    VFILE VARCHAR2(32767);
    V_SOURCE_ID NUMBER;
    --
    ERRBUF VARCHAR2(200);
    RETCODE NUMBER;
    
    BEGIN
    VFILE := 'myfile1.csv';
    V_SOURCE_ID := 6;
    
    --APPS.OMORDERLOADER.SPKO1 ( VFILE, V_SOURCE_ID );
    --COMMIT;
    
    APPS.OMORDERLOADER.SPKO1(
        ERRBUF => ERRBUF,
        RETCODE => RETCODE,
        VFILE => VFILE,
        V_SOURCE_ID => V_SOURCE_ID
      );
    END;
    

    but the code above to test your proc

    to run concurrent SQL, you can use fnd_submit.submit_program

  • How to create simultaneous program of type PL/SQL stored procedure?

    I have the procedure to reset sequence as below:

    CREATE OR REPLACE PROCEDURE DEV_RESET_XX IS

    V_NEXT_VAL1 NUMBER;

    BEGIN

    RUN IMMEDIATELY "ALTER SEQUENCE DEV_RECEIPT_S1 MINVALUE 0';"

    RUN IMMEDIATELY "SELECT DEV_RECEIPT_S1. DOUBLE NEXTVAL ' IN V_NEXT_VAL1;

    RUN IMMEDIATELY "ALTER SEQUENCE DEV_RECEIPT_S1 INCREMENT BY ' |" -V_NEXT_VAL1;

    RUN IMMEDIATELY "SELECT DEV_RECEIPT_S1. DOUBLE NEXTVAL ' IN V_NEXT_VAL1;

    RUN IMMEDIATELY "ALTER SEQUENCE INCREMENT DEV_RECEIPT_S1 1 ';"

    END DEV_RESET_XX;

    And if I run this query don't use PL/SQL, no problem and success.

    EXEC DEV_RESET_XX

    And then I want to create simultaneous program for this procedure.

    1. create the executable program

    -Methods: PL/SQL, stored procedure

    2. create the simultaneous program

    -Call the executable program

    -Nothing parameter

    3. assign the application group to receive

    And then I try to run this competitor.

    But, status complete error.

    8-31-2015 7-10-22 PM.jpg

    Help, please.

    Thank you.

    Hello

    To save pl sql program, we have two required parameters. ERRBUFF and RETCODE

    Steps to create a concurrent program of type PL/SQL stored procedure. Techmandate.com

    No need to create these parameters in the simultaneous program window. Just use those in your procedure.

    hope this will help you

  • Creation of XML report using the PL/SQL stored procedure

    Hi friends,

    I'm working on a report xml with the xml source as a PL/SQL stored procedure.

    I mean the fiscal year indicated in the following link to understand the process:

    http://orclapp.blogspot.com/2012/02/developing-xml-publisher-report-using.html

    In the example shown in the link above, I did not understand the following:

    (1) in the following procedure, setting out "retcode" is not used at all.

    What is the importance of this parameter.

    REPORT PROCEDURE (errbuf OUT VARCHAR2, retcode OUT VARCHAR2, p_product_id in NUMBERS)

    (2) after the xml data are prepared and updates 'l_result' variable Clob, what follows

    Loop is executed. I am not able to understand why the following loop is required.

    LOOP

    EXIT WHEN l_length = l_retrieved;

    IF (l_length - l_retrieved) < 32000

    THEN

    SELECT SUBSTR (l_result, l_retrieved + 1) IN l_xmlstr FROM DUAL;

    l_retrieved: = l_length;

    fnd_file.put_line (fnd_file.output, l_xmlstr);

    ON THE OTHER

    SELECT SUBSTR (l_result, l_retrieved + 1, l_offset)

    IN l_xmlstr

    FROM DUAL;

    l_retrieved: = l_retrieved + l_offset.

    fnd_file.put_line (fnd_file.output, l_xmlstr);

    END IF;

    END LOOP;

    (3) in the example it is not explained how the concurrent program gets the xml data?

    I guess that it is written to a file by using the following line of code:

    fnd_file.put_line (fnd_file.output, l_xmlstr);

    I would be grateful if someone can shed some light in my questions above so that I can well understand the process.

    Thanks and greetings

    Hawker

    Hi 32000 in the code is a 'safe' than 32767 available max mesh, loops is intended to get around the entire thing into pieces that can be managed within the limits of the data type.

    BTW; If you are in the following Oracle e-business, you can also use the Oracle reports very simply to create the XML output.

    If you have reports developer all you need to do is put raw sql (create XML without any "Fireworks") in the SQL report and then set reporting in XML format in the definition of program in Oracle e-business.

    Best regards

    Robert.

  • to find the location of PL/SQL, stored PROCEDURE in the database

    Hello

    This is the detail I have the executable of the Application Developer program simultaneous

    Executable NAPESCO_STAFF_LEDGER_DTLS

    Short name NPSTALEDDTLS

    Application of human resources

    Execution of PL/SQL, stored procedure method

    Name of file execution NAPESCO_STAFF_LEDGER_DTLS


    I would like to know how to view and change this procedure, where it is stored

    kindly help

    Hello

    This seems to be a custom package. To display the source of the simultaneous program ' PL/SQL Stored Procedure', please refer to (Note: 455582.1 - where can I get the whole "stored procedure" Pl/Sql Source file on the current program?).

    Thank you
    Hussein

  • Call a PL/SQL stored procedure - data type mismatch

    I call a PL/SQL stored procedure from within a procedure of ODI using the specified technique page Cezar and Julien (http://odiexperts.com/how-to-use-plsql-procedures-and-functions-in-odi) and I get the error "Wrong number or argument types»

    I tested each of the types of parameters, in that I'm passing and it is the text that is causing the problem. I tried to use 'Text' and 'Alphanumeric' for the data type of the variable of the ODI and so many VARCHAR2 and VARCHAR for the PL/SQL parameter type and I can't make it work.

    Is there a trick for passing a string in the ODI PL/SQl?

    Hello

    Ensure

    1. to declare/refresh of the variable before call to PL/SQL.

    2. If the variable is of "alphanumeric" ODI calling must be attached to apostrophes and prefix with the code project as ' #MYPROJECT. ODI_Var'

    3. as parameters you have u who must pass both during the call (IN, OUT, etc.).

    Thank you
    Guru

  • How to execute the pl/sql block from a file

    Hi all
    can someone tell me how to execute a pl/sql block to a file.it does contain no procedures.it is of the form
    -Start
    -says
    -end;

    Thanx

    Ok.. If the time points? :)

    See you soon!
    Bobin

  • BPEL does not receive "return value" of MS SQL, stored procedure

    Hello

    We are facing this problem citing a MS SQL stored procedure the BPEL (jdbc 1.2 driver). We have created the wsdl for the stored procedure correctly using a command line utility tool provided with Oracle SOA Suite.
    But the question is THAT BPEL is not able to get the data present in the statement of "return" of the procedure. We receive null output. But it is able to extract the data from the output variable, if any. Case 1 below is for the return statement. Case 2 is for the output variable


    Case 1: in the following, the output is returned using the return statement. The BPEL that calls this procedure is to obtain a NULL value as an answer to this.


    ALTER PROCEDURE [dbo]. [AddNumbersRet]
    -Add the parameters for the procedure
    @Number1 int,
    @Number2 int
    AS
    BEGIN
    -SET NOCOUNT ON added to avoid additional results sets from
    -interfering with SELECT statements.
    SET NOCOUNT ON;

    -Controls insert for procedure here
    Return (@Number1 + @Number2);
    END

    Case 2: in the following, the output is returned using the SumOfNums output variable. The BPEL that calls this procedure is to obtain a correct answer.


    ALTER PROCEDURE [dbo]. [AddNumbers]
    @Number1 int,
    @Number2 int,
    @SumOfNums int output
    AS
    BEGIN

    -SET NOCOUNT ON added to avoid additional results sets from
    -interfering with SELECT statements.
    SET NOCOUNT ON;

    Set @SumOfNums = (@Number1 + @Number2);

    END



    Case 1 is a failure and case 2 is successful. We cannot change our procedures similar to case 1 to use variables of output because of dependencies on other applications.

    All the world is facing this problem? This looks like a bug in BPEL. Please, share your experiences.


    Thanks and greetings

    Mohan

    Published by: user10980910 on December 8, 2009 05:16

    There is a gap in the command line utility that was addressed in the adapter configuration (AS11gR1) Wizard. The API is a procedure, not a function, so does not return the query for the parameters that the utility made anything for the RETURN statement.

    The adapter configuration wizard is unable to say if there is a RETURN statement either, but it provides the user with a check box that can be used to indicate the presence of the declaration. In the wizard, if you check the checkbox, a parameter is added to the XSD to the RETURN statement. In essence, the adapter will process the procedure as a function and you will get the value of the PERFORMANCE.

    Usually, I wish to indicate that you certainly should NOT change the generated XSD. But you might be able to do it, by adding the necessary element to the OutputParameters for your RETURN statement. Add the following immediately AFTER the element of 'Lines', which occurs first in the XSD and BEFORE all items for the other none.

    Use a value for the "" that is meaningful to you. The wizard uses the name of the stored procedure with the name of the element. We could call this "RETURN_VALUE" or else if is more to your liking. Add the item after you generate the XSD using the command line utility, and then use the XSD when you model your BPEL processes. The WSDL should already have the content for this element handling.

  • SQL stored procedure input and output parameters

    Hello Gang,

    My dead end trying to call a stored procedure in SQL Server 2008 with the LV database tool.

    for purposes of experimentation, I've created a small procedure with an input parameter that returns an integer as return value.  It works describing a query, but all attempts at LV produce an error-2147217900 when executing query VI.  I did find examples of that.

    Sending a bunch of parameters to a stored procedure and checking the value of return seems to be pretty common stuff.

    I'll appreciate any help.

    Thank you

    Roger

    Hi Roger,

    There are a few prerequisites which I will list below. If you have not checked these things, so don't hesitate, as your hiccups can be there.

    Prerequisites:

    1. Ensure that you can read from a table in the database to verify that you can access the database (user permissions) and ensure that your login details are correct. Among other things, make sure that the. DSN switches to the correct database. (See the simple example below, SQL Select.vi)
    2. Make sure that your user (if you use SQL authentication) has permissions to run the STORED procedure by running the procedure in SQL Server Management Studio (you seem to have already done this)

    Example by calling a procedure without parameters (attached as SPROC_No_Parameters.vi):

    Example by calling a procedure with parameters (attached as SPROC_Parameters.vi):

    An article on the execution of stored procedures is here:

    http://digital.NI.com/public.nsf/allkb/07FD130746083E0686257300006326C4

    Don't forget to download the example VI since it includes the cases where you want an output parameter of the procedure rather than a table.

    I tested these against two very simple SPROCs and it worked fine (on SQL Server 2005, but 2008 should be the same).  Stored procedures have been:

    CREATE PROCEDURE [dbo]. [GetContacts]

    AS
    BEGIN
    -SET NOCOUNT ON added to avoid additional results sets from
    -interfering with SELECT statements.
    SET NOCOUNT ON;

    -Controls insert for procedure here
    SELECT * FROM Contacts
    END

    and

    CREATE PROCEDURE [dbo]. [MultiplyAges]
    @param1 INT = 1
    AS
    BEGIN
    -SET NOCOUNT ON added to avoid additional results sets from
    -interfering with SELECT statements.
    SET NOCOUNT ON;

    -Controls insert for procedure here
    SELECT (age * @param1) OF Contacts
    END

    I would like to know if these examples work for you or if you have any other questions.  Don't forget to go through this KB article and articles related to it, they should cover other situations.

    Matt

  • How can I automatically run a stored procedure when a report is called?

    I've created a classic report on a table (without screen). When I go to this report, I would like to the stored procedure that deletes and inserts information about the table that is based on the report has been started automatically. Where and how can I do to put the call to the stored procedure that the report displays the data once the report is called?

    Thank you!

    Mark1970 wrote:

    I've created a classic report on a table (without screen). When I go to this report, I would like to the stored procedure that deletes and inserts information about the table that is based on the report has been started automatically. Where and how can I do to put the call to the stored procedure that the report displays the data once the report is called?

    Create a page of PL/SQL process by calling the procedure with a Point process On Load - front of regions.

    The report is based on a global temporary table?

  • call a pl/sql stored procedure from a report link

    Hi all:

    I have a report with a link in a column, which you take to another page and passes the values to this page, but also need to link, run a stored procedure before you go to the other page.

    In the Forum, I found a case similar to this one, but none of the examples is clear to me that I'm doing this. It seems that the target of the link must be URL, and also I have to call the stored procedure with a javascript function.

    My questions are:
    -Is the best way to do what I need?
    -How should be the syntax of the link that takes me to another page and run the "procedure".
    -How and where I put the "javascript" function to execute the "stored procedure".


    BDD: Oracle 11 g
    Apex 4.1 version


    Best regards

    Gerard

    Hello

    Change the link to call an apex.submit procedure. (javascript).

    Edit:

    I created a basic example.

    Region 1 (just so that you can see the value ready):

    Select: P27_HIDDEN item_Value
    of the double

    Region 2:

    rownum SELECT id, dbms_random.string ('U', 12) sss
    of the double
    connect by level<=>

    element attributes for ID:

    Target: URL
    URL: javascript:apex.submit ({request: 'NAVIGATE', value: {'P27_HIDDEN': #ID #}});

    (P27_HIDDEN is just a hidden item I created)

    http://Apex.Oracle.com/pls/Apex/f?p=54920:27

    Edit2:

    In your case, then you can only have a page based on conditions request = expression1, expression1: NAVIGATE... then a branch of the page to go to the desired page, also with the same conditions

    Edit3:

    I'm not sure what examples you're talking about, that you provide no link; but you mention calling the stored procedure of javascript, so would probably involve some AJAX, but is not necessary IMO.

  • appellant the pl/sql stored procedure

    Jdev11g R2, ADF BC

    I have a stored procedure 'COPY_BKG_E2I' and it has three input parameters to generate a new record in the database.
    ===========================================================================
    I created the AM method as follows and defined as method of the client AM class:
    =========================================================

    helper method:
    ===========

    protected void callStoredProcedure (String stmt, Object [] bindVars) {}
    PreparedStatement st = null;
    try {}
    // 1. Create a JDBC PreparedStatement for
    St = (PreparedStatement class) getDBTransaction () .createPreparedStatement ('start' stmt + ";"end;", 0);
    If (bindVars! = null) {}
    // 2. Loop on values for the bind variables passed, if any
    for (int z = 0; z < bindVars.length; z ++) {}
    // 3. Set the value of each variable binding in the statement
    st.setObject (z + 1, bindVars [z]);
    }
    }
    // 4. Execute the statement
    st.executeUpdate ();
    }
    catch (SQLException e) {}
    throw new Aexception.getLocalizedMessage (e);
    }
    {Finally
    If (st! = null) {}
    try {}
    // 5. Close statement
    St.Close ();
    }
    catch (SQLException e) {}
    }
    }
    }


    call the stored procedure:

    {} public void callProcWithThreeArgs (String V_BKG_NO, String V_VESSEL_ARRIVED_REMARKS, Date V_ATA_POD_D)
    callStoredProcedure ("COPY_BKG_E2I(?,?,?)", ")
    New Object [] {V_BKG_NO, V_ATA_POD_D, V_VESSEL_ARRIVED_REMARKS});
    }


    Now, I created back bean and page fragment,
    =================================

    in my page fragment, I bind the field three entries to the bean back:
    ============================================

    package olfms.view.backing;

    Import oracle.adf.view.rich.component.rich.input.RichInputDate;
    Import oracle.adf.view.rich.component.rich.input.RichInputText;
    Import oracle.adf.view.rich.component.rich.output.RichOutputText;

    public class saveBkgUpd {}
    Private RichOutputText bkg_no;
    Private RichInputDate arrive_date;
    Private RichInputText arrive_remarks;

    public saveBkgUpd() {}
    Super();
    }

    {} public void setBkg_no (RichOutputText bkg_no)
    This.bkg_no = bkg_no;
    }

    public RichOutputText getBkg_no() {}
    Return bkg_no;
    }

    {} public void setArrive_date (RichInputDate arrive_date)
    This.arrive_date = arrive_date;
    }

    public RichInputDate getArrive_date() {}
    Return arrive_date;
    }

    {} public void setArrive_remarks (RichInputText arrive_remarks)
    This.arrive_remarks = arrive_remarks;
    }

    public RichInputText getArrive_remarks() {}
    Return arrive_remarks;
    }

    My question:
    //?????? How to call the callProcWithThreeArgs with these three bkg_no; arrive_date; arrive_remarks; Help, please! Thank you!

    ?
    }

    Check your imports
    especially: import oracle.binding.BindingContainer;
    This is the bean of tire

    import oracle.adf.model.BindingContext;
    import oracle.binding.BindingContainer;
    import oracle.binding.OperationBinding;
    
    public class Test {
        public Test() {
        }
    
        public BindingContainer getBindings() {
            return BindingContext.getCurrent().getCurrentBindingsEntry();
        }
    
        public String callProcedureProgramatically() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("callProcWithThreeArgs");
            operationBinding.getParamsMap().put("param1", "first value");
            operationBinding.getParamsMap().put("param2", "second value") ;
            operationBinding.getParamsMap().put("param3", "third value");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            }
            return null;
        }
    }
    
  • PL SQL Stored Procedure help

    Hello
    I'm new to the development of Oracle.
    I have the following scenario for which I need your help/suggestions to write a stored procedure.
    A load process in a table unfolds with about million files once a month.
    I have a LOG Table to record the events of job loading IE when it starts, when it stops, status etc. with the following columns

    job_name, job_status, start_time, end_time, date, flag

    work focuses on the work that is in charge of the table.
    Based on the values in this table, I want to develop a stored procedure sql pl verifies the status of the job and does the following

    When the flag = R (assume for running job) set it to run the job again as 1 hour later... if its still ongoing then 1 hour later... so now up to 5 trys
    = F (Finished)
    = E (error problem) launch the load immediately

    The flag State values noted above are not binding... values just to give you an idea... all the other variables to use to store procedure or any new passes in the table... .suggestions are welcome for these values as well.
    Basically, I would like the stored procedure to be called at some point... say SUNDAY at 06:00 and check the STATUS of the INDICATOR/table newspaper column and run.

    In short, I like the pl sql store procedure to use table to log and monitor the loading process.

    Structure/Basic code stored procedure for this requirement or a stored procedure that you have met similar requirements are welcome.

    Thanks in advance.

    Published by: user13517642 on March 23, 2011 13:28

    Published by: user13517642 on March 23, 2011 13:29

    Your process or procedure shud look like - [not tested]

    DECLARE
       l_flag   LOG.flag%TYPE;
    BEGIN
    
          SELECT flag
            INTO l_flag
            FROM LOG
           WHERE job_name = p_job_name;
    
       WHILE l_flag = 'R'
       LOOP
          DBMS_LOCK.sleep (3600);   --3600secs in 1hr
    
          SELECT flag
            INTO l_flag
            FROM LOG
           WHERE job_name = p_job_name;
       END LOOP;
    
       IF (l_flag IN ('F', 'E'))
       THEN
            --<>
       END IF;
    END;
    

    Look at the following to find out how to plan work-

    http://www.oradev.com/dbms_scheduler.jsp

    Published by: Sri on 23 March 2011 14:10

    Published by: Sri on 23 March 2011 14:11

  • How to edit or change a stored procedure?

    I created a stored procedure with the name getRecords 1 months ago


    I want to change this getRecords of stored procedure

    Please tell me how to change the stored procedure

    So what you would do is

    Starting sqldeveloper, connecting as the owner of the procedure.
    In the tree list, expand the entry procedures.
    You will see all the procedures in this scheme.
    Double-click the procedure that you want to modify, and a window opens with the source code.

    -----------
    Sybrand Bakker
    Senior Oracle DBA

  • How to create temporary tables in stored procedures.

    Hello

    I am new to oracle, I have a requirement where I need to run a query in a loop for different values of where condition. Here, I need to record the results of the query on each iteration. After the end of the loop, I need to send the results to the front end. I did a lot of research for the concept of the temporary table in oracle, but I found myself unresolved except headaches. Everyone is showing how to create temporary tables in general but not in stored procedure.

    Bad, I need the concept of temporary tables, or is there an alternative way to store temporary results. My procedure looks like this.

    create or replace
    procedure uspMatchCode (parWord varchar2, p_recorderSet to types.cursor_type)
    as
    smallint parCnt;
    Start
    parcnt: = 0;
    Select count (1) in parCnt of...;
    If parcnt > 0 then
    Open for P_recorderSet
    Select field1, field2, field3,... of table1, table2, table2 where < < condition > >
    on the other
    -Here, I want to create a temporary table and store the result for the loop shape into the temporary table.
    CREATE TEMPORARY TABLE global my_temp_table (NUMBER of Column1, Column2) ON COMMIT DELETE ROWS.
    FOR parCnt in 0.3
    loop
    INSERT into my_temp_table select Field1, Field2, field3,... from table1, table2, table2 where < < condition > >
    end loop;
    Open for P_recorderSet
    Select * from < < temporary table > >
    end if;
    end;

    Any help would be great to check me on the problem.

    Thank you
    Kiran.

    This is a change to the query Kiss has posted:

    with data_text like)
    Select regexp_substr (' sales financing marketing ',' [^] +', 1, level ") val
    of tconnect by level<= length('sales="" finance="" marketing')-="" length(replace('sales="" finance="" marketing','="">
    )
    Select * from t, data_text, where t.colname like '% "| data_text. Val |' %'

    This will help you. Please change the column names and the name of the table as a result

Maybe you are looking for