Pass variables and return ResultSet from same preparedStatement

I am passing "fp" and "week_no" to a preparedStament in a class and want to return the values to my jsp page. "fp" and "week_no" are used twice. Please see below. When I run it, I get no error messages but, it doesn't display any data.
I have the following code in a class:
public ResultSet getHistory(String fp, String week_no)
                    throws SQLException, Exception {
ResultSet rs = null;
if (con != null) {
try {
     PreparedStatement getHist;
     getHist = con.prepareStatement(
     "SELECT sbu, TO_CHAR(((sum_dollar) + (adj_sum_dollar)),'$999,999,999.99') AS sum_dollar, TO_CHAR(actual_date,'MM/DD/YY') AS actual_date, " +
     "((sum_cases) + (adj_sum_cases)) AS sum_cases, " +
     "((new_order_cases) + (adj_new_order_cases)) AS new_order_cases, " +
     "((total_open_orders) + (adj_total_open_orders)) AS total_open_orders, " +
     "((back_orders) + (adj_back_orders)) AS back_orders, " +
     "TO_CHAR((sum_dollar/sum_cases), '999.99') AS yield " +
     "FROM SUMMARY " +
     "WHERE actual_date BETWEEN (SELECT begin_dt " +
               "FROM fiscal_calendar " +
                         "WHERE fiscal_period = '?' " +
                         "AND week_number = '?' " +
                         "AND week_number <> '9' " +
                         "AND fiscal_yr = '2003') " +
                    "AND " +
                         "(SELECT end_dt " +
                    "FROM fiscal_calendar " +
                         "WHERE fiscal_period = '?' " +
                         "AND week_number = '?' " +
                         "AND week_number <> '9' " +
                         "AND fiscal_yr = '2003') " +
          "ORDER BY actual_date, sbu ");
     getHist.setString(1, fp);
     getHist.setString(2, week_no);
     getHist.setString(3, fp);
     getHist.setString(4, week_no);
     rs = getHist.executeQuery();
     } catch (SQLException sqle) {
error = "SQLException: Update failed, possible duplicate entry.";
     throw new SQLException(error);
} else {
error = "Exception: Connection to the database was lost.";
     throw new Exception(error);
return rs;
This is in my jsp:
<%
String fp = request.getParameter("fp");
String week_no = request.getParameter("week_no");
historyInfo.connect();
ResultSet rs = historyInfo.getHistory(fp, week_no);
while (rs.next()) {
//String sum_dollar = rs.getString("sum_dollar");
%>
<%= rs.getString("sum_dollar") %>
<%
%>

Hi,
First thing U can't do this way in java. If U are executing this sort of database query, after retriving all the values, put inside Haahtable or HashMap as the application required and return it.
Otherwise execute this query at the same place where u r printing values in jsp page insted of writing it inside seperate method..It will work.
If still it's not workimg, please let me know.
Rajeh Pal

Similar Messages

  • A very good friend of mine dropped her iphone into water and now it is not working.Her husband recently passed away and text messages from him and from well wishers after his decease are feared lost. Is there any way to retrieve them?

    A very good friend of mine dropped her iphone into water and now it is not working.Her husband recently passed away and text messages from him and from well wishers after his decease are feared lost. Is there any way to retrieve them?
    I suggested contacting Compub in Nassau St as the info is priceless and worth the trouble of trying to regain?
    Any thoughts? The poor lady is very distress

    If she has backed up her iPhone she can replace that iPhone and set up the new iPhone from her backup.
    You can put the iPhone that went into water into a plastic baggie with either new silica gel packets (preferred) or raw rice and let it sit for  4 - 5 days. After that time remove the phone and connect it to power for at least a half hour. While it is still connected to power reset it by holding down the power and hold button, wait for the Apple logo then let go of the buttons. Might take several tries. If it revives immediately back it up.

  • How can you create a playlist with music and music video and play those from same playlist through Apple TV?

    How can you create a playlist on Ipod touch with music and music video,  and play those from same playlist through Apple TV?  I can download, create a playlist with both music and music video, stream that through the Apple TV with no problem.  The sound and the information show up on the TV, but when it gets to a music video, it only shows the information and "artwork".
    I also have a video playlist - videos play fine through the Apple TV, but will not shuffle through all videos - continues to repeat the same one.  I have most definitely selected shuffle in both locations - from the playlist and on the ipod video screen while video is playing.

    I finally got it... had to sync the photos with the music in iMovie, arrange the voiceover in GarageBand then export to iTunes, and then I was able to put it all together in iMovie and burn in iDVD... had a few glitches along the way but finally finished : )
    Message was edited by: jpewald

  • Multithreading and Returning Value from RMI

    Hi all,
    I have an RMI Object which is Multi Threaded. The scenario is like this:
    The client program will pass different program specific codes to the RMI object. Multiple clients can pass same or different codes. If the codes are different they can share common data in an asynchronous way other wise they need to be synchronized.
    This RMI object will do some database transactions and will return a value to the client. I am not sure how to return a value to the client which has invoked this method as this method executes asynchronously.
    I am sorry if this posting is inappropriate for this forum.
    Thanks in Advance
    Srinivas

    If the database transaction executes asyncrhonously, the remote method has to wait for it and return the result via the return statement.
    As the remote request is already executing in a thread of its own there is of course no need for the database transaction to execute asynchronously from RMI's point of view so if you can get rid of that complication in your architecture you may as well do it. OTOH your application architecture may do it for other reasons

  • Returning ResultSet from servlet to jsp - java.lang.NullPointerException

    Hey all, i've been stuck on this for too long now...just trying to return a ResultSet from a servlet to jsp page.
    Had a bunch of problems earlier...which i think were fixed but...now i get a "java.lang.NullPointerException" in my jsp page when i try to get elements from the ResultSet object.
    Here is the latest version of my code:
    Servlet:
    String QueryStr="select ProdName from products";
    Statement stmt=conn.createStatement();
    rs=stmt.executeQuery(QueryStr); //get resultset
    sbean.setInventory(rs); //set ResultSet in bean
    req.getSession(true).setAttribute("s_resbean",sbean); //create session/request variable, set to bean
    Bean:
    package beans;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    import javax.sql.*;
    public class SearchBean extends HttpServlet{
         private int searchFlag=0;
         private ResultSet inventory;
         public SearchBean(){
         public int getSearchFlag(){
         return searchFlag;
         public ResultSet getInventory(){
              return inventory;
         public void setInventory(ResultSet rs){
              this.inventory=rs;
         public void setSearchFlag(){
              this.searchFlag=1;
    jsp:
    <%@ page language="java" import="java.lang.*,java.sql.*,javax.sql.*,PopLists.PopInvLists,beans.SearchBean"%>
    <jsp:useBean scope="session" id="s_resbean" class="beans.SearchBean" />
    <% ResultSet categories=PopInvLists.getCat();
    ResultSet manuf=PopInvLists.getManuf();
    ResultSet supplier=PopInvLists.getSupplier();
    ResultSet cars=PopInvLists.getCars();
    ResultSet search=(ResultSet)request.getAttribute("s_resbean");
    %>
    <%     while(search.next()){
         String pname=search.getString("ProdName");
    %>
    It craps out when i try to loop through the "search" ResultSet.
    I can loop through the rest of the ResultSets no problem....just this one doesn't work because it's set in a servlet, not a simple java class.
    Just to clarify, i am populating some dropdown lists on entry to the screen, which the user will use to perform a search. Once the search btn is clicked, the servlet is called, gets the request info for the search, performs search, and returns the resultset to the original screen. I want to eventually display the result under the search criteria.
    Someone....Please Please please tell me how to get this working...it should be very simple, but i just can't get it to work.
    Thanks in advance,
    Aditya

    req.getSession(true).setAttribute("s_resbean",sbean); //create session/request variable, set to beanHere you add an attribute to the session.
    ResultSet search=(ResultSet)request.getAttribute("s_resbean");Here you try to get the attribute from the request. Naturally it isn't there because you added it to the session, not the request. Despite your comment in the first line of code, a session is not a request. And vice versa.

  • How to pass variable to content area from a PL/SQL procedure

    Hi,
    Can somebody tell me how to create a(Content area) folder based on a PL/SQL procedure that takes a variable as a
    parameter and returns data based on value of that parameter to the folder . Any help would be appreciated .
    Thanks and regards.
    Neeti.

    Somewhere, in one procedure, build a session identifier and save your variable there. If no session with that identifier is previously stored, it will create a new session instance with that ID for you.
    declare
    l_sess portal30.wwsto_api_session;
    varvalue number;
    begin
    varvalue := 100;
    l_sess := portal30.wwsto_api_session.load_session('MYSESSION','VARIABLES');
    l_sess.set_attribute('VAR_NAME',varvalue);
    l_sess.save_session;
    end;
    In your other procedure, or anywhere else needed within that same session, simply load the session and reference the variable. To reference the variable, use the following.
    -- assuming new procedure, so re-defining session variable and reloading session into it
    declare
    my_session portal30.wwsto_api_session;
    my_new_variable number;
    begin
    my_session := portal30.wwsto_api_session.load_session('MYSESSION','VARIABLES');
    my_new_variable := my_session.get_attribute_as_number('VAR_NAME');
    end;
    This will let you reference parameters across multiple portal applications and indirect calls.

  • Pass variable and set default value based on user's group

    Hello
    I'm using SharePoint 2010 and SQL 2012. I need to send a variable to the page and based on its value, set default value for a drop down list and send it to other web part to filter the data. Is it possible for certain users to send that value as a default
    and limit user to see only this value in the text field or drop down list; for others - to allow to see the drop down list, but also set the default value for that list?
    The main page was designed in SharePoint designer, using web parts (aspx page). I had setup a connection to Active Directory and already have the code to get user's groups and based on their group, I have that variable pulled into the web page for further
    use. But I don't know how to pass that value as a default value to the web part (currently using SharePoint Filter web part). When I tried to set a default value for the web part - it automatically puts the quotation marks around the name of the variable
    and shows it as a text instead of showing the value of the field.
    Thank you!
    P.s. I have limited knowledge of SharePoint and need guidance (links, examples, recommendations)!
    Alla Sanders

    Thank you for your response. I'll try to give you more details. On PageA I check user's groups and based on the group, assign the value and pass it to the next page (no input from the user, all done behind the scene and user is redirected to PageB).
    On the next page I read that value and would like to send it to the SharePoint List Filter Web as a default value, as well as send it to another web part that displays the list from SQL, filtered using that default value. Ideally, if the user is from Group
    A, I'd like for them to have only one value in that drop down list; if user is from Group B - give him drop down list with 40 items to choose from. Below there is a part of the code and variable fnum has the value from PageA (if I print the value on the screen
    - I do see that it has correct value, so the code that gets groups from Active directory works correctly). If I assign fnum as a default value of the list, it shows "fnum" instead of the value of variable fnum. I connect to SQL database, using external
    content - so the other list that I'm filtering based on the value in that drop down list - is XSLT Data View Web part. I also have 2 more filters on that page, that user will have full access to and based on their input, it is also sent to the XSLT web part
    to filter out more data. Since one of the filters is the date and I am filtering data starting from the date that user chooses - XSLT is the only web part that I was able to make it work with.
    I looked at the link you provided (thank you). It is using Content Query Web part. Will it work with external content, as well as accepting multiple filtering, including custom starting date? I appreciate your help!
    <%
    string fnum = Request.QueryString["field1"];
    %><table cellpadding="4" cellspacing="0" border="0" style="height: 1000px">
    <tr>
    <td id="_invisibleIfEmpty" name="_invisibleIfEmpty" colspan="2" valign="top" style="height: 101px">
    <WebPartPages:WebPartZone runat="server" Title="loc:Header" ID="Header" FrameType="TitleBarOnly"><ZoneTemplate>
    <WpNs0:SpListFilterWebPart runat="server" FilterMainControlWidthPixels="0" RequireSelection="False" ExportMode="All" PartImageLarge="/_layouts/images/wp_Filter.gif" AllowHide="False" ShowEmptyValue="True" MissingAssembly="Cannot import this Web Part." AllowClose="False" ID="g_1ccc4bca_3ba1_480b_b726_adfdb1e9e02d" IsIncludedFilter="" DetailLink="" AllowRemove="False" HelpMode="Modeless" AllowEdit="True" ValueFieldGuid="fa564e0f-0c70-4ab9-b863-0177e6ddd247" IsIncluded="True" Description="Filter the contents of web parts by using a list of values from a Office SharePoint Server list." FrameState="Normal" Dir="Default" AllowZoneChange="True" AllowMinimize="False" DefaultValue="fnum" Title="Facilities List Filter" PartOrder="2" ViewGuid="2da5d8db-6b55-4403-80a8-111e42049f8b" FrameType="None" CatalogIconImageUrl="/_layouts/images/wp_Filter.gif" FilterName="Facilities List Filter" HelpLink="" PartImageSmall="/_layouts/images/wp_Filter.gif" AllowConnect="True" DescriptionFieldGuid="2d97730a-cd0d-4cb9-8b55-424951201081" ConnectionID="00000000-0000-0000-0000-000000000000" ExportControlledProperties="True" TitleIconImageUrl="/_layouts/images/wp_Filter.gif" ChromeType="None" SuppressWebPartChrome="False" IsVisible="True" ListUrl="/Lists/FacilitiesList" AllowMultipleSelections="False" ZoneID="Header" __MarkupType="vsattributemarkup" __WebPartId="{768E2035-0461-4A09-8DDD-CA7020C2B23D}" WebPart="true" Height="" Width="615px"></WpNs0:SpListFilterWebPart>
    Alla Sanders

  • How can I create a function using TestStand variables and call it from a step's Pre-Expression?

    In one sequence I have dozens of Pre-Expressions which are almost the same thing, like this...
    Locals.tagID = (Parameters.singlePhaseEnabled ? "L" : "D") & Str(Locals.phase) & "006"
    ...and the only thing different is that three digit string at the end ("006" will vary). How can I write a function that I can call from a step's Pre-Expression so it would look something like this? ...
    Locals.tagID = MyNewFunction("006")

    You cannot write custom commands for expressions.
    That being said, there are a couple of options:
    Create a subsequence with a single step. Use a parameter of the sequence as "function parameter".
    Create a custom step type including a substep module which implements the function. Add an edit substep to enable the user of the steptype to gracefully change the parameter.
    Store the variable parameter in a local/file global variable and modify the value in each step. This will, at least, keep the "function" the same for every step.
    Norbert

  • Passing variables and methods between two class files

    I created two simple programs to see what I can learn about how separate class files work together.
    There are two files, Alpha.java and Beta.java. Both are located in the same folder.
    Here�s Alpha.java:
    ********* Alpha.java *********
    public class Alpha {
    public int alphaInt;
    public void alphaMethod() {
    System.out.println("This is Alpha's alphaMethod.");
    ******** End Alpha **********
    Here�s Beta.java
    ******** Beta.java ***********
    public class Beta {
    public static void main() {
    Alpha a = new Alpha();
    a.alphaInt = 10;
    System.out.println(The value of alphaInt is " + a.alphaInt);
    a.alphaMethod();
    ******** End Beta ***********
    Alpha compiles fine. Beta does not compile and I get this error:
    �Exception in thread �main� java.lang.NoSuchMethodError: main�
    My first problem to solve is to get Beta to compile. After that I should be able to run it from the command line and get something like this as output:
    �The value of alphaInt is 10�
    �This is Alpha�s alphaMethod.�
    Would some kind people please help me with this?
    TIA,
    Logan

    That was easy, and it confirms what I thought should happen. Now for the real question:
    Alpha and Beta are servlets in a package called abClasses. Alpha starts out like this:
    package abClasses;
    import javax.servlet.*;
    import javax.servlet.jsp.*;
    import java.util.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class Alpha extends HttpServlet {
    Beta is the same, except for the name of course.
    Alpha creates a Connection variable, and Beta is going to use it. But when I try to compile Alpha I get an error that says this:
    cannot resolve symbol
    symbol: class Alpha
    location: abClasses.Beta
    Alpha a = new Alpha();
    Any suggestions on why what we did in the simple Alpha and Beta programs won't work in the Alpha and Beta servlets?
    You are appreciated,
    Logan

  • R12: how to show ap invoices and ar transactions from same party id

    Is it possible to see the open ap invoices and open ar transactions from the same party id
    in one screen or report?

    I'm sorry your posts keep getting locked despite you asking not to have them locked. To avoid this in the future, if you accidentally post in the wrong forum, edit the post in the wrong forum to remove the content, and change the titlte to please ignore or something similar.
    This is the response I made on your post in the SQL PL/SQL forum since I will not be able to respond on that one.
    The exists operator looks for a record that matches the criteria you give it. If it finds a record, it returns true, if not it returns false. So, when you say:
    exists (select 1 from ap_invoice_lines_all
            where invoice_id = i.invoice_id and
                  po_header_id is null)It is really asking is there a record in ap_invoice_lines_all where invoice_id = 100 and po_header_id is null. Since there is such a record, the exists return true and the record from ap_invoices_all is returned.
    I'm not sure whether your last query should be against ap_invoices_all or ap_invoice_lines_all, and i'm also not entirely sure what result you actually want. If you want to find records in ap_invoices_all where all of the lines have a non-null po_header_id, then you need to reverse your logic, something like:
    select *
    from ap_invoices_all i
    where invoice_num = '1010' and
          not exists (select 1
                      from ap_invoice_lines_all
                      where invoice_id = i.invoice_id and
                            po_header_id is null)That will show only invoices where all of the lines have po_header_id populated. Just change the is null to is not null to get invoices where no lines have po_header_id populated.
    If you are looking for something else, try again to explain what you want, with some sample data for the two tables, and your expected results from that sample data. The sample data should preferabble be in the form of create table ind insert statements.
    John

  • Returning Resultset from different DB

    Hi folks,
    I am working on a developing a Database Framework. The user gives information about the stored proc to execute,parameters required by the stored prc, the connection url ,credentials and database provider(which can be Oracle,SQL Server or DB2). I have to execute the query and return back the resultset to the user.
    What I am interested in knowing is does each and every DB provider handles or create the ResultSet in different way?
    For Example:
    In oracle the Stored proc call looks like setting a registerOutParameter and then getting the ResultSet:
    String query = "{call ? := myStoredProc(?)}";
    CallableStatement stmt = conn.prepareCall(query);
    // register the type of the out param - an Oracle specific type
    stmt.registerOutParameter(1, OracleTypes.CURSOR);
    // set the in param
    stmt.setFloat(2, price);
    // execute and retrieve the result set
    stmt.execute();
    ResultSet rs = (ResultSet)stmt.getObject(1);And in SQL Server I can directly get the ResultSet by doing
    ResultSet rs = stmt.executeQuery();Also the query string will be different i.e.
    String query = "{call myStoredProc(?)}"DB2 will be same as Oracle I guess.
    So my question is , is there any generic way to get the ResultSet???
    Sorry if it sounds a dumb question.I am new to this arena..
    Thanks in advance
    Pankaj

    DB2 will be same as Oracle I guess.No. Getting the resultset in DB2 looks the same as that for SQL Server. Oracle is the only one that has a slightly different code.

  • User defined function and returning resultset

    Hi all,
    Following query, if I comment the statement in where clause which refers to a returning value of a function in the subquery, it takes 1 sec to finish. when uncomment it however, can't finish in 30 mins. Please help me on finding out the problem.
    I'm also wondering how to get a returning cursor in this case(to bypass above trouble)..
    Many thanks
    -s
    --pseudocode for how can I get a cursor in an anonymous block for host app
    begin
    -- get the resultset1 in someway
    select t1.showit,...
    from t1..;
    -- based on resultset1
    open myrefcursor for
    select * from resultset1 -- what is the resultset1?
    where resultset1.showit=1;
    end;
    --end pseudocode for getting a cursor
    -- hanging(takes too long) query (simplified)
    select t1.*,t2.account,t2.showit
    from (select t3.account,myfunc(t3.account) showit
    from tbl2 t3) t2,
    tbl1 t1
    where t1.account=t2.account
    and ...
    /* "hang" this query by uncomment this */
    -- and t2.showit=1;
    -- functions
    function myfunc(p_acc varchar2)
    return number is
    v_tmpdate date;
    v_invdate date;
    v_tmpcount number(8);
    v_accid number(8);
    v_curodisp number(14,4);
    v_curdisp number(14,4);
    v_curdisprev number(14,4);
    v_rowcount number(8);
    v_tmpshow number(8);
    p_vkey number(8);
    p_inv varchar(50);
    cursor cur(cv_vkey number, cv_accid number, cv_lastdate date) is
    select a.vkey vkey,a.invdate invdate, b.odisp odisp
    from inv a, recon b
    where a.vkey=cv_vkey
    and a.akey = cv_accid
    and a.invdate between to_date('01/01/2000','DD/MM/YYYY')
    and cv_lastdate
    and b.vkey = a.vkey
    and b.inv# = a.inv#
    order by invdate DESC;
    begin
    select vkey,inv#,akey, invdate into p_vkey,p_inv,v_accid, v_invdate
    from inv
    where akey = p_acc;
    v_tmpdate := add_months(v_invdate, 1);
    select count(*) into v_tmpcount
    from recon a, inv b
    where b.vkey = p_vkey
    and b.akey = v_accid
    and b.invdate between to_date('01/01/2000','DD/MM/YYYY')
    and v_tmpdate
    and a.inv# = b.inv#
    and a.vkey = b.vkey;
    if v_tmpcount = 0 then
    return 0;
    end if;
    v_rowcount := 0;
    for c1 in cur(p_vkey,v_accid,v_tmpdate) loop
    v_rowcount := v_rowcount + 1;
    v_curdisp := getcurdisp(c1.vkey,c1.inv#);
    v_curdisprev := getcurdisprev(c1.vkey,c1.inv#);
    v_curodisp := nvl(c1.odisp, 0) - v_curdisp - v_curdisprev;
    if v_curodisp >= 1000 then
    return 1;
    elsif v_curodisp = 0 then
    return 0;
    end If;
    end if;
    if extract(month from c1.invdate) in ('1','01')
    and extract(year from c1.invdate) = '2000' then
    select a.showodisp into v_tmpshow
    from acc a, inv b
    where b.vkey = c1.vkey
    and b.inv# = c1.inv#
    and a.akey = b.akey;
    return v_tmpshow;
    end If;
    end loop;
    return 0;
    end myfunc;
    function getcurdisp(p_vkey,p_inv)
    return number is
    v_tmp number(15,4);
    begin
    select sum(amount) into v_tmp
    from cost
    where vkey=p_vkey
    and inv#=p_inv
    and desc like '%disp';
    return v_tmp;
    end;
    function getcurdisprev(p_vkey,p_inv)
    return number is
    v_tmp number(15,4);
    begin
    select sum(amount) into v_tmp
    from cost
    where vkey=p_vkey
    and inv#=p_inv
    and desc like '%disprev';
    return v_tmp;
    end;

    Autotrace only showed the index usage on the main query, but nothing on the queries within the functions, so here is the tkprof that shows index usage on the queries within the functions.
    TKPROF: Release 9.2.0.1.0 - Production on Mon Jan 17 00:31:39 2005
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Trace file: ora92_ora_4092.trc
    Sort options: default
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    alter session set sql_trace=true
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        1      0.00       0.00          0          0          0           0
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 59 
    select t1.*, t2.account, t2.showit
    from   tbl1 t1,
           (select account, myfunc(account) showit
            from   tbl2) t2
    where  t1.account = t2.account
    and    t2.showit = 1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.11       1.81          0          1          0           0
    total        3      0.11       1.81          0          1          0           0
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 59 
    Rows     Row Source Operation
          0  NESTED LOOPS 
          0   INDEX FULL SCAN OBJ#(69662) (object id 69662)
          0   INDEX RANGE SCAN OBJ#(69661) (object id 69661)
    select user#
    from
    sys.user$ where name = 'OUTLN'
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.00       0.00          0          2          0           1
    total        3      0.00       0.00          0          2          0           1
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: SYS   (recursive depth: 2)
    Rows     Row Source Operation
          1  TABLE ACCESS BY INDEX ROWID USER$
          1   INDEX UNIQUE SCAN I_USER1 (object id 44)
    select a.vkey, a.invdate, b.odisp, a.inv#
         from   inv a, recon b
         where  a.akey = :b1
         and    a.invdate between to_date ('01/01/2000', 'DD/MM/YYYY')
                          and     add_months (a.invdate, 1)
         and    b.vkey = a.vkey
         and    b.inv# = a.inv#
         order  by a.invdate DESC
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.10          0          0          0           0
    Execute    105      0.00       0.01          0          0          0           0
    Fetch      105      0.01       0.01          0        309          0         100
    total      211      0.01       0.13          0        309          0         100
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 59     (recursive depth: 1)
    Rows     Row Source Operation
        100  SORT ORDER BY
        104   TABLE ACCESS BY INDEX ROWID RECON
        313    NESTED LOOPS 
        104     INDEX FULL SCAN INV_IDX (object id 69658)
        104     INDEX RANGE SCAN RECON_IDX (object id 69659)
    SELECT sum (amount)
      from   cost
      where  vkey = :b2
      and    inv# = :b1
      and    descr like '%disp'
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute    100      0.00       0.00          0          0          0           0
    Fetch      100      0.01       0.00          0        100          0         100
    total      201      0.01       0.01          0        100          0         100
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 59     (recursive depth: 1)
    Rows     Row Source Operation
        100  SORT AGGREGATE
          0   TABLE ACCESS BY INDEX ROWID COST
          0    INDEX RANGE SCAN COST_IDX (object id 69657)
    SELECT sum (amount)
      from   cost
      where  vkey = :b2
      and    inv# = :b1
      and    descr like '%disprev'
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute    100      0.00       0.00          0          0          0           0
    Fetch      100      0.01       0.00          0        100          0         100
    total      201      0.01       0.01          0        100          0         100
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 59     (recursive depth: 1)
    Rows     Row Source Operation
        100  SORT AGGREGATE
          0   TABLE ACCESS BY INDEX ROWID COST
          0    INDEX RANGE SCAN COST_IDX (object id 69657)
    SELECT a.showodisp
          from   acc a, inv b
          where  b.vkey = :b2
          and    b.inv# = :b1
          and    a.akey = b.akey
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute    100      0.01       0.00          0          0          0           0
    Fetch      100      0.03       0.00          0        299          0          99
    total      201      0.04       0.01          0        299          0          99
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 59     (recursive depth: 1)
    Rows     Row Source Operation
         99  TABLE ACCESS BY INDEX ROWID ACC
        299   NESTED LOOPS 
        100    INDEX RANGE SCAN INV_IDX (object id 69658)
         99    INDEX RANGE SCAN ACC_IDX (object id 69660)
    begin
        for x in ( select * from session_trace_file_name )
        loop
            if ( dbms_lob.fileexists( bfilename('UDUMP_DIR', x.filename ) ) = 1 )
            then
                insert into avail_trace_files (filename) values (x.filename);
            end if;
        end loop;
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.01       0.00          0          0          0           1
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.01       0.00          0          0          0           1
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 736     (recursive depth: 1)
    select *
    from
    session_trace_file_name
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2      0.00       0.00          0          0          0           1
    total        4      0.00       0.00          0          0          0           1
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 736     (recursive depth: 2)
    INSERT into avail_trace_files (filename)
    values
    (:b1)
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          3           1
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.00       0.00          0          0          3           1
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 736     (recursive depth: 2)
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      2      0.00       0.00          0          0          0           0
    Fetch        1      0.11       1.81          0          1          0           0
    total        4      0.11       1.81          0          1          0           0
    Misses in library cache during parse: 0
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        8      0.00       0.11          0          0          0           0
    Execute    409      0.02       0.04          0          0          3           2
    Fetch      408      0.06       0.03          0        810          0         401
    total      825      0.08       0.19          0        810          3         403
    Misses in library cache during parse: 4
        9  user  SQL statements in session.
        1  internal SQL statements in session.
       10  SQL statements in session.
    Trace file: ora92_ora_4092.trc
    Trace file compatibility: 9.00.01
    Sort options: default
           1  session in tracefile.
           9  user  SQL statements in trace file.
           1  internal SQL statements in trace file.
          10  SQL statements in trace file.
          10  unique SQL statements in trace file.
         945  lines in trace file.

  • Creating a function and return something from an XML file

    Hi!
    I'm working with timeline actionscript. I want to create a function that loads my xmlfile and returns an xmlobject with the file's content.
    This is what I got so far:
    my_btn.addEventListener(MouseEvent.CLICK, getXML("myxml.xml")); //1067: Implicit coercion of a value of type void to an unrelated type Function.
    function getXML(fn:String):void{
         var infoLoader:URLLoader = new URLLoader();
         infoLoader.addEventListener(Event.COMPLETE, xmlLoaded);
         infoLoader.load(new URLRequest(fn));
         var myXML:XML = xmlLoaded(); //1136: Incorrect number of arguments.  Expected 1.
         trace(myXML);
    function xmlLoaded(e:Event):XML{
         return e.target.data;
         //trace(e.target.data);
    Can anyone take a look and perhaps point me in the right direction?
    Thanks

    I have never used a listcomponent, so I can only help with the steps before filling it with data.
    I think you should at start of your application load the XML with filenames and just after it's completed, e.g. in Event.COMPLETE handler, load all other XMLs looping through filenamesXML, like this
    var filenamesXML:XML;
    var XMLsToLoad:uint = 0;
    function filenamesXMLLoaded(e:Event):void
         filenamesXML = XML(e.target.data);
         XMLsToLoad =  filenamesXML.filenames.children().length();
         for (var i:uint =1; i < filenamesXML.filenames.children().length(); i++)
                  getXML( filenamesXML.filenames.children()[i] ); // the function from my previous post, don't forget to implement it
    //modify the minor xml load handler from the previous post
    function xmlLoaded(e:Event):void
         var loadedXML:XML = XML(e.target.data);   
         xmlArray.push(loadedXML);
         XMLsToLoad--;
    //assign the one click handler to all buttons, a loop here would be quite handy
    function clickHandler(e:MouseEvent):void
         if (XMLsToLoad == 0) //check if all xmls have been completely loaded
              switch (e.target.name) // swith by clicked button's instance name
                   case "button_1":
                        // here you have to implement supplying listcomponent with data, I think a loop again will be a good idea
                        break;
                   case "button_2":
                        // ibid.
                        break;
    Regards,
    gc

  • Loading masterdata and transaction data from same flat file

    hi all,
    how can i load master data and transaction data from the same flatfile at a time.

    I am afraid it is possible.
    Go thru this Uploading Master & Transaction Data together from Flat File

  • Return Resultset from Procedure

    Hi --
    This may seem like a very elementary question, but can anyone tell me how to return a resultset from a function or procedure?
    Thanks,
    Christine

    if i understand your question correctly. a function return value is mandatory. while procedure is optional you had to use the out at the parameters. examples:
    CREATE OR REPLACE FUNCTION get_age (pBday Date) RETURN number IS
      vAge          Number := 0;
    BEGIN
      vAge := (Months_Between(sysdate,pBday) / 12);
      Return (vAge);
    END;
    CREATE OR REPLACE PROCEDURE get_age_procedure (pBday In Date, pAge Out Number) IS
    BEGIN
      pAge := (Months_Between(sysdate,pBday) / 12);
    END;
    /you need to create a reference cursor type object to achieve a result sets.
    CREATE OR REPLACE package TYPES AS
        TYPE cursorType IS REF CURSOR;
    END;

Maybe you are looking for

  • What is protected by a LabVIEW Semaphore?

    I can't seem to find a lot of documentation on LabVIEW Sempahores. I was wondering whether there is any firm guarantee as to what is protected by a semaphore and what is not protected by a semaphore. The only example I could find seemed to indicate t

  • Equipment Partner Change - Userexit

    Hello, if the ship-to-party for an Equipment in IE02 is changed we need to check if there are existing servicecontracts for the equipment and old ship-to-party. Because this contract need to be changed as well. Which userexit or BADI could we use for

  • How do i read pdf files on mac air, i have downloaded adobe reader and not working

    How do I read any files in pdf format? I have downloaded adobe reader yet have not been able to open pdf files?

  • Load Balance a Citrix Farm

    Been approached by our server team. They are having issues with DNS load distibution (won't call it balancing as there's no logic to it) with a 10 server Citrix Farm. It seems to me this would be a good candidate for L3 loadbalancing on a CSS 11500 s

  • Managing data and SOA

    Hello, Thanks for the help on the forum. We have been looking into open source software for data management and we would be interested in a similar field. We are wanting to implement SOA. It would be to complete our existing software. What would you