How to fire two queries in one bean

When I am trying to fire two queries using statement and result set
it is showing error "result set is closed".
How to fire two queries?

Just do it. The ResultSet should be the result of the query. So you're working on a wrong reference or something.

Similar Messages

  • How to Combine two queries into One

    Hi Gurus,
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Release 10.2.0.4.0 - 64bit Production
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL>
    I have following two queries. How I can convert these two queries into one with the same result ?
    Q1
    SELECT id,vdate,vendorname,venddate,vid
    FROM VENDOR
    WHERE processid=32
    AND venddate is null
    AND vid in(select vid from view_vid where type='PDX')
    AND (id,vdate) not in (select id,vdate from vkfl_is where task_id=55)
    AND (id,vdate) in (select id,vidate from market_data where marketed_date is null)
    AND id not in (select id from location)
    Q2
    SELECT id,vdate,vendorname,venddate,vid
    FROM VENDOR
    WHERE processid=20
    AND venddate is null
    AND vid in(select vid from view_vid where type='PBX')
    AND (id,vdate) not in (select id,vdate from vkfl_is where task_id=40)
    AND (id,vdate) in (select id,vidate from market_data where region_date is null)
    AND id not in (select id from location)
    I can UNION these two queries, but, is there any way I can write a single query with which gives me same result as above two queries?
    Any help would be highly appreciated
    Thanks in advance

    Hi,
    You can do something like this, which will be more efficient than a UNION:
    SELECT  id, vdate, vendorname, venddate, vid
    FROM  vendor
    WHERE  (   (    -- Conditions that apply only to q1
                               processid = 32
                AND  vid       IN (SELECT vid FROM view_vid WHERE type = 'PDX')
                AND (id,vdate) NOT IN ( SELECT id, vdate
                                        FROM   vkfl_is
                                        WHERE  task_id = 55
                AND (id,vdate) IN ( SELECT id, vidate
                                    FROM   market_data
                                    WHERE  marketed_date IS NULL
            OR  (  -- Conditions that apply only to q2
                     processid = 20
                AND  vid       IN (SELECT vid FROM view_vid WHERE type = 'PBX')
                AND (id,vdate) NOT IN ( SELECT id, vdate
                                        FROM   vkfl_is
                                        WHERE  task_id = 40
                AND (id,vdate) IN ( SELECT  id, vidate
                                    FROM  market_data
                                    WHERE  region_date IS NULL
                   -- The remaining conditions apply to both q1 and q2
    AND     venddate   IS NULL
    AND     id         NOT IN (SELECT id FROM location)
    I hope this answers your question.
    If not, post  a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How to combine two queries in one EXCEL

    hi i got one requirement
    i got one excel sheet  from user which contains two  report s(hoe we know whether it is worknook or not) of  2011 data and now user wants 2012 data .now i icluded jan 2012 to dec 2012 in two reports and sent to user.But user is asking these two reports want to see in one sheet.
    so how can i proceed: if i go for work  book  how can i include these two reports in workbook and here my doubt is if i create a workbook based on  these two querie which name i have to give user.Please help me out on the same.
    Regards,
    Madhu.

    Hi Madhu
    Run one query. Click on a empty space in the excel
    From the BEx Design Toolbar -
    >Insert Analysis Grid -
    > Right click on the Design Item
    Edit the DataProvider.....You can ran same or different query with selection. 
    Save the result
    Check this link for detail....I am also searching for something with screenshot
    Regards
    Anindya
    Edited by: Anindya Bose on Feb 14, 2012 3:04 AM

  • How to embed multiple queries in one web template

    Hi,
    I've a requirement wherein I need to embed two queries in one web template. The first query displays order quantity from a particular customer and the second query displays other information for that customer. Most of my web templates i've contains only one query which i've created using 0ADHOC template saving this as diff template and modifying it. But this is the first time I have got this type of requirement wherein the user drills down on a particular customer for order quantity and then goes for other information from other query.
    Does anyone out there has any idea or suggestion as to how to do this ? One more thing I need to pass the values from one query to another which is akin to RRI concept while staying in the same web template.
    Your suggestions/advices are highly appreciated.
    Thanks in Advance,
    Rash.

    Hi Rash,
    You can do this by including 2 table web items in your template and assiging the 2 different queries as different dataproviders to each. You can try to create a drop down box to filter the customer and in its properties set DataProvider1 and DataProvider2 as the affected data targets.
    Hope this helps...

  • Combining two queries in one..

    Hi,
    Can someone tell me how to combine follwoing two queries in one so that it will increase performance..
    SELECT single PLNNR from AFKO
           into T1
           WHERE AUFNR = '007200000100'.
    SELECT single STATU from PLKO
           into T2
           WHERE PLNNR = T1.

    using subqueries it is possible
    select single statu from plko into t2 where plnnr in (select single plnnr from afko where aufnr eq '007200000100').
    read about subqueries at this link...
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/dc7614099b11d295320000e8353423/frameset.htm
    regards,
    PJ

  • How to execute multiple queries in one stored procedure.

    Hi,
    I am Kumar,
    How to execute multiple queries in one stored procedure.
    here is the my requirements,
    1. get the max value from one table and sum of the that value.
    2. insert the values and also sum of the max value.
    using stored procedure
    I am using SQL server 2000 database.
    Please help me.
    Advance thanks
    by,
    Kumar

    This is not a java question and it is not even a problem: your only problem is
    1) lack of knowledge
    2) lack of interest to find a manual
    But you are going to have to change both by actually reading a book or a manual that explains the stored procedure language of SQL Server. It is the same as Sybase I think, so you could also look for a manual for that DBMS.

  • How to put two ipods on one computer

    how to put two ipods on one computer

    Set up the second exactly the same way as you set up the first. If iTunes is already installed, it doesn't need to be installed again.
    (64746)

  • How to sync two IPhone with one PC , but with different applications

    How to sync two IPhone with one PC , but with different applications ?
    We have two IPhones , but one PC , we want to sync separately , is that possible ?

    Absolutely, connect each phone, select what content you want on each phone, then hit the sync button. iTunes will keep everything straight, by device, upon subsequent syncs, including separate backups.

  • How to set two radius servers one is window NPS another is cisco radius server

    how to set two radius servers one is window NPS another is cisco radius server
    when i try the following command, once window priority is first , i type cisco radius user name, it authenticated fail
    i can not use both at the same time
    radius-server host 192.168.1.3  is window NPS
    radius-server host 192.168.1.1 is cisco radius
    http://blog.skufel.net/2012/06/how-to-integrating-cisco-devices-access-with-microsoft-npsradius/
    conf t
    no aaa authentication login default line
    no aaa authentication login local group radius
    no aaa authorization exec default group radius if-authenticated
    no aaa authorization network default group radius
    no aaa accounting connection default start-stop group radius
    aaa new-model
    aaa group server radius IAS
     server 192.168.1.1 auth-port 1812 acct-port 1813
     server 192.168.1.3 auth-port 1812 acct-port 1813
    aaa authentication login userAuthentication local group IAS
    aaa authorization exec userAuthorization local group IAS if-authenticated
    aaa authorization network userAuthorization local group IAS
    aaa accounting exec default start-stop group IAS
    aaa accounting system default start-stop group IAS
    aaa session-id common
    radius-server host 192.168.1.1 auth-port 1812 acct-port 1813
    radius-server host 192.168.1.2 auth-port 1812 acct-port 1813
    radius-server host 192.168.1.3 auth-port 1645 acct-port 1646
    radius-server host 192.168.1.3 auth-port 1812 acct-port 1813
    privilege exec level 1 show config
    ip radius source-interface Gi0/1
    line vty 0 4
     authorization exec userAuthorization
     login authentication userAuthentication
     transport input telnet
    line vty 5 15
     authorization exec userAuthorization
     login authentication userAuthentication
     transport input telnet
    end
    conf t
    aaa group server radius IAS
     server 192.168.1.3 auth-port 1812 acct-port 1813
     server 192.168.1.1 auth-port 1812 acct-port 1813
    end

    The first AAA server listed in your config will always be used unless/until it becomes unavailable. At that point the NAD would move down to the next AAA server defined on the list and use that one until it becomes unavailable and then move to third one, and so on. 
    If you want to use two AAA servers at the same time then you will need to put a load balancer in front of them. Then the virtual IP (vip) will be listed in the NADs vs the individual AAA servers' IPs. 
    I hope this helps!
    Thank you for rating helpful posts!

  • How can update two rows in one query?

    How can update two rows in one query?
    Edited by: OracleM on May 4, 2009 12:16 AM

    What do you mean with "two rows"? May be two columns??
    If the where clause of UPDATE query matches two rows, then it will update two rows. If you want to update two columns, then add column names to your query
    UPDATE your_table SET col1=value1, col2=value2 WHERE your_where_clause- - - - - - - - - - - - - - - - - - - - -
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • Two Queries in one XSQL-Template

    Hi there,
    is it possibile to use two queries in one xsql-template, which are generated two seperated trees of XML?
    I think about something like that
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsql:query connection="bynet"
    null-attribute-indicator="true"
    xmlns:xsql="urn:oracle-xsql"
    rowset-element = "COLLECTION"
    tag-case="upper"
    row-element = "FIELD"
    id-attribute = "">
    select c_formtype from offer_collection
    </xsql:query>
    <xsql:query connection="bynet"
    null-attribute-indicator="true"
    xmlns:xsql="urn:oracle-xsql"
    rowset-element = "COLLECTION2"
    tag-case="upper"
    row-element = "FIELD"
    id-attribute = "">
    select c_formtype from offer_collection2
    </xsql:query>
    which should give me
    <COLLECTION>
    <FIELD>
    <C_FORMTYPE>lala</C_FORMTYPE>
    </FIELD>
    </COLLECTION>
    <COLLECTION2>
    <FIELD>
    <C_FORMTYPE>lala</C_FORMTYPE>
    </FIELD>
    </COLLECTION2>
    Any way to do this?
    Thanx for help,
    Christian Hartmann

    Sure, just enclose two <xsql:query> tags by any other outer tag:
    <something xmlns:xsql="urn:oracle-xsql" connection="demo">
    <xsql:query> select * from emp </xsql:query>
    <xsql:query> select * from dept</xsql:query>
    </something>

  • How to show two queries/ aggregation levels in one Chart in Web Template

    Hi Experts,
    I have a question regarding showing a graph in a Web Application template.
    The graph has two elements on it.  The key figure is average number of working days, but the requirement is to compare number of working days for a granular data level (time spent in each process stage per month) to the average across all process stages across the entire month.
    So essentially what we have is a chart with one constant horizontal line across it, which is the overall average, across all process stages, for the whole month, and then underneath this horizontal line, a series of columns showing the average for each process stage, broken down.
    I am having trouble getting the base query right for this requirement.  It feels like for each process stage, I need two key figures (for the two data series); one average per stage, and the other should be the overall average, populated once for each stage.
    I couldn't make this work using cells or replacement path, and I assume that you can only use one data provider per chart in the WAD.
    Can anyone help me?  Please let me know if you need more info.  It's a shame I can't post a picture of the required graph in this post.
    Thanks
    Mischa

    Hi Mischa,
    If I am reading your description correctly you should be able to model your two Key Figures in the query by having the two Key Figures exactly the same, exept give one an exception aggregation to average with reference to characteristic 0CALMONTH.
    So you have your business process and calendar month in your rows, and the two Key Figures in the columns one with standard aggregation and one with exception aggregation on month. This should give you the KF amount per process wthin each month as well as the average KF amount over the month.
    Hope this helps,
    Nick

  • How do i run two queries in one worksheet?

    Hi
    I am new to Disco and am finding some things easy to fathom and others not so.
    I have a table with fields
    callref
    logdate
    closedate
    I want to be able count the number of calls logged each month/year and the number of calls closed.
    So, I want to do 2 counts, each count applying a slightly different condition. I would then end up with data along the lines of:
    Month, Number Logged, Number Closed
    which I could then turn into a graph.
    I am assuming there must be an obvious way ...
    Sapphie
    Edited by: user12160673 on Feb 8, 2010 8:49 AM

    Hi Lee
    There's a couple of ways of doing this. I think the simplest would be create two calculations, one for Number Logged and one for Number Closed.
    For Number Logged presumably this is just the count of all rows returned in the worksheet? You can use COUNT(ROWNUM) for that calculation.
    For the Number Closed you only want to count those that have a closedate - yes? If so, this will work:
    SUM(CASE WHEN closedate is NOT NULL THEN 1 ELSE 0)
    Another way to do this, would be to create two analytic calculations, one for each count. The syntax for an analytic count is as follows:
    COUNT(item) OVER (filters)
    The item will be the thing you are counting. The filters can be left empty, in which case the count will be determined by all rows in the worksheet. If you want the count to be only on a subset of the rows then you need to provide one or more filters. Typical filters are page items and group sorted items.
    An example of a count over the whole query is:
    COUNT(callref) OVER ()
    Best wishes
    Michael

  • Two queries to one question or how to query TV Scheduler

    In my procedure I need to query an existed view, which has the follow columns: broadcasting_day_id (unique), broadcasting_date, channel_id and version and so.
    If I have broadcasting_day_id, than I need to use WHERE broadcasting_day_id = my_parameter_1, if no, than I use WHERE broadcasting_date = my_param_2 AND channel_id = my_param_2 AND version = my_param_3.
    Right now I have implemented it using IF broadcasting_day_id is not null THEN SELECT .... FROM .... WHERE broadcasting_day_id = my_param_1 ELSE WHERE
    broadcasting_date = my_param_2 AND channel_id = my_param_2 AND version = my_param_3.
    I would like to know if this is a good approach and if there is a way to combine those two statements in one, please?
    Thanks in advance

    Hi,
    If your query is fairly complicated and you don't like to repeat it, you could try something like:
    WHERE  broadcasting_day_id =   NVL2 (my_parameter_1, my_parameter_1, broadcasting_day_id)
           AND broadcasting_date = NVL2 (my_parameter_1, broadcasting_date, my_param_2)
           AND channel_id =        NVL2 (my_parameter_1, channel_id, my_param_3)
           AND version =           NVL2 (my_parameter_1, version, my_param_4);(Assuming you have four different parameters, you mentioned p2 twice)
    Regards
    Peter
    Edit:
    Yes, I know - looks kinda stupid after Ganesh got his nvl2 logic right ;)
    Edited by: Peter on Apr 27, 2011 1:44 PM

  • How to Insert two queries in a single workbook in BI 7 ?

    Hi,
               I am trying to insert two queries in a single workbook. The queries are of Accounts Receivable.I have inserted one query in a workbook , but am not able to proceed to inserting the second query. In BEx analyzer, in design mode , using analysis grid , i tried inserting the second query but when saving and running, i am getting message " Variables are present, change their values " . should i maintain same variables for two queries ? i am stuck up. please explain me as how can this be done.
    Roja.

    Hi,
    If you get the message "Variables are present, change their values" ,it means that the query which you inserted having variables.
    You just click the "Change Variables" icon in the Analysis Toolbox,which will invoke the variable screen.
    Set the values in the variable screen and click OK.
    Now you will be able to see the data in the grids based on the values selected in the variable screen.
    Both queries data will be displayed in the workbook.
    Let me know in case of any clarifications!
    Rgds,
    Murali

Maybe you are looking for

  • The MSI GT72 Dominator Pro Owner's Lounge

    Hi Folks, this will be a work in progress, and will be updated as more information becomes available. This topic is also discussed at the NBR forum, HERE! ***The MSI GT72 Dominator Pro..... the next great SUPER POWER..... awesomely SEXY too!*** Welco

  • How to send data from internal table to the shared folder in ABAP

    Hi experts,          My requirement is to transfer data from a file to shared folder. i just did reading data from a file to a internal table. Now i want to send this internal table data into a shared folder which is  " xxx\y\z....". I do not have an

  • Can I use a 40GB Hard Drive in my iMac G3 (Tray-Loader)?

    Can I use a 40GB Hard Drive in my iMac G3 (Tray-Loader)? Any help gladly appreciated! Thanks, Sean Butler

  • ALV Help plz urgent

    Hi, Can anyone help me with ALV that how to display ALV Column Heading in Multiple Line. Means Multiple line Coulmn heading of ALV. Please fell free to contact me at [email protected] Regards, Muhammad Usman Malik SAP ABAP Consultant Siemens Pakistan

  • AIX barcode fonts related

    Hi All, I am having one report calling form(fmx) and one report layout (rdf) , once the report is called system directly printing to a Network Printer. But the requirement is : In the Report layout if any column to be displayed as Bar Code then it is