How to pass variables from cursor to a job

Hello

begin
for cur_1 in (select  tab1.c1  c1 from  tab1)
loop 
dbms_scheduler.create_job(......
..........
job_type =>plsql_block,
job_action => 'declare verrm varchar2(100); '||
                       ' begin   for cur_2 in (select col1,col2 from tab2)'||
                         'loop prc( cur_1. c1,cur2.col1,cur.col2  ); end loop;  end;' ,----- gettin gerror undeclared identifier cur_1.c1
........)               
end loop;

user8731258 wrote:

When reading about dbms_parallel, I have seen examples where the task is running an sql statement.
Now, can we run a pl sql also block?

Why would you run a PL/SQL block in parallel?

Yes, the DBMS_PARALLEL_EXECUTE. Run_Task() sql_stmt parameter can accept an anonymous PL/SQL block as statement. For example

--// example of passing a PL/SQL anon block as statement
declare
  ..
begin
        ..code..

        parallelSql := 'declare
                                t1      timestamp;
                        begin
                                t1 := SysTimestamp;
                                update foo_tab set obj_type = lower(obj_type)
                                where rowid between :start_id and :end_id;
                                ProcessLog( fromTime=>t1, toTime=>SysTimestamp, rowsProcessed=>SQL%RowCount );
                        end;';

        DBMS_PARALLEL_EXECUTE.Run_Task(
                task_name => taskName,
                sql_stmt => parallelSql,
                language_flag => DBMS_SQL.NATIVE,
                parallel_level => 5
        );

        ..code..
end;

However, if you want code PL/SQL real multithreaded (no SQL), then that can be done using a parallel pipeline table function (PL/SQL function).

So, I'll go for dbms_Scheduler thing. But still when I'm stuck on how to pass the value of date to work...

In the example I posted using DBMS_JOB - cursor loop identifies the days of treatment. The loop then call ScheduleJob() to schedule a task of process to date. This procedure should look something like the following:

// schedules a job to run procedure ProcessDailyInvoices for the specified day
create or replace procedure ScheduleJob( day date ) is
        jid             number;
        dateParam       varchar2(100) default 'to_date(''$DATE'',''$FORMAT'')';
        plsqlBlock      varchar2(1000);
begin
        dateParam := replace( dateParam, '$DATE', to_char(day,'yyyy/mm/dd') );
        dateParam := replace( dateParam, '$FORMAT', 'yyyy/mm/dd' );
        plsqlBlock := 'begin ProcessDailyInvoices( day=>'||dateParam||' ); end;';

        DBMS_JOB.Submit(
                job => jid,
                next_date => sysdate,
                what => plsqlBlock
        );
end;

Tags: Database

Similar Questions

  • How to pass Variables from the Source (SQL) to tab target (JavaBin Shell) in ODI knowledge Modules

    Hi all

    My name is Alessandro and I am new to the community.

    I have a problem with the KM stage custom when I try to pass the variable from the source to the target.

    The ODI version tha I use is the 11.1.1.5.0.

    I created a stage KM following the instructions of the metalink document (Doc ID 728636.1).

    But when I insert the value of the variable in a test table, the value in a table is the name of the variable.

    Where I'm wrong?

    I am doing thi.

    (1) create a step in my goal of shell sql source and javabin KM. In the source tab I get the value of a query, and the name "LAST_UPDATE" column.

    In the target tab, I attribute to the variabile jv_last_update the value of the variable #LAST_UPDATE, with the same name in the selection column.

    source_tab.jpgtarget_tab.jpg

    (2) I created a second stage where I insert into a table of the value of the variable jv_last_update (to debug the value of the variable):

    insert_step.jpg

    (3) when I try to see what I have in the table, the value of any line is the name of the variable "#LAST_UPDATE"; ".

    result_table.jpg

    Thanks in advance


    Alessandro

    Hi Alessandro,.

    Interesting... I have not read the Oracle document you sent yet, but one thing I can guarantee you, is that it doesn't. If Oracle says that it should work, maybe it's a bug, or maybe he has changed on new versions of ODI. I am also on ODI 11.1.1.5 and I tried many different ways to pass SQL results to variables of java with all sorts of different labels, but none of them worked for me as well. But I managed to use it in a different way, so please see below if it matches your needs:

    We are just one step. The second is just to show that it worked:

    In the first step, on the source tab, select Oracle and point to the logical schema that you want to run the query:

    On the target, note the following Java BeanShell code with the SQL that you want to run:

    Now your variable must have the correct value of your SQL. To test it, I just write a comment 'Raise' to Jython in the second step:

    The result is 'X' as expected:

    It will be useful.

    Thank you!

  • How to pass variable from bean to resourceID for the document map?

    Hello experts, I have added WebCenter workflow Microsoft document explore task in my ADF which as a parameter called resourceId.   I want to pass variable bean to this setting, because the content ID (doc name or ID) are determined dynamically.

    When I provide ${"UCM57Server #dDocName:1379596941565_CONTACT_OPTREGI"} as a resource in the expression ID, it works very well.    But samething if I attribute to a bean bean variable and entitlement in the form ${sessionScope.MyBean.docName}, it evaluates the variable bean in the form ${"UCM57Server #dDocName:1379596941565_CONTACT_OPTREGI"} and then below throws the exception:

    [2013-10 - T 02, 14: 34:50.369 - 04:00] [DefaultServer] [WARNING] [WCS-07219] [oracle.webcenter.doclib.internal.view.backing.ContentProvider] [tid: [ASSETS].] [ExecuteThread: '10' for the queue: "(self-adjusting) weblogic.kernel.Default"] [username: anonymous] [ecid: d50192415c689920:-7d97126c:1417a5d6a49: - 8000 - 000000000000008 a, 0] [APP: CreateContactWSProxy] invalid parameter combination: the login name specified by resourceId = ${"UCM57Server #dDocName:1379596941565_CONTACT_OPTREGI"} is not specified in the parameter connectionName = UCM57Server.

    Variable bean is defined as:

    private String Nomdoc = "${" UCM57Server #dDocName:1379596941565_CONTACT_OPTREGI "} ;

    Please give me some advice on how to pass the value to resourceId dynamically via the variable of bean.

    Thank you.

    private String Nomdoc = "UCM57Server #dDocName:1379596941565_CONTACT_OPTREGI";

    Without $ {}

  • How to pass variables in different QML

    hand code. QML:

    import bb.cascades 1.2
    TabbedPane {}
    ID: tabnav
    property string book_path;

    .........

    onTriggered: {}
    clearSelection();
    Select (row);
    var point = dataModel.data (row);
    If {(point)
    book_path = maincfg.bookpath + item.text;  (, book_path'm happy Get)
    var kvbookview1 = kvbookview.createObject ();
    NAV.push (kvbookview1);
    }
    }
    }
    attachedObjects:]
    {ComponentDefinition}
    ID: kvbookview
    Source: "kv_book_view.qml".
    }
    ]

    .........

    Code of kv_book_view. QML:

    import bb.cascades 1.2
    {Page}
    ID: Discovers;

    .........
    onCreationCompleted: {}
    Text3. Text =?     (how to get variables from book_path to main.qml)
    }

    Thank you

    Simon has given you the solution:

    import bb.cascades 1.2
    Page {
        id: view;
        .........
        onCreationCompleted: {
            text3.text = tabnav.book_path
        }
    
  • How to pass variable frame 1 throughout a swf file?

    Hi guys,.

    How to pass variable frame 1 throughout a swf file? -Including executives more later and their children?

    Thanks in advance

    Mike

    I'm not sure what you mean by variable pass in a swf, but to make it available throughout the timeline you place in a layer that extends along the timeline.

  • How to pass variables by using the command line when starting from a native application ActionScript

    How to pass in variables or arguments to start using the command line when starting a native ActionScript application? For example, I have my app MySweetWidget call and it was compiled with Adobe AIR runtime in captivity so now I have MySweetWidget.exe.

    In the command line, I call MySweetWidget.exe and would like to pass in variables or properties of the application. I guess that these variables are read from the loaderInfo.parameters object.

    Please let me know if the Adobe AIR runtime supports passing the parameters to native execution. If so, I would like to help determine the correct format of how pass variables. So would you want to read those loaderinfo.parameters object?

    Thank you

    Jeff

    I found the answer to my own question:

    Yes, it's a feature supported. It is documented on the following page:

    http://help.Adobe.com/en_US/FlashPlatform/reference/ActionScript/3/Flash/desktop/NativeApp lication.html #event:invoke

    When you subscribe to the event from the NativeApplication invoke it will subsequently send the event and you read the table of e.arguments object to get the start in the native application arguments.

  • Passing variables from flash to php script - does not!

    Hey everybody. I was wondering if someone could help me. I use as2 to pass a variable from flash to my php and nothing happened! Here's the action script code that I put on my button:

    (release)

    {

    Amount.Text = 5;

    Form1 = new LoadVars();

    Form1.amount = amount.text;

    form1.sendAndLoad ("http://mywebpage.com/test.php", rise, "POST" ');

    }

    The amount of '5' is now in a dynamic text field with the variable name and instance of amount (which, in the future, will be hidden). This works very well when the button is clicked. What I'm trying to do without success, is to get this value of '5' to my test.php and did echo and it happens simply not . It comes to my php script:

    <? PHP

    $form_inp = $_POST ["amount"];

    If ($form_inp == "'")

    {

    Print "nothing entered < br >".

    }

    on the other

    {

    Print "you entered: $form_inp";

    }

    ? >

    I'm getting "Nothing entered" every time.

    I've tried different ways for the amount.text such as:

    (release)

    {

    Amount.Text = 5;

    Form1 = new LoadVars();

    Form1.amount = this. Amount.Text;

    form1.sendAndLoad ("http://mywebpage.com/test.php", rise, "POST" ');

    }

    and

    (release)

    {

    Amount.Text = 5;

    Form1 = new LoadVars();

    Form1.amount = this ._parent. Amount.Text;

    form1.sendAndLoad ("http://mywebpage.com/test.php", rise, "POST" ');

    }

    etc...

    I also tried to change the variable name in the function sendAndLoad amount to form1 as follows:

    (release)

    {

    Amount.Text = 5;

    Form1 = new LoadVars();

    Form1.amount = amount.text;

    form1.sendAndLoad ("http://mywebpage.com/test.php",form1, "POST");

    }

    and still nothing.

    In my php file, I even tried the GET instead of the POST and it always turns out nothing.

    <? PHP

    $form_inp = $_GET['monto"];

    If ($form_inp == ")

    {

    Print "nothing entered < br >".

    }

    on the other

    {

    Print "you entered: $form_inp";

    }

    ? >

    Additional info:  I put the .swf file and at the same level-.php file in the same folder on my server just to be safe, and the dynamic amount.text text field and button are at the same level in the .swf file.

    Anyone can shed some light on my situation... pretty please? I'm out!

    Thank you very much.

    Ok. So, do not let this thread unanswered, after a looooooong of trial and error, I went to as3 and began to do some testing. It turned out that the register_globals was off on my site and that is why I did not receive the variable passed with the $_POST in my php. So what I finally proposed is the following:

    In my fla/swf doc:

    to import flash.net.URLVariables;

    import flash.net.URLRequest;

    import flash.net.sendToURL;

    var urlVariables:URLVariables = new URLVariables;

    urlVariables.amount = "5";

    var urlRequest:URLRequest = new URLRequest ("http://mirador.mx/oaxaca/disco/receive_test.php");

    urlRequest.data = urlVariables;

    sendToURL (urlRequest);

    In my php file:

    $amount = $_GET ["amount"];

    echo "' AMOUNT IS:". " $amount;

    Now for all of you who have been following this thread, or which can be read in the future, I know that we we started with AS2 and finishing here with AS3 but I didn't know why it worked until I I'm so fed up I've changed in AS3 to see if I could understand. I, like many others I guess, felt a bit intimidated with AS3 and was unwilling to give it a try, but I highly recommend that you dive into it because once get you a grip on it is much more functional.

    So I m going to mark this thread as a response and hope it saves someone else all the time and the frustration that he made me... Good programming!


  • How to pass variables to the basket to your fund information?

    Here's what I have to do.

    I have a site that sells the same products to several groups of people.

    When a customer enters our site that they need to choose what 'group', they belong to.

    Based on this selection of some of the images, text and links on the pages are customizable (I can do this without problems using a combination of passing parameters through the URL, and writing based on cookies).

    My problem is when I get the extraction are the cookies that I wrote do not give because the url changes to the worldsecuresystems.com.

    I tried everything I can think of to try to get the information stored in the basket page to transfer to the payment page.

    I basically need to spend the 2 pieces of data based on {{globals.cookie.creditunion}} and {{globals.cookie.group}} in the cart at checkout it is added to the CMS or order somewhere.

    I hope that makes sense.

    James

    Hi James,

    Just like Mihai said, pass variables by using the url in the payment button.

    Use the liquid version to create a payment button, here is an example:

    Checkout

    Afterwards, you should be able to go to globals.get.creditunion or globals.get.group

    Good luck

    Stoiky

  • Problem passing variable from PHP to Flash

    I'm moving a single variable from PHP to Flash. However, I can't quite make it work.

    In a PHP file named data.php, I use:
    "$query = SELECT SUM (Debt) As Total OF THE debtclock;
    $result = mysql_query ($query);
    $debt = mysql_result ($result, "Total");
    Print "debttotal = $debt";

    In Flash 8 Actionscript, I use:
    loadVariables("data.php","0");

    If I understand correctly, this should make the variable available in Flash debttotal.

    Can someone tell me where I'm wrong?

    Try this:
    loadVariables ("data.php", _level0);
    The 2nd parameter specifies the target that receives variables, '0' is not a valid value for this. With _level0, variables will be found in the root timeline, so you can access it with _root.debttotal (from _level0) or _level0.debttotal (on a different level than _level0).

    Welcome,
    blemmo

  • Pass Variables from JavaScript CS3 ActionScript

    Hello

    I can't understand what I'm doing wrong and I need help . Who better to ask than legal experts?

    I have everything works fine so far except for this actionscript. I use CS3 Flash with ActionScript, CS3.

    I have 5 buttons in flash.
    I try to perform the following tasks
    1. ensure buttons with effects in flash - done
    2 put the button in the down position based on the Web page that the user is on.
    To perform this dynamic, I apparently have to use 3 different languages, PHP, JavaScript, ActionScript.

    I've been playing with this during a week and can not understand. I have the rest of the scripts tested and verified to work.

    Here is the link to my test page
    http://www.spectacularstuff.com/PHP-test/inProgress/php-URL-detection.php

    Here is my code for the test. (This does not include the buttons. It is simply to test to see if I'm passing variable.)

    PHP code to detect the file name.
    <? PHP
    function curPageName() {}
    Return substr ($_SERVER ["SCRIPT_NAME"], strrpos($_SERVER["SCRIPT_NAME"],"/") + 1);
    }
    ECHO "is the current name of the page detected by PHP". curPageName();
    ? >

    The JavaScript Code to pass variables to the Flash
    < script language = "javascript" src = "swfobject.js" >
    var so = new SWFObject ("php - url - detection.swf", "php-url-detection", "550", "400", "9", "#FFFFFF");
    so. AddVariable ("currentpage","<? php echo curPageName();? >" ")
    < /script >

    ActionScript Code to get the JavaScript Variables and display them in flash.
    Dynamically create text fields
    var tf:TextField = new TextField();
    tf.autoSize = TextFieldAutoSize.LEFT;
    TF. Border = false;
    addChild (tf);

    var tf2:TextField = new TextField();
    TF2. AutoSize = TextFieldAutoSize.LEFT;
    TF2. Border = false;
    addChild (tf2);

    Create the variable to write to the page
    var myStr2:String;

    first attempt to put the variable on the page.
    This LoaderInfo must be capitlized. An error occurs if not.
    var paramObj:Object is LoaderInfo (this.root.loaderInfo).parameters.currentpage;.

    second attempt to put the variable on the page
    var myStr:String = this.root.loaderInfo.parameters.currentpage;
    trace (paramObj);
    trace (myStr);

    If (myStr is nothing)
    {
    myStr = "Flash is not reading JavaScript variables.:(";).
    myStr2 = "";
    }
    on the other
    myStr2 = "" Flash read the JavaScript variables! :)) ' "

    TF. Text = myStr; Display the URL on the page
    TF2. Text = myStr2 //Display Flash is happy

    [- End of Code-]


    Help, please.

    Thank you in advance.

    Wayne

    I found an answer to this for someone looking for an answer. I wrote the answer in another forum:
    http://Board.flashkit.com/Board/ShowPost.php?p=3946455&postcount=31

  • How to pass a REF CURSOR from a function

    I tried to compile the following function:

    CREATE or REPLACE FUNCTION example
    RETURN REFCURSOR
    IS
    heart REFCURSOR;
    BEGIN
    OPEN FOR heart
    "SELECT x FROM table";
    RETURN cur;.
    END;

    but I get:

    PLS-00201: identifier 'REFCURSOR' must be declared.

    Can you help me in the right syntax? I never return a REF CURSOR to a function.
    Is my Version of Oracle 8.1.7

    Thank you!

    You cannot use SYS_REFCURSOR in Oracle 8i.
    The work is approximately as follows

    create or replace package my_pk as
    type my_cur is REF CURSOR;
    end my_pk;
    
    -- Now write your function
    create or replace function my_func return my_pk.my_cur
    as
    l_cur my_pk.my_cur;
    begin
    open l_cur for select * from table_name;
    return l_cur;
    end my_func;
    

    Thank you
    Andy

  • Simple task - syntax Question (how do you pass variables from one component to another component - databinding)?

    Hi all

    I'm moving some width/height/URL of a Video Player component to a Social Bookmarking component incorporate text entry field. (for people capture and share videos).

    I know that it's a simple task, but it's the end of the day and I seem to have a brain failure... What is the syntax to achieve this? Do I have to import the video player component? These widths/heights/URLs are all generated dynamically by a XML... should I be pulling the XML or reuse just variables already existing in the Video Player component?

    Here is my code...

    Video player:

    [Bindable]

    var public source: String = "";

    [Bindable]

    public var autoPlay:Boolean = false;

    [Bindable]

    public var fullScreenMode:Boolean = false;

    [Bindable]

    public var clipTag:String = '_movie;

    [Bindable]

    public var iag_code:String = "";

    [Bindable]

    public var officialURL:String = "http://www.movies.com/"; ""

    [Bindable]

    public var referer:String = 'unknown ';

    [Bindable]

    public var gID: String;

    [Bindable]

    public var starterImageURL:String = 'http://www.movies.com/jazzmaster/images/default_starter_image.

    [Bindable]

    public var oldWidth:Number;

    [Bindable]

    public var oldHeight:Number;

    Component sharing:

    < mx:HBox

    Height = "10%".

    horizontalCenter = "-25".

    Red = '0 '.

    paddingBottom = "5" >

    < mx:Text text = "" Embed Code: "paddingTop ="1"color ="#FFFFFF"fontSize ="12"/ >"

    < mx:TextInput text = "{oldWidth}" / >

    < / mx:HBox >

    The above code generates an error... "Any attempt of property inaccessible oldWidth via a reference with a static type com:SharingBookmarks."

    Thank you all!

    DK

    Try this...

    Create a flex project and add a folder called 'src '.

    create a new component MXML named "VideoComp.mxml" and copy/paste

    http://www.Adobe.com/2006/mxml"width ="400"height ="300">

    [Bindable]

    public var videoWidth:int = 300;

    [Bindable]

    public var videoHeight:int = 300;

    ]]>

    create a new component MXML named "SharingComp.mxml" add copy/paste this...

    http://www.Adobe.com/2006/mxml"width ="400"height ="300">

    [Bindable]

    public var videoWidth:int;

    [Bindable]

    public var videoHeight:int;

    ]]>

    and here's the main.mxml file

    http://www.Adobe.com/2006/mxml '.

    xmlns:src = "src.*" >

    private void doSomething (): void

    {

    sharingComp.videoHeight = videoComp.videoHeight;

    sharingComp.videoWidth = videoComp.videoWidth;

    }

    ]]>

    Hope this helps,

    BaBo,

  • How to pass variables bind to select query

    Hello
    I use jdeveloper 11.1.1.6.0 version.
    My use case is - I want to change the settings of the select clause dynamically
    For example
    My view of object query is as follows:
        SELECT FN_GET_ALFA_MESSAGE_DETAIL_SEQ(1,2) FROM DUAL
       
    where FN_GET_ALFA_MESSAGE_DETAIL_SEQ is the name of function.
    I want to pass parameters at runtime instead of 1 and 2 as a and b.
    So, how can I pass dynamic parameters (bind variables) in the display object during execution of the select clause.

    Published by: 925410 on January 7, 2013 18:25

    Hello

    You may have two bind variables (note that bind variables are always preceded by a colon in the query) as below:

    SELECT FN_GET_ALFA_MESSAGE_DETAIL_SEQ(:bind_var1,:bind_var2) FROM DUAL
    

    Then, follow the following steps:
    1. create two variables of the same names liaison in the variables section of Bind in the query tab of the VO
    2 2 disposer have a method in the class Impl of Module of the Application and within this method, pass the values of these bind variables as below:

                Impl vo = null;
                vo = get1();
                vo.setNamedWhereClauseParam("bind_var1", );
                vo.setNamedWhereClauseParam("bind_var2", );
                vo.executeQuery();
    

    3 expose this method of the the module interface of the client Application, then the method will be visible in the section data when updating controls.
    4 use the method to run the original Version of data controls you want :)

    Kind regards
    Seddik

  • How to pass variable separated by commas in the bind value of VOquery?

    Version 11.1.1.3.0
    The guys need to help you on this

    I have a VO with query somethg as below

    SELECT *.
    FROM a schema. Table-name
    WHERE (: Bind_Varible has the value null or Column_Name IN (: Bind_Varible))

    User will be be select several values of the screen and I need to pass these value above bind variable.
    But in the variable binding ADF take everything as a single string, then, how can I pass values separated by commas?

    As SELECT *.
    FROM a schema. Table-name
    WHERE (: Bind_Varible has the value null or Column_Name IN (99,55))

    Thank you
    Any help will be appreciated

    I put mine up in this way, my binding variable is a list of values separated by commas, that is to say ("A, B, C, D") (I have a select that many shuttle) then I used a regexp substr to turn them into a list

     WHERE    :Bind_Batch_NM_Comma_Sep_List IS NULL
             OR batch_nm IN
                   (    SELECT REGEXP_SUBSTR (:Bind_Batch_NM_Comma_Sep_List,
                                              '[^,]+',
                                              1,
                                              LEVEL)
                                  batch_nm
                          FROM DUAL
                    CONNECT BY LEVEL <=
                                    REGEXP_COUNT (:Bind_Batch_NM_Comma_Sep_List,
                                                  ',')
                                  + 1)
    

    Published by: pollywog on September 18, 2012 16:07

  • How to pass variables in Flex?

    I have a form that calls an HTTPService (getEmployee), and that the service uses the employeeID variable:

    < employeeID > {employeeID.text} < / employeeID >

    In another State, I have a datagrid displaying a different HTTPservice employeeID. This DataGrid, I want that the user click the ID that will pass the States and call my HTTPService getEmployee

    The only way I know to move from this datagrid is to have my "getEmployee" reference HTTPservice
    < employeeID > {dgIncumbent.selectedItem.employeeID} < / employeeID >. I can't create a different service because other grids rely on the data provider "getEmployee".

    What I need is to call the same "getEmployee" HTTPService, which accepts a value that is either "{dgIncumbent.selectedItem.employeeID}" or "{employeeID.text}".

    "braseth" wrote in message
    News:g91l46$KrF$1@forums. Macromedia.com...
    > I have a form that calls an HTTPService (getEmployee) and that the service
    > uses
    > employeeID variable:
    >
    > {employeeID.text}
    >
    > I have a datagrid in another State, that of a different HTTPservice
    > poster
    > employeeID. This DataGrid, I want the user to click on the ID which
    > will be
    > States and display my HTTPService getEmployee
    >
    > The only way I know to move from this datagrid is to have my "getEmployee".
    > Reference HTTPservice
    > {dgIncumbent.selectedItem.employeeID}. I can't
    > create a different service because the other schedules are based on the "getEmployee".
    > data
    > provider.
    >
    > What I need is to call the same "getEmployee" HTTPService, which accepts a
    > value that is either "{dgIncumbent.selectedItem.employeeID}" or
    > "{employeeID.text}".
    >

    How bout

    [Bindable]
    public var eID:Number;

    private void onDgItemClick(e:ListEvent) {}
    eID = e.currentTarget.selectedItem.employeeID;
    }

    private void onEmployeeIDChange(e:TextEvent) {}
    eID = Number (employeeID.text);
    }

    Then bind your service to the variable.

    HTH;

    Amy

Maybe you are looking for