How to control job created inside a procedure

Scenario:+*
I have a package which has 14 procedures which are interdependent and hence running in sequence. The entire process will take around 1.5 hrs to complete. So inorder to bring down time consumed to complete this process i have identified few procedures among this 14 which can be run in parallel. That lead to me to use DBMS_SCHEDULER and had successfully splitted these procedures and now these procedures are execute some in parallel then some in sequence, the starting of one depending on the ending of other with the help of programs, chains and chain rules.
To achieve this i have a job at the end of my package, to execute the chain, for which the auto_drop attribute is set to TRUE as i dont want the job to be in the database sitting idle. Here job is created on the fly.
Issue:_*
As soon as the controll reaches DBMS_SCHEDULER.ENABLE ('job'), my chain starts running in the backend and the API gives the output procedure is completed.
Here actually the procedure is not completed as the job is still running in the backend. But the java code which calls the procedure is receiving the message that procedure is completed.
Question:*
How can i stop the API sending the message "Procedure succesfully completed" before completing the job.
Please advice

DBMS_SCHEDULER package use to execute Procedure, Executable blocks etc..without manual intervention on specific timings. As soon as you submits the job it will reply you "Procedure successfully completed" that means successfully accepted.
It does not know how many times that job needs to be executed in future. After completion of job how it will return successful message ( to which session?).
You need to check the status of the job using various data dictionaries available in oracle to know the status of your job.
In java code you interpret that, whenever you get such message that mean job submitted not completed.

Similar Messages

  • How to delete Jobs created by T.Code SM36

    Hi,
    I am trying to delete Events created by T.code SM62.
    But this has some jobs which i created by T.Code SM36.
    How i Can delete these Jobs.
    Because i want stop my process chain triggered by this event.
    Regards,
    Anand Mehrotra.

    Hi Anand,
    Please go through the below procedure....
           1.      Select a job (or jobs) from the Select Background Jobs screen (Transaction SM37, or choose CCMS ® Jobs ® Maintenance, complete the description of the jobs you want to delete, then choose Execute to get to the Job Overview.)
           2.      In the Job Overview, mark the job or jobs you want to delete by checking the box to the left of the job name.
           3.      Choose Job ® Delete.
    Hope this helps you
    Thanks
    KP

  • How to control Jobs

    Hi,
    How can we restrict the jobs scheduling by users . i.e I wan to restrict for a particular user so that he can able to schedule certain no.of jobs ( 5 ) only. If he wants to schedule 6th job on his name, it should not be released... Once a job among the previoulsy scheduled jobs (5) will complete, then the 6th job should be released....
    Thanks & Regards.
    Srini.

    Hi Srinivas,
    Like this you can check  the no of jobs executed by user.
    Based on the count u can do validation
    tables: tbtco.
    data: sj_count type i.
    parameters: p_user like tbtco-reluname.
    select count(*) from tbtco into sj_count where
                          reluname = p_user and
                          status  = 'R'.
    if sj_count > 5.
        write:/ sj_count. "ur logic
      exit.
    else.
      " perform validate
    endif.
    Hope it gives u hint.
    thanks\
    Mahesh

  • How to control CFLAYOUT height inside CFWINDOW?

    Hi folks. I've been battling with a problem for a while. I
    want to use CFLAYOUT tags within CFWINDOW. Now, this works just
    fine and dandy, except that CFLAYOUT does not know the size of the
    CFWINDOW.
    Thus, if you use CFLAYOUT wihthin a CFWINDOW, you are likely
    getting scroll borders for the window. I can manually set the
    CFLAYOUT size with the style attribute for sure to get rid of the
    problem, but static sized windows aren't really cool...
    How could I make the CFLAYOUT automatically resize according
    to the CFWINDOW size? I've tried to use the
    ColdFusion.Window.getWindowObject() but I haven't been able to
    succesfully touch the ExtJs's basicElement object properties...
    Here's some code samples to start with. Hope it doesn't have
    too many typos, since I altered the code somewhat before posting...
    index.cfm :
    <script>
    function destroyWindow(name) {
    ColdFusion.Window.destroy(name);
    function resizeWindow(name,width,height){
    alert(width+' '+height);
    // name is an object. Now what? How do I extract the object
    name or Id .. and
    // how to dig out the correct id's, the style of which I
    want to change...?
    function newTestManager() {
    i = Math.random();
    ColdFusion.Window.create('testManager'+i,'Test
    Manager','testmanager.cfm',{width:800,height:500})
    ColdFusion.Window.onHide('testManager'+i, destroyWindow);
    win = ColdFusion.Window.getWindowObject('testManager'+i);
    win.on('resize',resizeWindow);
    </script>
    <a href="javascript:newTestManager()"
    id="newTestManager">Test Manager</a>
    testmanager.cfm:
    <cflayout type="border"
    style="height:470px;width:786px">
    <cflayoutarea splitter="true" size="190" minsize="100"
    maxsize="400" name="tmleft" position="left"
    source="testmanager.left.cfm">
    </cflayoutarea>
    <cflayoutarea position="center" name="tmcenter"
    source="testmanager.center.cfm">
    </cflayoutarea>
    </cflayout>
    create testmanager.left.cfm and testmanager.center.cfm -
    might be empty files as well.
    Try leaving out the cflayout style attribute, and see what
    happens if you omit that. You might also try to open a smaller
    CFWINDOW if the problem doesn't highlight otherwise.
    I'm sure many others would appreciate a solution to this.
    Thanks!

    I'm now confused at what you are trying to do ?
    I have not tried the example I posted, but
    resizeListener = function(myWindow,width,height){
    whMsg = ("width: " + width);
    whMsg = (whMsg + "\nheight: " + height);
    myWindow.body.update(whMsg);
    This code to me would only change the width and height.
    But, I did a test (see attached code)
    The cflayout resizes when the window is resized !!
    The code is from the online docs, its a login window.
    I just enclosed the form in cflayout/cflayoutarea tags.
    Ken

  • How to control dynamically created symbols

    Hi, I'm new in edge but thanks to adobe forum that helped me a lot.
    I'm trying to use ".createChildSymbol" to bring my symbols from the library to my stage. And in each symbol I have an OUT label, so every time a new symbol is called by a particular button, the last one plays from OUT label and new one appears at the same place.
    It's all easy for two symbols and I do not need to set any vaiable for them. But I have almost 180 symbols, and a menu of buttons to call them, so every button needs to play the OUT label of the current symbol and also plays the new one and make it as the current one.
    I would be truly thankful if someone help me to fix this problem.
    sym.test = sym.createChildSymbol("test", "Stage");
    sym.getComposition().getStage().setVariable("current", "test");
    var current = sym.getComposition().getStage().setVariable("current");
    sym.current.getSymbolElement().css({position:'absolute', display:'inline-block', top:167, left:91});

    Ok, lets take a look at the code. I've changed the symbol names so it becomes a little more friendly.
    So, I have an array of 4 animations ("animation1",  "animation2",  "animation3",  "animation4") and an array of 4 buttons ("button1",  "button2",  "button3",  "button4"). The names of the symbol instances are the things you have to change.
    This is the code that goes inside Stage/compositionReady
    var current_animation = null; // Index in array_options: 0=a, 1=b, 2=c, 3=d
    var current_animation = null; // Index in array_options: 0=a, 1=b, 2=c, 3=d
    var request_animation = null; // Index in array_options: 0=a, 1=b, 2=c, 3=d
    var array_animation = ["animation1", "animation2", "animation3", "animation4"];
    var array_buttons = ["button1", "button2", "button3", "button4"];
    // Called by timeline.complete/location event inside each Animation
    sym.playRequest_animation = function(){
      sym.getSymbol("animationContainer").getSymbol(array_animation[request_animation]).play('lead_in');
      current_animation = request_animation;
    // Called on button click
    sym.btnClick_animation = function(request_myAnimation) {
      request_animation = request_myAnimation;
      if(current_animation != null){
        sym.getSymbol("animationContainer").getSymbol(array_animation[current_animation]).play('lead_out');
        sym.getSymbol(array_buttons[current_animation]).play('option_exit');
      else{
        sym.playRequest_animation();
    This bit of code goes at the trigger "click" inside all buttons:
    sym.getComposition().getStage().btnClick_animation(0); // 0 index of array = a —> button1
    sym.getComposition().getStage().btnClick_animation(1); // 1 index of array = b —> button2
    sym.getComposition().getStage().btnClick_animation(2); // 2 index of array = c —> button3
    sym.getComposition().getStage().btnClick_animation(3); // 3 index of array = d —> button4
    There's also this code that enables the page, upon load, to open the first animation, therefore animating the first button (and disabling it) - it's located at the trigger "section_lead_in" wich only exists inside button1:
    sym.getComposition().getStage().btnClick_animation(0); // 0 index of array = a
    Finally, this block of code goes inside all animations and are located at 2000ms - during the process where the active animation as almost left the scene:
    sym.getComposition().getStage().playRequest_animation();
    Notice that, for the sake of organization, I have all my animations inside a symbol called "animation_Container".
    Again, if you want, I can give you a hand with your files. Just post it.
    Download the file again for an updated version.
    P.S. I hope I didn't forget anything...

  • Jobs created in DB Control EM

    Hi,
    on 10g R2,
    when I create a job in DB control (IE web browser home page , under related links, job link, job library, create a job) in which table this job is registered ?
    If in the days after , it is impossible to connect to DB control , how (in sqlplus for example) I can stop or delete this job ?
    Thanks.

    Thank you. I have a job created with user sys in DB control. It is :
    Job Name GATHER_STAT_SYSADM
    Description GATHER_STAT_SYSADM
    And what it does:
    execute DBMS_STATS.GATHER_SCHEMA_STATS ( 'SYSADM');
    Now I query DBA_jobs :
    SQL> show user;
    USER est "SYS"
    SQL> select count(*) from dba_jobs;
      COUNT(*)
             1
    SQL> select what from dba_jobs;
    WHAT
    EMD_MAINTENANCE.EXECUTE_EM_DBMS_JOB_PROCS();I query ALL_JOBS :
    SQL> select what from all_jobs;
    no rows selectedIt isn't in any table ?

  • How to create a pricing procedure

    how to create a new pricing procedure and activate it

    You create it in spro > Sales and Distribution > Basic Functions > Pricing > Pricing Control > Define and Assign Pricing Procedures > Maintain Pricing Procedures
    You can't attach PP to specific plant. Pricing Procedure is determined thru trx OVKK. The defining parameters for pricing procedure determination are:
    1. SalesOrg
    2. Distribution Channel
    3. Division
    4. Document Procedure (defined in Sales doc\Billing doc maintenance) 
    5. Pricing procedure assigned to customer (defined in customer master)
    http://www.sap-img.com/sap-sd/creating-new-pricing-procedure.htm
    http://help.sap.com/saphelp_470/helpdata/en/dd/5616cc545a11d1a7020000e829fd11/content.htm
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Creating tables inside stored procedures

    is there a limitation as of how many tables i can cerate inside my stored proc using:
    execute immediate('CREATE TABLE xxx AS select * from yyy.... ?
    i have a stored proc that creates couple tables with the method shown above. but the compiler complains for the second create table zzz as select * from .... any idea why?
    I am attaching my procedure just in case:
    CREATE OR REPLACE
    procedure retail_cif_prep as
    begin
    begin
    execute immediate('drop table cif_retail');
    execute immediate('drop table cif_retail_wrong_ccsno');
    exception
    when others then
    null; -- or log errors other than -942 (table doesn't exist)
    end;
    execute immediate('CREATE TABLE cif_retail AS select * from cst where cstfnflag=1 and cstdatoc!=''00000000'' order by cstno');
    execute immediate('CREATE UNIQUE INDEX cif_retail_clustered ON cif_retail(CSTNO)');
    delete from cif_retail where CSTNAM='';
    execute immediate('CREATE TABLE cif_retail_wrong_ccsno AS select * from cif_retail where cstccsno not in (100, 110, 130, 900)');
    delete from cif_retail where CSTNO in (select CSTNO from if_retail_wrong_ccsno);
    end;

    Agree with 3360, this sort of things should be done beforehands.
    Basically what's happening is when you try and compile your procedure the delete statements are referencing your two tables, but I'm guessing these tables are yet to be created on the database and therefore the procedure won't compile without them.
    A dirty workaround is to put your delete statements inside execute immediate commands too.
    Then sit back, make a cup of coffee and have a good think about why on earth you are writing such poor code.

  • How to control the shared libs when creating an new OC4J  in AS 10.1.3.4

    Hi there
    I experience some wired behavior in AS 10.1.3.4!
    I Have 2 different installation of AS 10.,1.3.4 (Win 2003 server).
    When I create an OC4J instance (using the manager) at virtual server 1 I got 28 global libraries
    When I create an OC4J instance (using the manager) at virtual server 2 I got 30 global libraries, (+ apache.webservices & oracle.ifs.client )
    Why this difference ?
    And how to control it?
    Note the default instance "Home" has 28 libraries on both servers!!
    Why is it sometime possible possible to use <instance>applib for the jar, and sometime I need to create an <instance>\shared-lib\global.libraries\1.0 library ?
    Regards HAns

    Hi there
    I experience some wired behavior in AS 10.1.3.4!
    I Have 2 different installation of AS 10.,1.3.4 (Win 2003 server).
    When I create an OC4J instance (using the manager) at virtual server 1 I got 28 global libraries
    When I create an OC4J instance (using the manager) at virtual server 2 I got 30 global libraries, (+ apache.webservices & oracle.ifs.client )
    Why this difference ?
    And how to control it?
    Note the default instance "Home" has 28 libraries on both servers!!
    Why is it sometime possible possible to use <instance>applib for the jar, and sometime I need to create an <instance>\shared-lib\global.libraries\1.0 library ?
    Regards HAns

  • How to create the pricing procedure for domestic & import.

    HI,
        Pls any body let me know how to create the pricing procedure for domestic & import.
    what is the use of the keys
    step condiiton condition type from   to  manual required statistic   subtotal requirement caltype basetype.
    how system will work based on this.

    Hi,
    Please see below WIKI for your reference:
    http://wiki.sdn.sap.com/wiki/display/ERPLO/16FieldsDescriptioninPricing+Procedure
    Regards,
    Ninad Kshirsagar

  • How to spool for a file inside a procedure

    Hi,
    I have a Procedure. Now that procedure writes some values into a file in /tmp directory (in Unix). Now there is a server program that reads this file does some manipulations and writest the output to a particular fiel(this file not the same as input file) in the same directory. My PL/SQL code or procedure has to keep looking for this file (output file generated by server program). How can I spool for a file in PL/SQL? Is it possible? Could you please put some light on this as of how to do it?
    Thanks in advance

    Hi,
    I didnt get any exact way of spooling for the file. I tried to do this program for reading lines from a file using GET_LINE
    create or replace procedure film as
    log varchar2(300);
    logfile UTL_FILE.FILE_TYPE;
    begin
    log := 'check_log';
    logfile := utl_file.fopen('/tmp','check_log','R');
    utl_file.get_line(logfile,log);
    utl_file.fclose(logfile);
    end;
    show errors;
    It gives me this error.BEGIN film; END;
    ERROR at line 1:
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "SYS.UTL_FILE", line 101
    ORA-06512: at "SYS.UTL_FILE", line 157
    ORA-06512: at "DACSCAN.FILM", line 6
    ORA-06512: at line 1
    Could you please tell me where I am going wrong.
    Thanks in advance

  • How to create report using Procedure.

    Hi All,
    I want to create report in apex.But i do not have sql code.I have one procedure.Is it possible to create report using this procedure in apex.
    CREATE OR REPLACE PROCEDURE headcsv_prc2
    AS
       CURSOR cr_header
       IS
          SELECT ood.organization_code, fm.formula_no AS "FORMULA_NAME",
                   fm.formula_vers AS "FORMULA_VERSION",
                   fm.formula_desc1 AS "FORMULA_DESC",
                   DECODE (fm.formula_status,
                           100, 'New',
                           400, 'Approve for Laboratory Use',
                           700, 'Approve for General',
                           800, 'On Hold',
                           900, 'Frozen',
                           1000, 'Obsolete/Archived'
                          ) AS "FORMULA_STATUS",
                   DECODE (fd.line_type, '1', msib.segment1) product,
                   DECODE (fd.line_type, '-1', msib.segment1) ingrediant,
                   DECODE (fd.line_type, '2', msib.segment1) AS "BY_PRODUCT",
                   DECODE (by_product_type,
                           'W', 'Waste',
                           'R', 'Rework',
                           'Y', 'Yield',
                           'S', 'Sample',
                           NULL
                          ) AS "BY_PRODUCT_TYPE"
              FROM org_organization_definitions ood,
                   fm_form_mst fm,
                   fm_matl_dtl fd,
                   mtl_system_items_b msib
             WHERE ood.organization_id = fm.owner_organization_id
               AND fm.owner_organization_id = msib.organization_id
               AND msib.organization_id = fd.organization_id
               AND fd.organization_id = ood.organization_id
               AND fm.formula_id = fd.formula_id
               AND msib.inventory_item_id = fd.inventory_item_id
               -- and fm.FORMULA_NO like'%TEA%'
               AND fd.line_type IN ('1', '2', '-1')
          GROUP BY ood.organization_code,
                   fm.formula_no,
                   fm.formula_vers,
                   fm.formula_desc1,
                   fm.formula_status,
                   fd.line_type,
                   msib.segment1,
                   by_product_type
          ORDER BY fm.formula_no, fm.formula_vers;
    BEGIN
       DBMS_OUTPUT.put_line (   INITCAP ('ORGANIZATION CODE')
                             || ','
                             || INITCAP ('FORMULA NAME')
                             || ','
                             || INITCAP ('FORMULA VERSION')
                             || ','
                             || INITCAP ('FORMULA DESC')
                             || ','
                             || INITCAP ('FORMULA STATUS')
                             || ','
                             || INITCAP ('PRODUCT')
                             || ','
                             || INITCAP ('INGREDIANT')
                             || ','
                             || INITCAP ('BY PRODUCT')
                             || ','
                             || INITCAP ('BY PRODUCT TYPE')
       FOR ch IN cr_header
       LOOP
          DBMS_OUTPUT.put_line (   ch.organization_code
                                || ','
                                || ch.formula_name
                                || ','
                                || ch.formula_version
                                || ','
                                || '"'
                                || ch.formula_desc
                                || '"'
                                || ','
                                || ch.formula_status
                                || ','
                                || ch.product
                                || ','
                                || ch.ingrediant
                                || ','
                                || ch.by_product
                                || ','
                                || ch.by_product_type
       END LOOP;
    EXCEPTION
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.put_line ('Error No: ' || SQLCODE || 'Error Msg: '
                                || SQLERRM
    END;
    EXEC HeadCSV_Prc2
    Thanks,
    Raghu

    RaghuVarma wrote:
    I created one report using sql code.(Ex: select * from emp).
    But my higher authorities want that for security purpose They will change the code into java.
    What "higher authorities"? What "security purpose"?
    In this process they changed my code as a procedure.Finally they give that java code.they tell to me please fix in apex.
    Do these "higher authorities" know anything about APEX? What does the Java code actually do? Have you asked them how their approach is to be integrated into APEX?
    There is no reason why a properly written Java stored program cannot be used in APEX, provided that whatever it is doing makes sense in an APEX/web context, and isn't some nonsense like using DBMS_OUTPUT to generate a CSV.
    I tried so many ways.But it is not fixed.Different Different errors will occurs.
    Tried what? Demonstrate what you have tried, preferably using examples on apex.oracle.com.
    How to solve this.
    How to solve what? No clearly defined problem or requirement has been identified.
    Describe the the problem/requirement (not your attempted solutions) in detail.
    How to ask questions
    Re: 2. How do I ask a question on the forums?
    Include as much relevant information with your question as possible, starting with:
    APEX version
    DB version, edition and host OS
    Web server architecture (EPG, OHS or APEX listener), platform, and host OS
    Browser(s)/version(s) used
    Theme
    Templates
    Region type(s)

  • How to create a stored procedure and use it in Crystal reports

    Hi All,
    Can anyone explain me how to create a stored procedure and use that stored procedure in Crystal reports. As I have few doubts in this process, It would be great if you can explain me with a small stored proc example.
    Thanks in advance.

    If you are using MSSQL SERVER then try creating a stored procedure like this
    create proc Name
    select * from Table
    by executing this in sql query analyzer will create a stored procedure that returns all the data from Table
    here is the syntax to create SP
    Syntax
    CREATE PROC [ EDURE ] procedure_name [ ; number ]
        [ { @parameter data_type }
            [ VARYING ] [ = default ] [ OUTPUT ]
        ] [ ,...n ]
    [ WITH
        { RECOMPILE | ENCRYPTION | RECOMPILE , ENCRYPTION } ]
    [ FOR REPLICATION ]
    AS sql_statement [ ...n ]
    Now Create new report and create new connection to your database and select stored procedure and add it to the report that shows all the columns and you can place the required fields in the report and refresh the report.
    Regards,
    Raghavendra
    Edited by: Raghavendra Gadhamsetty on Jun 11, 2009 1:45 AM

  • How to call the url page inside the procedure.

    Hi,
    I am not exposure in plsql.
    I am getting some problem in utl_http link.
    I create a one procedure. The procedure was successfully compiled. But the url page doesnt open..
    I attached the procedure,
    create or replace procedure p(mob number)
    IS
    l_page long;
    l_url varchar2(25000 char) ;
    begin
    null;
    l_page := utl_http.request( 'http://www.yahoo.com');
    end;
    please tell me the solution for this problem..
    I am waiting for ur response.
    Thanks,
    Sasi.

    this is a duplicate thread:
    how to open the web page in pl/sql
    the OP doesn't seem to understand the difference between a web browser and a programming language....... I can't say I've ever had to explain the difference before...
    let's just say.... butterflies are not in any way similar to electric shavers..

  • How can i create a native procedure??

    Hi all,
    How can i create a native procedure in Oracle 8.1.7???
    P.S.: Without using OCI.
    thanx.

    Log into shared services, expand User Directories > Native Directory > Right click users and select "New"
    Cheers
    John
    http://john-goodwin.blogspot.com/

Maybe you are looking for

  • Playing .pps file using  QT PRO

    I'm new with mac. I've received a PowerPoint slideshow file with sound. Try Keynote. Slides fine, but not sound. Using a PowerPoint trial version I was able to find out that there's a wav file embedded in one of the slides. So I saved as QT format fi

  • Does lifeproof nuud work with 5s?

    I'm wondering if anyone is using the Lifeproof Nuud for iPhone 5 on the new 5s and if so how well does it work?  Are you able to easily swipe up Control Center? Does the camera work well?

  • PLease Help! WMV issues

    Hello, When I Get Media and bring in a WMV file to any preset, the top half of the video file is black and the bottom half is fine. Working in PE7. Any ideas why this is suddenly happening? Thanks, Stan

  • Runnable interface declaration

    Hello, Although the function run() is inside the public interface Runnable. its once again declared as abstract. Can i get to know the reason for this ? Thanks in advance.

  • Sql Count Help

    Hi Everyone, I need to display SPER_STATUS_TEXT count as 0 if there is no data for below Query. Could someone please help me SQL> SELECT a.sper_status_text, COUNT ( * ) 2 FROM (SELECT sper.assettxt, 3 CASE 4 WHEN sper.sper_status_text = 'Affirmed Eva