Creating a job for a procedure with an input parameter

Hi,
I want to create a job for a procedure ( sp_proc ) with a input parameter.
The input parameter is a date value.
As per the syntax for dbms_job.submit procedure;
dbms_job.submit (
job IN BINARY_INTEGER,
what IN VARCHAR2,
next_date IN DATE,
interval IN VARCHAR2 DEFAULT 'NULL',
no_parse IN BOOLEAN DEFAULT FALSE);
How should the procedure be declared in the 'what' parameter of the dbms_job.submit procedure ?
Please guide.
Thanks.

Hi,
You are wright, I have found this thread [DBMS_JOB -- how to pass parameters to the job|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:351033761220].
Regards,

Similar Messages

  • Create wip jobs for same item with different routings.

    My scenario is , i am having 2 production lines for the same End item. If both lines are available to use, then WIP jobs have to be created for both lines. If either one is available then WIP job has to be created only for that line. Please suggest the setups for this. This way i can increase the production rate.

    HI Jey-2013,
    In your organization, you first need to define Bills and Routings for the item/items.  Now to use two routings for 1 item, you need to define Alternate Routing.
    For that go to BOM>Setup> Alternates and create an Alternate name for the second routing.
    Then Go again to BOM>routing and use the Alternate name for the item to create a different Routing. After that you will have two different routings for same item.
    Whenever you create a job in WIP, you will have an option to choose either the default or the original routing. This way you can accomplish your goal of using different routings as and when required. Hope this helps you. Kindly let me know
    Regards,
    Bhargav

  • Handle invalid_number exception for a procedure with numeric in paramete

    I have a procedure that takes an input parameter as number(numeric datatype) how can i handle an invalid_number exception (-01722) to display a message when a user tries entering non-numeric input
    the procedure is shown below..
    create or replace procedure orders(custid_in IN number) is
    cursor order_cur is
    select order_id, order_date, total
    from product_order
    where customer_id = to_number(custid_in);
    order_row order_cur%rowtype; -- declare cursor variable
    err_msg varchar2(512);
    BEGIN
    dbms_output.put_line('Order Details for customer with customer id '||custid_in|| ' is shown below: ');
    dbms_output.put_line((chr(9)));
    open order_cur;
    LOOP
    fetch order_cur into order_row;
    exit when order_cur%notfound ;
    dbms_output.put_line('Order ID: '||order_row.order_id);
    dbms_output.put_line('Order Date: '||order_row.order_date);
    dbms_output.put_line('Total: '||order_row.total);
    dbms_output.put_line((chr(9)));
    END LOOP;
    close order_cur;
    EXCEPTION
    when invalid_number then
    dbms_output.put_line('Customer ID not correct. Try again! ');
    dbms_output.put_line((chr(9)));
    WHEN others THEN
    err_msg := sqlerrm;
    dbms_output.put_line('The following error occured: ');
    dbms_output.put_line(err_msg);
    END;

    My first recommendation is to remove the type conversion from your cursor:
    cursor order_cur is
    select order_id, order_date, total
    from product_order
    where customer_id = to_number(custid_in);making itcursor order_cur is
    select order_id, order_date, total
    from product_order
    where customer_id = custid_in;because you are already passing it into your stored procedure as parameter of type number.
    Then if you really want to check for the invalid number exception you will probably need to do it from where ever you are calling the procedure from since it's going to occur at the time it's called rather than once you are inside the procedure.
    And finally, remove your final exception handler (the WHEN OTHERS exception) it serves no useful purpose and is in point of fact detrimental to your code in that it may improperly handle unexpected errors and allow processing to continue when it should not.

  • Calling PLSQL Procedure with CLOB input parameter from JDBC

    Hi..
    I've got a PLSQL procedure with a CLOB object as input parameter:
    function saveProject (xmldoc CLOB) RETURN varchar IS
    I want to call that procedure from my JDBC Application as...
    String data = "..."
    CallableStatement proc = conn.prepareCall
              ("begin ? := saveProject (?); end;");
    neither
    proc.setCharacterStream(2, new StringReader(data, data.length());
    nor
    proc.setString(2, data);
    will work.
    The Application throws java.sql.Exception: ... PLS-00306 wrong
    number or types of arguments in call 'SAVEPROJECT'
    How can I use set setClob method?
    The Problem is: with Oracles CLOB implementation I can't create
    an Instance, and from the CallableStatement a can't get a
    Locator for a CLOB-Object.
    This CLOB stuff makes me really nuts!
    please somebody help me.. thanks
    Alex

    Hi All,
    You can not make it like that.
    You can not make clob as input parameter.
    Do you want an easy way?
    This is the easy way.
    sample:
    function myFunction(S varchar2(40))
    return integer as
    begin
    insert into TableAAA values(S)
    --TableAAA only contains 1 column of clob type
    end;
    This will work the problem with this is the parameter is in
    varchar2 right? so there will be limited length for it.
    You can do this to call that function:
    nyFunction('My String that will be input into clob field');
    There's another slight difficult way, I understand that you have
    installed Oracle client/server in your system, try to look at
    jdbc folder and try to find demo.zip in that folder, you can
    find several ways of doing thing with jdbc.
    Have a nice day,
    Evan

  • Creating a Job for publication in Sql Server with select statement for passing a parameter

    I am creating a job for adding article to a publication.  the second step (e.g. for adding article) gives me error. I pass the name of the table as follow:
         EXEC sp_addarticle
               @publication = 'TTB', --THE NAME OF MY PUBLICATION
               'select top (1)' @article = 'Name from TableAdded Order by create_date Desc',
               'select top (1)' @source_object = 'Name from TableAdded Order by create_date Desc',
                @force_invalidate_snapshot = 1;
    TableAdded is a table I have in my publisher which contains the name of the newly added table.
    I believe it fails because the way I pass the name of the article to the store procedure is not correct. Can anyone please help me on that?
    Kind regards
    Amin

    Yes, the way you add article is wrong.
    you may try the below and let us know if you have any issues:
    while loop begin (Get the values from TableAdded with status IsAdded=0)
              Assign the values to variables like @article = Select top 1 Name from TableAdded where IsAdded=0
              Call the sp_addarticle assigning the variable
              update the Isadded flag in tableAdded for the name to 1 
     end while 
    BTB, Article configuration is supposed to be a one time configuration. Having said, you can easily configure through API. Caution, not sure what are you trying here, for adding new article, you may need to synch the data first in the above approach and should
    carried out in the downtime.

  • How to create a job for proces chain

    Hi All,
    I have a process chain that gets a trigger (.txt Trigger file) in AL11 inbound foulder.....
    we will check for the same trigger in AL11...if it is available..we will trigger the chain using sm64 ...
    now, i want to create a job for the same and schedule it automatically everyday.....
    Any help will be appreciated....

    Dear Sam2027,
    you can set a "recurrence" within the schedule options where you can decide not only the day but also the time.
    The recurrence can also be use in conjunction with your trigger .txt (which I believe it's a file event): in this case both of them need to be satisfied in order for your schedule to run.
    I hope this will help.
    Regards,
    Samanta

  • I want to create home page for my application with short URL

    I want to create home page for my application with short URL
    as when I want user to use my application user must go to URL like this
    http://127.0.0.1:7101/My-Project/faces/app/empModule/allEmployees/viewMyEmployees.jspxI want the user to use short URL , How can I use shorter URL not all this one.
    I want shorter URL for my application not to write full path .
    thanks in advance.
    Edited by: user611775 on Oct 31, 2010 10:21 PM

    Well,
    it's up to you. The first part (Mcit-Project-ViewController-context-root) is the context root which you define in the view controller project. 'faces' is the name the servlet filter reacts on. You can't omit it but shorten it in web.xml. The rest is your directory structure. I'm not sure how to shorten this other as to move the jspx files back into the web root folder.
    By the way an ADF faces app never uses the .jspx at the end of the url. If you specify '.jspx', you only render the page but don't start the work flow.
    Timo

  • BAPI For Create Goods Issue for Sales order with picked quantity

    Hi friends,
            Is there any BAPI available to create Goods issue For sales order with picked quantity...............?
    we hv used BAPI_OUTB_DELIVERY_CREATE_SLS
    with sales order .......its creating delivery order but not doing goods issue with piked quantity........

    pls,reply its argent

  • How to deactivate *Schedule Background Job for Work Items with Errors* SWU3

    Hello Guys,
    Can any one tell me how do I DEACTIVATE Schedule Background Job for Work Items with Errors in sap workflow SWU3.
    Currently it is green which I don't want. I want to stop this service.
    Regards
    NK

    Hello,
    You could also just stop the job in tx SM37.
    But why would you want to do this? As a test?
    regards
    Rick Bakker
    hanabi technology

  • How to create a record for table PLAF with order type 'NB'.

    How to create a record for table PLAF with order type 'NB'(standard purchase order).
    who can tell me the T-code or some usefull information?
    Thanks.

    Hi
    This will be updated automatically when generate planned orders thru MRP. (MD02)
    regards
    Srinivas

  • How to create Background job for Dialog program

    Hi Experts,
    I have copied Standard tcode to Z-tcode (CS12 tcode).
    Now my requirement is to create background job for this program (but program is not a 'E' type its 'I').
    How we can schedule Dialog program to Background.
    Pls suggest me.
    Regards
    SK

    Hi do as below :
    Reefer below :
    Bakcground Job Creation
    You will have to submit your report using Submit statement ,
    then inside the submitted report write open_job.
    Regards,
    Uma

  • Create a value for Decision table with gc_option_not_initial.

    Dear Expert,
    I am filling in a decision table with coding. I load an excel file, create a range for eatch value with the folling method:
       cl_fdt_convenience=>create_simple_range( EXPORTING iv_application_id = lv_application_id
                                                                                  iv_option = if_fdt_range=>gc_option_equal
                                                                                  iv_test_parameter = lv_id
                                                                                  iv_low = lv_value
                                                                                  iv_activate = abap_false
                                                                        IMPORTING ev_range_id = ls_table_data-expression_id ).
                INSERT ls_table_data INTO TABLE lts_table_data.
                CLEAR  ls_table_data-expression_id.
    But the following code is not working:
       cl_fdt_convenience=>create_simple_range( EXPORTING iv_application_id = lv_application_id
                                                                                  iv_option = if_fdt_range=>gc_option_not_initial
                                                                                  iv_test_parameter = lv_id
                                                                                  iv_activate = abap_false
                                                                        IMPORTING ev_range_id = ls_table_data-expression_id ).
                INSERT ls_table_data INTO TABLE lts_table_data.
                CLEAR  ls_table_data-expression_id.
    What is wrong?
    How to create than a range for a decision table cell with option: 'not initial'?
    Thank you very much in advance?
    Best regards
    Ahmed

    I found the same problem in the comments of this post Filtering Rules using SAP HANA Decision Table.
    A possible solution is to implement a solution directly in SQLScript. Hints can be found in Filtering Rules using SAP HANA Decision Table

  • How to create sql query for item master with operator LIKE with variables?

    hi all,
    How to create sql query for item master with
    operator LIKE(Contains,Start With,End With) with variables using query generator in SAP B1 ?
    Jeyakanthan

    Hi Jeyakanthan,
    here is an example (put the like statement into the where field)
    SELECT T0.CardCode, T0.CardName FROM OITM T0 WHERE T0.CardName Like '%%test%%'
    The %% sign is a wildcard. If you need start with write 'test%%' and otherwise ends with '%%test'. For contains you need '%%test%%'. You also could combinate this statements like 'test%%abc%%'. This means starts with test and contains abc.
    Regards Steffen

  • How to call a oracle procedure with in/out parameter frm unix shell script?

    Hi,
    I need to call an oracle stored procedure from unix script. The procedure has 1 input parameter and 2 output parameter. Please send me the syntax for the same. Based on the output values of procedure, I have to execute some more commands in unix script.
    Thanks and regards
    A

    An example :
    TEST@db102 SQL> select ename, job from emp
      2  where empno = 7902;
    ENAME      JOB
    FORD       ANALYST
    TEST@db102 SQL> create or replace procedure show_emp (
      2     v_empno in      number,
      3     v_ename out     varchar2,
      4     v_job   out     varchar2 )
      5  is
      6  begin
      7     select ename, job into v_ename, v_job
      8     from emp
      9     where empno = v_empno;
    10  end;
    TEST@db102 SQL> /
    Procedure created.
    TEST@db102 SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    [ora102 work db102]$ IN=7902
    [ora102 work db102]$ set `sqlplus -s test/test@db102 << !
    var out1 varchar2(30);
    var out2 varchar2(30);
    set pages 0
    set feed off
    exec show_emp($IN,:out1,:out2);
    print
    exit
    `[ora102 work db102]$ echo $1 $2
    FORD ANALYST
    [ora102 work db102]$                           

  • How can I write unit tests for BizTalk Maps with multipe inputs?

    I want to bring all my maps under unit test coverage, but can't seem to find a way to test maps with multiple inputs. Maps with multiple inputs are first merged into a single schema by biztalk and then the map actually uses that inline schema as source.
    What I tried is- produced a generated instance of source schema by clicking "Test Map", and then modified the skeletal instance by stitching together the multiple input files into it. There are two problems I am facing going forward that way- 1#
    It takes a lot of time to craft a mock input of inline schema and 2# the mock input fails input validation although the input works just fine in the orchestration.
    So is there a better or standard way to test such Maps?

    For testing maps with multiple inputs, follow the below steps-
    Lets assume you have a map with two input schemas A and B and output as C.
    1) To create the required schema just reverse the inputs i.e. make a map with C as input and A & B as output. Later do a test map. This will generate an XML File with schemas A & B. 
    2) Now you just to need to replace OutputMessagePart_0 to InputMessagePart_0
    and OutputMessagePart_1 to InputMessagePart_1
    Later you can use this xml for testing your original map.
    Refer the below article
    Developing and Testing Maps which have Multiple Source and Destination Schemas
    Thanks,
    Prashant
    Please mark this post accordingly if it answers your query or is helpful.

Maybe you are looking for

  • What's up with data usage on the iPad over LTE?

    I am using the new iPad. This is not my first as I have had an ipad since version 1 (at first with a VZ Mifi, though now I have the one with LTE). When I first set up this iPad i did it on a prepaid account and so I have a baseline of experience (bot

  • Ipad2 HDMI to TV

    Hi everyone, I'm having a few problems tring to hook up my Ipad2 to my Hitachi 42" LCD HDTV Everytime I try I almost get a picture but I am left with a mostly blank screen with just a flicker of a picture at the top. The same thing happens with my Wi

  • Need help on the below query or Pl-SQL

    Hello Every one, Please let me know if some one can help me out with the below scenario either in pl-sql or sql. Source Data: 0000253800     0.25          0845A     0900A 0000253800     1          0900A     1000A 0000253800     1          1300P     1

  • How to fix paper feed problem after jam? Paper feeds out diagonally at page bottom. hp deskjet 920c

    I have a HP Deskjet 920c printer. One sheet jammed in it, which I pulled out.  After that, it prints fine for the first 3/4 of the page, then the feed direction changes and the paper (and thus the printing) comes out diagonally. I have Windows Vista.

  • Heterogenous Connection is Not Established

    HI! _1_. I am connecting Oracle with mysql using heterogenous services a. I made mysql ODBC connection b. Configured hs init file. c. configured listener.ora d. configured tnsnames.ora e. created link in sql*Plus _2_. But when i select table from mys