To execute the same stored procedure multiple times

Suppose I have this :
select distinct batch_id, submit_date from batch where date > xxx;
Gives me :
301
305
306
Currently, I have a stored procedure PROC_A that has 3 cursors all of which have a field called batch_id(which ofcourse exists in the above batch table). Hence, when I run as of today
EXECUTE PROC_A;
This could process an unpredictable set of batch ids. I am looking to avoid this.
What I am trying to achieve here is :
When I do,
select distinct batch_id from batch where date > xxx;
301
305
306
For each of the above values, I want to call the PROC_A exclusively. In other words, by one shot, I want this procedure to be invoked 3 times, each time processing just one batch_id one after another (rather than passing those 3 values to the procedure and having it execute just once !). I also want to avoid using the batch table anywhere inside the stored procedure PROC_A.
How do I achieve this ? If another stored procedure can call PROC_A, I am okay with including the batch table there.

What about an executed_date field on the table and a "where rownum=1" in the cursor?
proc_a
begin
     begin
          select batch_id
          into b_id
          from batch ...
          where date > xxx
               and date > last_executed
               and rownum = 1;
     exception
          when NO_DATA_FOUND then
               return;
     end;
     exec(b_id);
     update batch
     set last_executed = sysdate
     where bacth_id = b_id;
     return;
end;Bye Alessandro

Similar Messages

  • Re: Running the same (Forte) application multiple times -for different

    Hi
    We had the same problem - how to deploy a number of identical applications, using each their own db.
    (for training).
    The solution we used is to wrap the entire application into different applications by using a very small
    module called KURSUS01, KURSUS02 etc, that did nothing but call the start procedure of the main app.
    Then in the dbsession connect, we made a call appname to get the application name, and appended the
    first 8 chars to the dbname. Thus our dbnames now points to logicals name: rdbdataKURSUS01, rdbdataKURSUS02 etc.
    All this allows us to deploy the identical apps in the same env, or change one version, and run both the old
    and new program on the same pc and server at the same time (eg. KURSUS01 and KURSUS02).
    I also think this is a kludge - but it works nicely!
    Jens Chr
    KAD/Denmark
    -----Original Message-----
    From: Haben, Dirk <[email protected]>
    To: 'Soapbox Forte Users' <[email protected]>
    Date: 15. januar 1999 09:41
    Subject: Running the same (Forte) application multiple times - for different business clients.
    Hi All
    We have a number of different business clients all willing to use our
    application.
    The (forte) application is to run on our machines etc for these (business)
    clients.
    All (business) clients will have their data kept in separate Oracle DBs
    (instance).
    The problem now is that the entire (forte) application is written using
    DBSessions.
    Now, depending on what business client needs to be serviced (so to speak) we
    need to attach to the right DB - or use the "right" SO.
    The two options we can think of are:
    Option1:
    Programatic change to somehow "know" what (business) client (DB) I'm talking
    about and then use the right DB.
    Pro:
    Only one forte environment to maintain
    Can run multiple (business) clients on same PC at the same time
    Con:
    Requires many program changes
    bending O-O rules(?)
    can't dynamically name SOs so can it be done at all? (ResourceMGRs maybe?)
    Option2:
    Use separate environments! One for each business client.
    Pro:
    More defined separation of app and data,
    SLA-easy
    Con:
    Maintain "n" number of environments
    Can only run the application for one environment (business client) at a time
    on one PC - Big Negative here!
    Not knowing any feasible solution to option 1 (without much code changes and
    developer moaning) I would go for option two; as I have already worked on
    multi-environment setups on VMS back at the Hydro (hi guys).
    I would appreciate any comments from anyone who has solved this problem.
    How, Why Pro Con etc.
    TIA,
    Dirk Haben
    Perth, WA
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi
    We had the same problem - how to deploy a number of identical applications, using each their own db.
    (for training).
    The solution we used is to wrap the entire application into different applications by using a very small
    module called KURSUS01, KURSUS02 etc, that did nothing but call the start procedure of the main app.
    Then in the dbsession connect, we made a call appname to get the application name, and appended the
    first 8 chars to the dbname. Thus our dbnames now points to logicals name: rdbdataKURSUS01, rdbdataKURSUS02 etc.
    All this allows us to deploy the identical apps in the same env, or change one version, and run both the old
    and new program on the same pc and server at the same time (eg. KURSUS01 and KURSUS02).
    I also think this is a kludge - but it works nicely!
    Jens Chr
    KAD/Denmark
    -----Original Message-----
    From: Haben, Dirk <[email protected]>
    To: 'Soapbox Forte Users' <[email protected]>
    Date: 15. januar 1999 09:41
    Subject: Running the same (Forte) application multiple times - for different business clients.
    Hi All
    We have a number of different business clients all willing to use our
    application.
    The (forte) application is to run on our machines etc for these (business)
    clients.
    All (business) clients will have their data kept in separate Oracle DBs
    (instance).
    The problem now is that the entire (forte) application is written using
    DBSessions.
    Now, depending on what business client needs to be serviced (so to speak) we
    need to attach to the right DB - or use the "right" SO.
    The two options we can think of are:
    Option1:
    Programatic change to somehow "know" what (business) client (DB) I'm talking
    about and then use the right DB.
    Pro:
    Only one forte environment to maintain
    Can run multiple (business) clients on same PC at the same time
    Con:
    Requires many program changes
    bending O-O rules(?)
    can't dynamically name SOs so can it be done at all? (ResourceMGRs maybe?)
    Option2:
    Use separate environments! One for each business client.
    Pro:
    More defined separation of app and data,
    SLA-easy
    Con:
    Maintain "n" number of environments
    Can only run the application for one environment (business client) at a time
    on one PC - Big Negative here!
    Not knowing any feasible solution to option 1 (without much code changes and
    developer moaning) I would go for option two; as I have already worked on
    multi-environment setups on VMS back at the Hydro (hi guys).
    I would appreciate any comments from anyone who has solved this problem.
    How, Why Pro Con etc.
    TIA,
    Dirk Haben
    Perth, WA
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Subreport using the same Stored Procedure

    I have a main report and a subreport that uses the same stored procedure. The stored procedure has 12 parameters and what I want to avoid is the user having to enter the same parameter values twice. When I created the subreport I put in the parameters + one field, the employee id field so that I could just test it on one employee.
    After I entered the subreport into the main report, when I got to refresh the data, it's asking for params for BOTH reports. Is there any way to get around this? Because of the way the stored procedure returns the data, I had to create a subreport instead of just fitting it into one of the footers. I've looked at the subreport link and added the employee id as the key. When I ran it the first time, it returned the wrong date range on the sub.
    Help! this thing is Way passed due!!

    Right click on the sub report and choose change sub report links
    Top left pane contains your main report parameters use > to add
    In the bottom left corner of that dialog then scroll down until you see the corresponding sub report parameter
    Repeat for each parameter
    This should then take the main report params and pass into the sub report

  • TS2755 keep receiving the same text message multiple times, at the same time of the night. How can I stop this?Thabnks

    Hi
    I keep on receiving the same text message multiple times and at around the same time each night. Any idea how I can stop this happening? The text messages are originating from to separate Saudi Arabian mobile numbers. Both these people are listed in my contacts so do you think if I delete their names it might stop the texts coming htrough each night?
    Cheers

    Deleting the people from your contacts will not stop the messages. Have you tried talking to the people and finding out if they're sending you messages? You could try contacting your carrier and finding out what blocking services they offer. However, theat would block all messages from those people.

  • Can I have the same printer installed multiple times under different names?

    On WIndows I have the same printer installed multiple times
    All using the same driver
    I have a Canon printer that has a rear tray and a bottom tray
    So, I will have one printer that prints to the rear and the other to the bottom
    Other printers (the same one) will be set so that they print in high quality and in duplex for example
    I'll name the printers 1.Canon 2.Canon 3.Canon etc
    So, when I go to print, I just hit a number on the keyboard and the printer I want is selected
    Can I do the same on my laptop?
    Thanks
    Omar

    Back Up - that's in case things go wrong.
    In the case you cite:
    You have
    Mother
    Mother Maiden Name
    as Faces, right?
    In the Corkboard view click on Mother Maiden Name and delete the 'Maiden Name'.
    It will disappear and all the photos will be in the Mother face.
    Note that 'Mother' and 'Mother ' (that is, with a trailing space) are not the same.
    You can  also just edit the name 'Mother Maiden Name' to 'Mother'
    As for photos staying in manual sort, I can only say that mine do. But as I've no idea what troubleshooting steps you've used.
    Regards
    TD

  • IPhone keeps sending the same text message multiple times in a row.

    My iphone (4s) keeps sending people the same text message multiple times (2-4) a few seconds inbetween.  Sometimes it will tell me that there the message failed, but they still recieve it multiple times.  I've already tried deleting the message tread and reset network settings.  Nobody who has an iphone has said anything to me about it yet, only people with android.  

    It's a carrier issue. I have AT&T and had this issue with my friend (who had an Android) and my mother (who had a feature phone). Both of them have Verizon for service and I'm thinking the issue was on Verizon's end. They both just dealt with it as we tried all sorts of things to get this sorted out (other than contacting Verizon directly) and had no luck.
    They've both switched to iPhones so it's a moot point for us now, at least.
    ~Lyssa

  • I have elements 8 and I want to be able to load the same picture in multiple times because

    Question - I have photoshop elements 8 and I want to be able to load the same picture in multiple times because I have 1200 pictures already pregrouped into 60 file categories and some pictures are duplicated thruout these files. How can I get elements 8 to load the duplicates  - it currently seems to default to only loading the picture one time and not allowing duplicates

    The apple lightning to 30 pin works just fine for me.
    Works with a fio amp and srs  iwow.

  • How to execute the parametered stored procedure in sql *plus ?

    how to execute the parametered stored procedure in sql *plus ?
    my storedprocedure format
    CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE
    (empDOB out date, empEmpName out varchar2)
    thanks & regards
    mk_mur

    Oh, sorry... making many reading-too-fast mistakes today...
    You can't declare date variables in SQL*Plus (seel help var), but you can cast to varchar2:
    TEST> CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE (empDOB out date, empEmpName out varchar2) IS
      2  d date := sysdate;
      3  e varchar2(10) := 'bob';
      4  begin
      5  empdob := d;
      6  empempname := e;
      7  end;
      8  /
    Procedure created.
    TEST> var d varchar2(30)
    TEST> var n varchar2(30)
    TEST> call  SMS_SELECTMPLOYEE(:d,:n);
    Call completed.
    TEST> print d n
    D
    11/07/06
    N
    bobYoann.

  • HT2486 How can you put same contact in a Group multiple times so that you can print the same mailing label multiple times?

    How can you put same contact in a Group multiple times so that you can print the same mailing label multiple times?

    Hello,
    Avery...
    https://discussions.apple.com/thread/2588943?start=0&tstart=0
    Or...
    http://www.belightsoft.com/products/labelsaddresses/overview.php

  • How can I have use the same div ID multiple times on the same page?

    Okay so a problem I encounter a lot is that often times I want to use the same div ID several times on the same page. An example of this is when I'm creating table like designs.
    Let's say for instance I create a div ID called 'product-container'. I want to use 'product-container' multiple times on the same page but if I do this it is improper XHTML and will throw errors in any XHTML validator (you are only allowed to use a div ID once on any XHTML page in order for it to be standards compliant).
    Now the first option is that I could define 'product-container' in my CSS style sheet multiple times by doing something like this...
    #product-container {
         width: 300px;
    #product-container-2 {
         width: 300px;
    #product-container-3 {
         width: 300px;
    #product-container-4 {
         width: 300px;
    What you will see there however is that it seems pointless to define the same ID numerous times over (just adding a number on the end) when each ID is the exact same thing and has the exact same attributes.
    Now what I have noticed is that there are some sites out there who manage to have the same ID appear several times in the code but add a number to it just like above. The difference is that they only have one definition for 'product-cointainer' in their CSS document but in their actual XHTML code they have IDs for 'product-container' but with numbers on the end like 2,3,4,5, etc. It's almost as if JavaScript or some other code is automatically appending a number on the end of the ID so the validator won't consider the markup to be invalid, but yet it knows that it's using the same 'product-container' style that is contained in the CSS style sheet.
    I hope I explained this correctly. I'm just hoping to find a way that I can put the same div ID on a page multiple times without having to define it over and over again in my CSS.
    Any help is much appreciated!

    Because it seems like by using a class you can't make this position as 
    well as you can by using an ID. Am I wrong?
    An ID name can be used only one time per page.  A class name can be used multiple times per page.
    .product {
    width: 300px;
    text-align:left;
    color: #FF0000
    border: 2px solid #666;
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • Calling stored procedure multiple times in the JDBC receiver

    Hi,
    I am calling the stored procedure(SP) to update a DB table in the JDBC receiver.
    SP has 10 input parameters, and SP can receive one value for each parameter at a time.
    In my case, i will have multiple rows to insert using SP.i.e multiple values for each parameter.
    Its working correctly for a single value for each parameter, but when i have multiple values i want to call the SP multiples times.
    Is this possible and how?
    Thanks,
    Varghese.

    Varghese,
    I think you can have multiple statements in the JDBC Adapter's XML, as in http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm.
    Here the StatementName1 node can be inserted into your JDBC XML as often as you want.
    Kind regards,
    Koen

  • How to run the same SSRS report multiple times, each time with a different parameter value?

    Hi,
    I have an SSRS report that produces a list of invoices for a single supplier (so supplier is a parameter specified at runtime). The report is based on a stored procedure in SQL. I would like to make things easier and instead of going through all suppliers
    one by one, I want to have a single action, which produces separate reports, per supplier, for all suppliers that have an outstanding invoice (so not all suppliers on the system as a whole but all suppliers that are within the result set of the stored procedure).
    I assume this would mean first executing the stored procedure to find all suppliers that have invoices at the time. And then running the report multiple times, once for each supplier, where the supplier value is used as the parameter every time. ideally
    this would open separate webpages with a single report per page. (I am creating a button in another software, which is simply launching iexplore.exe and passing a
    fixed SSRS report URL).
    What would be required? I have SQL 2012 and I am building this in Report Builder 3.0.
    Thank you!
    Dimitar
    P.S. What about still running ONE report, but every supplier starting on a new page? Is that more realistic? So supplier will not be a parameter any more, but just something that creates a new page on the report?

    What
    about still running ONE report, but every supplier starting on a new page? Is that more realistic? So supplier will not be a parameter any more, but just something that creates a new page on the report?
    Yes thats a much better option. Its very easy to generate such a report in SSRS. You dont need a parameter
    in that case but just needs to add Supplier as a grouping field in the tablix. Then add other columns and groups if required. Select option set page break after each instance of the group for first grouping (ie based on supplier field). Then report will render
    with one page per supplier. On exporting to excel also each supplier data goes to a different tab
    Here's a similar requirement I did for one of my projects
    http://visakhm.blogspot.in/2013/10/using-ssrs-to-export-sqlserver-data-to.html
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • I Keep Receiving The Same Text Messages Multiple Times

    Every single time someone texts me, it doesn't matter who, I will receive the same message from them multiple times. At first I thought it was just them resending their message but I asked and they said no. After a few days it started happening with all my contacts that I text. Sometimes it's every other text message and sometimes it only happens a couple of times but it's extremely annoying. It got so bad that I had to bump up my plan to Unlimited Messaging just so that I wouldn't go over my limit because I think that it's counting the multiple messages! Also, I've tried updating my phone and that didn't work.
    Does anyone have any tips or solutions to this problem? Any help would be greatly appreciated!! Thanks.

        Hi cbf10,
    I am sorry to learn of the erratic duplicate messages you are receiving from several contacts. Let's narrow the potential issues that may be causing this behavior. Are you using a 3rd party application to send/receive text messages (i.e. Handcent, Go SMS, etc...)? Have you altered the operating system software in any way? What is your software version, baseband, kernel and built number?
    Clearing messaging data/cache as applicable may resolve the issue: Menu>Settings>Applications>ManageApplications>All>Messaging>Clear Data/Cache. Try it and keep us posted.
    AntonioC_VZWSupport
    Follow us on Twitter at www.twitter.com/VZWSupport

  • The same email sent multiple times

    I have seen this topic a few times but as yet have not read an answer to the issue. It appears that occassionally an email will be sent multiple times to the same recipient. This is very annoying for the recipient, but more importantly can become very expensive if this is happening whilst roaming. Does this only happen if the signal is poor at the point of sending? Replies welcomed.

    that is your problem.
    You are saying: run this workflow whenever the incident is updated with the sole criteria that the incident has the status resolved.
    What is happening is then that the workflow runs the first time and applies the template. This updates the incident which then triggers the workflow. This goes on until one of the runbooks has updated the incident to status closed. Then the criteria is no
    longer true.
    change the changed from to include the criteria
    status NOT EQUAL resolved.
    http://codebeaver.blogspot.dk/

  • Receiving the same text message multiple times when person only sent it once. How can I make it stop?s from

    I received the same message multiple times and the person that sends it only did it once. Also, I have trouble getting texts from non iPhone using friends.

    It's actually probably a carrier (or hardware) issue on the sender's end. Tell the sender to pull the battery from their phone (or reset it if the battery is non-removable). I've seen this issue with certain HTC phones (HTC did release an update which solved the issue on my Thunderbolt). As far as I knew, I only sent the message once. However, it would show up multiple times on the receiver's phone. Pulling my battery would solve the problem for a while. It did take the software update to stop it permanently.

Maybe you are looking for

  • Sending Rich Text Emails - Default Message font doesn't work!

    I have just set up Mail to compose Rich Text emails as default which seems to have worked okay. However, I have set the default Message font as 'Arial' and it doesn't seem to work when sent to Microsoft Outlook. However if I set the text to a differe

  • How to manipulate static string / text in HTML through Javascript

    Hi, Sorry I know this is not the perfect place to ask about HTML. But I need help somehow. In simple i am creating a website in JSP and using Javascripts. The problem is I have a HTML form where the user have to enter Login Id and Password. If user e

  • WD 1TB My World Edition nas will it work as the place for my itunes library

    I want to add the WD 1TB My World Edition nas to my network and want to have my itunes library on this drive. Can I just export the library to this drive or will it have to be "mac formatted" I want to be able to use the nas with my macs and a sonos

  • Reader 9.3.3 Breaks forms with mailto button

    We have been testing Reader 9.3.3 and have just discovered that it breaks one of our online forms that have a mailto button.  We receive an error: Security Block: Acrobat does not allow connection to: mailto:maibox name It works just fine on any prev

  • button element won't submit, need help...

    This <button> element is used all throughout our site http://www.ocp.org flawlessly. However, on the particular page I'm working on right now it won't work in conjunction with the drop down menu I'm working with in IE 6 or 7, can anyone help me out?