How to acheive this scnerio in PL/SQl using collections

Hi All,
In my apllication we are handling two types of procedures which runs based on the jobs.
Due to some problem few records where got missed in prouduction.
We have tried to run this jobs manaually one by one and it is taking time to execute..
I have got a suggetsion from my senior to do in a collection and run this packages at a time..
Here is my exact scenerio, can you please help me out to implemnet in collections..
Steps:
Populate the missing records namely ordered, event sequence, Start date, end date, region in to plsql table/collection. ( Hard-coded since this will run the code
for a date which will take less time and take less record).
looping the plsqltable/collection for missing records
Running the procedure p_Daily with startdate and end date parameter
-- if the above executed successfully we need to execute second procedure i.e p_Region procedure by checking records in f_daily_report exist/relevant table
(Id and sequence).
Running the procedure p_region with start date and region id ( checking whether id and sequece is exist f_daily_report table).
end loop
The above steps which i have explained needs to achievd thru collections, can anybody helps me out on this.
Note:
1. All the missing jobs wil fal under differnt date rane groups.
2. For second job i.e p_region i have mentioned that it will run based on start date and region id..This job will run on three differnt region id's..We can find the
region id based on by joining f_region and d_region table. It seems that these misisng records belongs to all three regions
Hope u all understand my scenrio. can you please help me out..
Thanks in advance,
Anoo..

Anoo wrote:
Hi,
Hope you have not clear my question..The reason is i want to know how we can achieve my problem in collection
rather than select statement.. Even though if we can get in simple statement is not advisible in my case..That is the reason why i was looking collections...
Rather than providing data is it possible to how we can proceed in collections.That's like saying you want to write poor code that performs slowly rather than fast and performant code.
Without clear explanations and examples of data and output, there doesn't appear to be a valid reason for using collections. The reason you're not getting many responses on your thread is because you're not explaining clearly what is required with examples. Please read {message:id=9360002} for an idea of what people need from you in order to help you.

Similar Messages

  • HT5312 I forget my answer of two security questions, there is a typo error in rescue email address. How to resolve this so that I can use my Apple ID for online shopping?

    I forget my answer of two security questions, there is a typo error in rescue email address. How to resolve this so that I can use my Apple ID for online shopping?

    You won't be able to change your rescue email address until you can answer your questions, you will need to contact Support in your country to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset you can then use the steps half-way down the HT5312 page that you posted from to correct your rescue email address for potential future use

  • How can I restrict the usage of a iPhone 5c?  I would only like my daughter to be able to use her phone between 7am and 10pm central.  Any ideas how to do this or an app to use?

    How can I restrict the usage of a iPhone 5c?  I would only like my daughter to be able to use her phone between 7am and 10pm central.  Any ideas how to do this or an app to use?

    Hi! i believe there is no preinstalled app than can do that for you, however you can use a third party software, such as this: http://www.bitworks-engineering.co.uk/Apps/TimeLock_App/Welcome.html or this https://itunes.apple.com/us/app/parental-timelock-time-limit/id689577280?mt=8

  • How to acheive this?

    Hi,
    I have a table X
    Date columnA columnB
    02/26/07 10 1
    02/28/07 1
    03/01/07 5 2
    03/06/07 10 100
    required out put
    Date columnA columnB
    02/26/07 10 1
    02/28/07 10 2
    03/01/07 15 4
    03/06/07 25 104
    Can some one guide me how to achieve this!

    SQL> create table x
      2  as
      3  select date '2007-02-26' mydate, 10 columna, 1 columnb from dual union all
      4  select date '2007-02-28', null, 1 from dual union all
      5  select date '2007-03-01', 5, 2 from dual union all
      6  select date '2007-03-06', 10, 100 from dual
      7  /
    Tabel is aangemaakt.
    SQL> select mydate
      2       , sum(columna) over (order by mydate) columna
      3       , sum(columnb) over (order by mydate) columnb
      4    from x
      5   order by mydate
      6  /
    MYDATE                 COLUMNA    COLUMNB
    26-02-2007 00:00:00         10          1
    28-02-2007 00:00:00         10          2
    01-03-2007 00:00:00         15          4
    06-03-2007 00:00:00         25        104
    4 rijen zijn geselecteerd.Regards,
    Rob.

  • How to acheive this output during the XML conversion ?.

    I am converting the data into XML. I am using Oracle8i.
    create table emp(empno number,
    ename varchar2(20),
    deptno number);
    insert into emp values(101,'Krish',10);
    insert into emp values(102,null, 10);
    insert into emp values(103,'Scott',20);
    commit;
    CREATE OR REPLACE PROCEDURE STP_TEST_XML AS
    v_context DBMS_XMLQUERY.CTXTYPE;
    v_document CLOB;
    v_error_code VARCHAR2(3) := 'OK';
    BEGIN
    v_context:= DBMS_XMLQUERY.NEWCONTEXT('SELECT * FROM EMP');
    DBMS_XMLQUERY.USENULLATTRIBUTEINDICATOR(v_context,TRUE);
    DBMS_XMLQUERY.SETROWSETTAG(v_context,'EMPIMPORT');
    DBMS_XMLQUERY.SETROWTAG(v_context,'EMP');
    v_document := DBMS_XMLQUERY.GETXML(v_context);
    DBMS_XMLQUERY.CLOSECONTEXT(V_context);
    PRINT_XML(v_document);
    END;
    CREATE OR REPLACE PROCEDURE print_xml(result IN OUT NOCOPY CLOB) is
    xmlstr varchar2(32767);
    line varchar2(2000);
    begin
    xmlstr := dbms_lob.SUBSTR(result,32767);
    loop
    exit when xmlstr is null;
    line := substr(xmlstr,1,instr(xmlstr,chr(10))-1);
    dbms_output.put_line('| '||line);
    xmlstr := substr(xmlstr,instr(xmlstr,chr(10))+1);
    end loop;
    end;
    The output is showing as below.
    <?xml version = '1.0'?>
    <EMPIMPORT>
    <EMP num="1">
    <EMPNO>101</EMPNO>
    <ENAME>Krish</ENAME>
    <DEPTNO>10</DEPTNO>
    </EMP>
    <EMP num="2">
    <EMPNO>102</EMPNO>
    <ENAME NULL="YES"/>
    <DEPTNO>10</DEPTNO>
    </EMP>
    <EMP num="3">
    <EMPNO>103</EMPNO>
    <ENAME>Scott</ENAME>
    <DEPTNO>20</DEPTNO>
    </EMP>
    </EMPIMPORT>
    But my requirement needs my output should be as below. Please let me know how to achieve this output.
    <?xml version = '1.0'?>
    <EMPIMPORT>
    <EMP num="1">
    <EMPNO>101</EMPNO>
    <ENAME>Krish</ENAME>
    <DEPTNO>10</DEPTNO>
    </EMP>
    <EMP num="2">
    <EMPNO>102</EMPNO>
    <ENAME/>
    <DEPTNO>10</DEPTNO>
    </EMP>
    <EMP num="3">
    <EMPNO>103</EMPNO>
    <ENAME>Scott</ENAME>
    <DEPTNO>20</DEPTNO>
    </EMP>
    </EMPIMPORT>

    can you please tell me how to acheive 1,2,3  instead of the chars.
    Also if I use virtual characteristic can I able to access the query structure in the user exit like the restricted key figures etc or just the records how they appear in the cube.
    Thank you guys for the quick response.

  • How to acheive this???? J2EE gurus

    Hi,
    I have servletA in one serverA and servletB in ServerB.When a request is made to servletA it should call the ServletB to get the response.
    Basically they should be chained.
    I understand that to forwarding a request to a servlet which is in a different context we have to use redirect instead of forward.if we user redirect the server issses a new request.
    How can i acheive this???
    Thanks in advance.

    The Client is imp bcos it is the one which receives
    the response.
    I would like to one thing.
    if PDA makes a request to ServletA which is on
    ServerA and the ServletA makes an HttpURLConnection
    and contacts ServletB which is on ServletB, how can i
    inlcude the response sent by servletB into ServletA
    response????
    ServletB is writing everything into response object.
    Thanks
    You could use a method like this. Though you might have to modify ot as per your requirements
    private void returnSuccessfullNotifyHttpResponse(HttpServletRequest request, HttpServletResponse response, String pushId)
                                             throws ServletException, IOException {
        String responseString =null;
        PrintWriter out=null;
        String replyTime = null;
        Calendar  date = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
        String year,month,day,hour,minute,second;
        year=Integer.toString(date.get(Calendar.YEAR));
        month=Integer.toString(date.get(Calendar.MONTH) + 1 );
        if (month.length() == 1)
          month = "0" + month;
        day=Integer.toString(date.get(Calendar.DAY_OF_MONTH));
        if (day.length() == 1)
          day = "0" + day;
        hour=Integer.toString(date.get(Calendar.HOUR_OF_DAY));
        if (hour.length() == 1)
          hour = "0" + hour;
        minute=Integer.toString(date.get(Calendar.MINUTE));
        if (minute.length() == 1)
          minute = "0" + minute;
        second=Integer.toString(date.get(Calendar.SECOND));
        if (second.length() == 1)
          second = "0" + second;
        replyTime = year+ "-" + month + "-" + day+ "T" + hour+ ":" + minute + ":" + second + "Z";
        responseString=
                XML_HEADER +
                   PAP_STAG + CRLF +
                     PUSH_RESPONSE_STAG +
                       PUSH_ID + pushId + CLOSE_QUOTE + SPACE +
                      SENDER_ADDRESS + "http://" + request.getServerName() + ":"+  request.getServerPort() + request.getServletPath() + CLOSE_QUOTE + SPACE +
                      SENDER_NAME + SPACE +
                      REPLY_TIME + replyTime + CLOSE_QUOTE + CLOSE_TAG + CRLF +
                      RESPONSE_RESULT_STAG +
                        CODE + "1001" + CLOSE_QUOTE +
                        DESC + "The request accepted for processing" + CLOSE_QUOTE + CLOSE_TAG +
                      RESPONSE_RESULT_ETAG + CRLF +
                    PUSH_RESPONSE_ETAG + CRLF +
                  PAP_ETAG;
        response.setContentType("application/xml");
        //response.setHeader("Connection", "keep-alive");
        response.setStatus(response.SC_ACCEPTED);
        response.setContentLength(responseString.length());
        out = new PrintWriter (response.getOutputStream());
        out.print(responseString);
        out.close();

  • How to crete this query in PL/SQL?

    I have a column, CA_MOVE, in table Table1 in Oracle that needs to be populated with the following logic:
    IF hist_mis_cds.manag0s = "", then Table1.CA_MOVE = ""
    ELSE
    IF hist_mis_cds.manag0s <> Table1.CA_MOVE ,
    then Table1.CA_MOVE = "X"
    ELSE Table1.CA_MOVE = ""
    Do I have to go row by row (cursor) or can I give a straight UPDATE Table1.CA_MOVE query? How do I create a PL/SQL query to do this? I have Oracle Database 10g Express Edition.
    Thanks a lot!

    I am not sure whether you intend "" to represent the empty string (which Oracle considers NULL) or a literal string '' (i.e. two apostrophes). I assume you mean the NULL interpretation.
    I assume that there is some column in both tables that would allow you to join the two tables. If so,
    UPDATE table1 t1
       SET ca_move = (SELECT (CASE WHEN t2.manag0s != t1.ca_move THEN 'X'
                                   ELSE NULL
                                   END)
                        FROM table2 t2
                       WHERE t1.key = t2.key)Justin

  • How to acheive this?? Pls help

    Our project has almost completed the development.
    My client has requested to migrate the database.
    we are migrating from db2 to db2e.
    DB2e allows only one database connection.(limitation of db2e)
    ie i have to close the current connection object before
    getting the new Connection object.
    I cannot have a Connection pooling also.
    I have many links on my home page where every link
    needs the connection object to do some database operations.
    As i can have only one database connection, when i click
    on the links repeatedly or when i play around with the links,
    i get exceptions saying that i cannot have more than one connection
    and results in a blank page or error page.
    Currently my application has to handle this situation,
    ie even if the user clicks continuosly on all the links or plays
    around with the links it has take the last request into account
    and display accordingly
    I have a databaseConnection class which returns me a Connection object
    To achieve the above funtionality i tried making the Connection object as static, so whenever i call the function to get the Connection object i check whether the current connection object is open or is not null.
    if it is open i close and make it null and return the new connection object.
    This seems to be working to some extent but not stable.
    Iam not sure how does the server process when many requests are made and only one connection object is available at any point of the time.
    Iam not sure how to get it working and stable.
    One more solution i can think of is to declare a global variable
    which tells us whether a request has been made.depending on this
    variable i can restrict the user by clicking on the links reapeatedly.
    but this is very tedious and also i have a time constraint.
    any advice
    tks in advance

    just curious,couldn't you keep one connection open and through that connection run queries of different types?

  • Sample Picture - How To Acheive this Look

    Hi there, attached is a link to a home that was processed in Photoshop and I was wondering the process that is used to achieve this look...(i.e. multiple layers, tweaked curves etc..)
    Any input is appreciated! Thanks!
    http://kendrakephotography.com/original_media_viewer.asp?WebsiteID=2328&GalleryID=11622&Me diaID=356478

    Gentlemen:
    As I said: an expert architectural photographer who knows how to place washes of light on the subject, and then balance the lighting with the sky and other background. Take a look at other photos in the same series by this photographer.
    If you light it right (including possible multiple flash techniques), you don't "need" RAW or any other Photoshop corrections. Again, I've seen this kind of lighting in a number of 4x5 Ektachrome originals that had been exposed and processed normally -- before Photoshop was a dream in Adobe's eye. Such photos can be absolutely stunning.
    A pro will use Photoshop here just for cleanup and any
    minor imbalances or corrections to reach perfection. An amateur will use Photoshop here as a crutch to turn less than stellar work into something "acceptable".
    Is it possible to duplicate the effect from less-than-optimum photos with head-turning results? Anything is possible, but it depends upon how well the original subject was photographed, and how much information is in that photo that can be manipulated. But...
    Neil

  • How to simplify this query into simple sql select stmt

    Hi,
    Please simplify this query
    I want to convert this query into single select statement. Is it possible?
    If uarserq_choice_ind is not null then
    Select ubbwbst_cust_code
    From ubbwbst,utrchoi
    Where utrchoi_prop_code=ubbwbst_cancel_prod
    Else
    Select max(utvsrvc_ranking)
    From utvsrvc,ubbwbst
    Where utvsrvc_code=ubbwbst_cancel_prod
    End if

    Though i have not tested this statement if mine ...but you can try at your end and let me know whether u got the desired output or not.
    Select Decode(uarserq_choice_ind,Null,max_rnking,ubbwbst_cust_code)uarserq_chc
    from
    (Select max(utvsrvc_ranking)max_rnking,uarserq_choice_ind,ubbwbst_cust_code
    From utvsrvc,ubbwbst,utrchoi
    Where utvsrvc_code=ubbwbst_cancel_prod
    Or utrchoi_prop_code=ubbwbst_cancel_prod
    group by uarserq_choice_ind,ubbwbst_cust_code)
    Best of Luck.
    --Vineet                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Using collections how to acheive this?

    Hi All,
    In my apllication we are handling two types of procedures which runs based on the jobs.
    Due to some problem few records where got missed in prouduction.
    We have tried to run this jobs manaually one by one and it is taking time to execute..
    I have got a suggetsion from my senior to do in a collection and run this packages at a time..
    Here is my exact scenerio, can you please help me out to implemnet in collections..
    Steps:
    Populate the missing records namely ordered, event sequence, Start date, end date, region in to plsql table/collection. ( Hard-coded since this will run the code
    for a date which will take less time and take less record).
    looping the plsqltable/collection for missing records
    Running the procedure p_Daily with startdate and end date parameter
    -- if the above executed successfully we need to execute second procedure i.e p_Region procedure by checking records in f_daily_report exist/relevant table
    (Id and sequence).
    Running the procedure p_region with start date and region id ( checking whether id and sequece is exist f_daily_report table).
    end loop
    The above steps which i have explained needs to achievd thru collections, can anybody helps me out on this.
    Note:
    1. All the missing jobs wil fal under differnt date rane groups.
    2. For second job i.e p_region i have mentioned that it will run based on start date and region id..This job will run on three differnt region id's..We can find the
    region id based on by joining f_region and d_region table. It seems that these misisng records belongs to all three regions
    Hope u all understand my scenrio. can you please help me out..
    Thanks in advance,
    Anoo..

    Joel_C wrote:
    There seems to have been a spate of Off-topic postings - is it possible this might be related to the forum software acting up or is it just coincidental user error in each case?Possibly.
    My hypothesis is that the unfortunate name "Application Express", the width of the APEX domain, and the excellent service provided here leads some to the belief that this is a fast-track clearing house for general Oracle/Applications/eBS questions.
    (For a number of others of course it's simply a free lunch...)

  • How to get this required information via SQL

    Dear All
    I have a requirement & i am not getting a way out of it.
    Consider Sample Data as
    Table Name >> INVOICE
    Data :
    INV_N0 PRODUCT_NO SOLD_QTY
    1 1 2
    1 2 3
    1 3 1
    2 2 11
    2 3 12
    3 2 10
    4 3 22
    Now my requirement is to fetch data of particular invoices that contains a certain set of products.
    e.g.
    If i want invoice that contain only product no 2 & 3 then my out put should be.
    INV_N0 PRODUCT_NO SOLD_QTY
    1 1 2
    1 2 3
    1 3 1
    2 2 11
    2 3 12
    Means i want to fetch data of complete invoice containing a certain set of products from that invoice.
    Regards
    Capri
    Edited by: Capri on Apr 8, 2010 4:57 AM

    probaby not the best performance, but you have a PRODUCT IN () list, which is what you wanted
    with t as (
    select 1 inv_no, 1 product, 2 sold_qty from dual union all
    select 1, 2, 3 from dual union all
    select 1, 3, 1 from dual union all
    select 2, 2, 11 from dual union all
    select 2, 3, 12 from dual union all
    select 3, 2, 10 from dual union all
    select 4, 3, 22  from dual
    , tt as (
    select t1.*, (select count(*)
                  from   t t2
                  where  product in (2,3)
                  and    t1.inv_no = t2.inv_no) cn
    from t t1
    select * from tt
    where cn > 1

  • How to add WebService authentication in pl/sql using UTL_HTTP

    Hi,
    I am passing SOAP request and getting output as a soap response from WebService using UTL_HTTP.
    Calling Web service client call from the PL/SQL procedure.
    Java web service is a service producer.
    Now we needs to add security to the application we are planing to add some of the userid/pwd credientials.
    So what needs to be add sql code in the sq/sql for making client call.
    i checked from the few of the articles. it shown like
    UTL_HTTP.set_authentication(http_req, 'username', 'password' );
    is it enough for making clent call or any other changes are required.
    Please let me know and any code to be implemented in the jave side aslo(if you knows) :-)
    Thanks,
    Pradeep.

    Okay, backtrack.
    A web server can deliver all kinds of content. From static HTML pages, to XML files and videos and dynamic content. Including reports.
    The communication language (protocol) used to talk to a web server is HTTP.
    UTL_HTTP is an Oracle PL/SQL library that implements the client side of this communication. It allows the developer to write code that acts like a web browser and communicates with a web server.
    Now what do you not understand and cannot use?
    HTTP is not simple and easy. You need to understand the basics of this communication language in order to communicate successfully with the web server. Like knowing the difference between GET and PUT and POST commands, how the URL query string works and so on.
    Once you know that, you can look at how the web server provides reports. How do you authenticate as a web browser with the web reporting system? What URLs do you use to access which reports? How do you pass name-values to the web server as report parameters? What HTTP response formats (MIME types) does the web report server provide? Which one do you plan to use and how do you parse that response into a meaning structured data format?
    If you're thinking it is "easy", think again. Sure, someone here can provide sample code that for example grabs a CSV report file from a web server and (using a pipeline table function), turn that into rows and columns. But that will not teach you the fundamentals you need to know and not equip you with dealing with the problem with your own brains, hands and keyboard.
    PS. In other words, learn to crawl and walk before trying to run. Get to grips with how HTTP works before diving into the deep end of web report integration.

  • How to acheive IF elseif elseif else  condition using std mapping functions

    How to perform the following mapping using standard graphical functions:
    if (a = 1)
    result.addValue("3");
    else if (a = 2)
    result.addValue("6");
    else if (a = 5)
    result.addvalue("7");
    else if (a = 10)
    result.addValue("11");
    else
    result.addValue(a);
    can this requirement be acheived without using a UDF?
    Regards
    bhasker

    UDF is better way to get this done.
    you try like this using Standard function:
                                               Const 3    /THEN     
                                      (A equals 1)   IF              (output of ifThenElse) ->TragetFiled
                                                            \ELSE
                                                  /THEN     /(output of IfThenElse input to else of first If)
                                              IF               /
                                                 \ELSE
    Like wise for other conditions....
    In else part of ifThenElse, give the output of second ifThenElse. here in ths case you need four ifThenElse.
    CodeGenerated:
    /ns0:MT_/targetFIELD = iF(const([value=3]), stringEquals(/ns0:MT_XML_OB/A=, const([value=1])),
    iF(const([value=6]), stringEquals(/ns0:MT_XML_OB/A=, const([value=2])),
    iF(const([value=7]), stringEquals(/ns0:MT_XML_OB/A=, const([value=5])),
    iF(const([value=11]), stringEquals(/ns0:MT_XML_OB/A=, const[value=10])), /ns0:MT_XML_OB/A=))))
    Ritu
    Edited by: Ritu Sinha on Apr 13, 2009 2:48 PM

  • How to write this java code in jsp using jstl  tags?

    Can anybody help me on this?
    I dont know how to check the containsKey using jstl tags?
    <%
         LinkedHashMap yearMap     =     (LinkedHashMap)request.getAttribute("yearMap");
         TreeSet nocSet               =     (TreeSet)request.getAttribute("nocSet");
         Iterator     yearMapIt     =     yearMap.keySet().iterator();
         while(yearMapIt.hasNext())
              int yearValue               =     (Integer)yearMapIt.next();
    %>
    <tr>
              <td><%=yearValue%></td>
    <%
              LinkedHashMap monthMap     =     (LinkedHashMap)yearMap.get(yearValue);
              Iterator     nocSetIt     =     nocSet.iterator();
              while(nocSetIt.hasNext())
                   String nCase=(String)nocSetIt.next();
                   if(monthMap.containsKey(nCase))
                        String count     =     (String)monthMap.get(nCase);
    %>
                        <td> <%= count %> </td>
    <%            }
                   else
    %>          
                        <td> 0 </td>     
    <%          
    %>
    </tr>
    <% } %>Edited by: avn_venki on Feb 18, 2008 11:54 PM

    <c:forEach var="yearMap" items="${requestScope.yearMap}">
         <th> <c:out value="${yearMap.key}"/> </th>
    <bean:define id="monthMap" value="${yearMap.value}"/>
    <c:forEach var="nocSet" items="${nocSet}">
    then how to write containsKey using tags??

Maybe you are looking for