Is it possible to put the results from a query in a variable to use in the bean class?

Hello, I'm using JDeveloper 12.1.2.0.0
I would like to keep the result of my queries (the method i created in the AppModule) in a RichTable or other type of variable so i can have the results stored and i don't have to do unnecessary queries after. I don't think the query is the problem but keeping the results.
I've tried to do that by using this:
    public String testVFactSales(String conditions) {
        PreparedStatement query = getDBTransaction().createPreparedStatement("" + "select * from v_fact_sales " + conditions, 0);
        //ResultSet rs;
        ResultSet result;
        //RichTable result;
        //String result = null;
        try {
            //query.setString(1, conditions);
            // query.execute();
            query.execute();
            result = query.getGeneratedKeys();
            query.close();
            System.out.println("Result: " + result.toString());
            return result.toString();
        } catch (SQLException e) {
            e.printStackTrace();
        return "";
As you can see, i've already tried some solutions but so far i only get errors (cannot convert or null exception, when i try to put the result in a richtable in my bean class)
Any ideas?
This is very important for me, since it would improve the performance of my project a lot.
Regards,
Frederico.

Hey Arunkumar,
I came to this conclusion since i'm using binding variables with my where clauses.
I've measured the time and i get really bad time responses.
This is my main table query, where all the others selections will be filter the search in this table:
SELECT VFactSalesNew.N_SALES,                              
       VFactSalesNew.QUANTITY,                              
       VFactSalesNew.PRICE,                               ,                              
       VFactSalesNew.FK_STORE,                              
       VFactSalesNew.ID_ANO,                              
       VFactSalesNew.QUARTER   
FROM V_FACT_SALES_NEW VFactSalesNew                              
WHERE                                          
((nvl(:var_dimCoin,'0') ='0' OR FK_COIN IN (select * from THE(select cast( in_list(:var_dimCoin) as mytableType ) from dual ) a) )                                                   
AND                                                 
(nvl(:var_dimProduct,'0') ='0' OR FK_PRODUCT IN (select * from THE(select cast( in_list(:var_dimProduct) as mytableType ) from dual ) a) )                                                  
AND                                                 
(nvl(:var_dimCustomer,'0') ='0' OR FK_CUSTOMER IN (select * from THE(select cast( in_list(:var_dimCustomer) as mytableType ) from dual ) a) )                                                 
AND                                                 
(nvl(:var_dimStore,'0') ='0' OR FK_STORE IN (select * from THE(select cast( in_list(:var_dimStore) as mytableType ) from dual ) a) )                                                
AND                                                 
(nvl(:var_dimSeller,'0') ='0' OR FK_SELLER IN (select * from THE(select cast( in_list(:var_dimSeller) as mytableType ) from dual ) a) )                                                  
AND                                                 
(nvl(:var_dimProject,'0') ='0' OR FK_PROJECT IN (select * from THE(select cast( in_list(:var_dimProject) as mytableType ) from dual ) a) )                                                  
AND                                                 
(nvl(:var_ano, '0') ='0' OR ID_ANO IN (select * from THE(select cast( in_list(:var_ano) as mytableType ) from dual ) a) )                                                  
AND                                                 
(nvl(:var_treemap,'0') ='0' OR PK_REGION IN (select * from THE(select cast( in_list(:var_treemap) as mytableType ) from dual ) a) )                                                  

Similar Messages

  • SSRS - How to display all the results from a query and then be able to filter the data

    Let's say I have a simple query that will return products name, ID, price
    SELECT pname,
    pID,
    price
    FROM products
    When I display the results in SSRS the user will (without entering any parameters) see something like:
    Product Name | ID | Price
    xyz                    1     $10.00
    .zzz                    10   $4,000.00
    How can I filter my results once they are displayed? For instance, Out of the results the user wants to see only the products where price is between $10 and $3000?
    -Alan

    Hi Visahk,
    Maybe I did not explain my issue very good. 
    I want the user to first see all results (without entering the price range) - then if he wants she/he can filter the results by price.
    As soon as I add 
    WHERE price BETWEEN @StartPrice AND @EndPrice
    to my SQL query, the user is prompted to enter a price range before seeing any data.
    -Alan
    Ok for that what you can do is to set allow null value property for the parameters.
    Then set NULL as default value for parameters in parameter properties tab
    and make the query as below
    WHERE price BETWEEN @StartPrice AND @EndPrice
    OR (@StartPrice IS NULL AND @EndPrice IS NULL)
    and then report will get executed without waiting for any prompt and user may change values at a later stage and rerun it
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to tokenize the result from a query

    Hi,
    I need some help in writing a query or stored procedure for the following scenario
    select rname from emp where username='user200';
    This query will return the result,as comma separated,in the format r100,r101,r102
    Now,I have to write another query using the above result like below
    select place from loc where rname in ('r100','r101','r102');
    Basically,I need to break the string 'r100,r101,r102' into 3 tokens.Can someone help me write a stored procedure or query for this?
    Thanks
    Ravi.

    Ravi, Try this.
    CREATE OR REPLACE procedure str_token
    is
    input_buffer varchar2(100);
    var1 varchar2(10);
    var2 varchar2(10);
    var3 varchar2(10);
    n1 number(4);
    n2 number(4);
    n3 number(4);
    cursor c1 is
    select place from loc1 where rname in (var1,var2,var3);
    begin
    select rname into input_buffer from emp1 where username='user200';
    n1 := instr(input_buffer,',',1,1);
    n2 := instr(input_buffer,',',1,2);
    n3 := length(input_buffer) + 1 ;
    select
    substr(input_buffer,1,n1-1),
    substr(input_buffer,n1+1,n2-n1-1),
    substr(input_buffer,n2+1,n3-n2-1)
    into var1, var2, var3
    from dual;
    for i in c1
    loop
    dbms_output.put_line('place:'||i.place);
    end loop;
    end;
    Regs,
    Karthik

  • Can we use Result from another query in Webi using Bex uery universe?

    Hi,
    Can we use Result from another query filter option in Webi to create a report using a Bex Query universe?
    I need to create a report using two universes, one is Bex Query Universe and the other is Orcle universe. I have two queries, one is using Oracle universe; the other using Bex Query universe. I need to pass the Oracle data from the Oracle query to the Bex Query query to get the matched data from SAP Bex query.
    I used Result from another query in the query filter panel for the query using Bex query universe. But I got an error saying that 'A filter contains a wrong value. you cannot run this query. (Error: WIS 00007). The data used in the filter on both sides are the same. they are char.
    I have tested by using two queries from the same Bex query universe to see if the Result from another query filter option works. And I got the same error.
    Has anyone run into the same issue and if this is possible and what should be the solution?
    Thanks in advance!
    Edited by: BO_Haiyan on Oct 6, 2010 3:47 PM

    In that situation:
    Create two queries : Oracle and BW query.
    @ Report:
    As you have to see result set from both the Dataproviders, correct? To achieve thise one must have common dimension objects to merge them at report and use Objects those are coming from both queries to use them in single Table/Report.
    Unless you don't use Merge Dimensions, you don't get a chane to use both queries objects in single Table/Report. (It will give tooltip saying: You can't drop here -- Incompatable Objects)
    In case, if you don't have common dimensions, change object definitions to Detail objects, for those required.
    Hope it helps you.
    Thank You!!

  • Query on results from another query

    Post Author: Duncan1980
    CA Forum: Crystal Reports
    Is it possible to query on the results from another query.  I have a query that produces a list of document numbers.  I want to use the output from that query as the filter criteria in a another query in the same Universe. 
    The output from the first query can be as much as 2000, so it would be very time consuming to cut and paste these into a filter.
    Both reports are built, but can not figure out how to link the first report output to the filtering criteria on the second report.  I
    I am using business objects XI release 2 web intelligence 11.5.3.417 enterprise.

    Hi Vivek,
    It was not directly solved but I applied alternate logic to over come the issue.
    Here's what I did to overcome:
    I used a sub query in place of the whole result from another query.
    For Ex:
    Dim1 inlist result from another query1
    I made it as
    Dim1 inlist (Dim0)
    where Conditions.
    Here Dim0 is the object which we use for Result from another query and Conditions will be the necessary filter conditions to arrive proper Dim0.  Make sure proper context is formed for the sub query.
    Even though it resolved my problem, It introduces an new issue. It causes increase in query run time when huge set of data is returned from sub query.
    Please let me know if i haven't explained clearly.
    Hi Aris_BO,
    Sorry for not responding earlier.  The logic would probably make more queries null & not null. Thats why I was not advised to use it.
    Thanks
    LN

  • Combine query, result from another query on SAP BI query Universe?

    Hello all,
    We are using SAP BI queries as datasource for our universes. Is the combined query option disabled for webi reports written on such universes?
    result from another query - is this option active for such webi reports? I see both these options greyed out so wanted to check.
    One last thing what is really difference between subquery and results from another query? subquery - you can use filters from that one data provider only right? or can you use a different data provider/report in sub query?
    Thanks a lot for all the replies.

    Hi,
    in BO 3.1 Combined query and result from another query options are not available in webi report on OLAP Universes  (SAP BW Universe.)
    Thanks,
    Amit

  • Using the results of one Query in a workbook as a filter in another query

    Hello!
    I'd like to have one workbook which my users can execute and the result from one Query (e,g, Customer Account Number) will then be used as a filter in a second query (which would be from a different cube).
    Can this be done?
    Cheers.

    Hi,
    As far as I understand your requirement, you want to pass the result of one query to another query as a filter.
    Well you can do this, by Using Replacement Path Variable.
    For e.g. you want to pass Values of Custmomer Account Number to another query. In the second query, create one variable on Customer Account Number with type Replacment Path. Here it will ask you to enter the name of the query from which you would like to take the values of Customer Account Number.
    When you will run the second query , it will execute the first query from which you want to read the customer accoutn number in the back-end. And it willl display the output the second query as per the valeus of customer account number.
    This will help.
    - Jaimin

  • Is it possible to have the result from webservices with oracle8i

    hi,
    i call webservices MS .net with package utl_http under oracle 8i.
    exemple:
    DECLARE
    x utl_http.html_pieces;
    msg varchar2(12);
    BEGIN
    x := utl_http.request_pieces('http://localhost/ServiceNotification/Notification.asmx/NotifT?messagetmp=' || msg);
    END;
    I don't know how to have a result from a webservices!
    thanks for helping me.

    While the following paper is Oracle9i DB specific, conceptually, what is done should work with Oracle8i.
    Bear in mind that the use of XMLType is specific to Oracle9i DB R2 so if you were to follow the example, you would have to use varchars and probably acept the result into the PL/SQL XML Parser. See:
    http://otn.oracle.com/tech/webservices/htdocs/samples/dbwebservice/DBWebServices.html
    Mike.

  • HT201250 Is there a possibility to recover erased files from an external hard drive that was reformatted by the Time Machine?

    Is there a possibility to recover erased files from an external hard drive that was reformatted by the Time Machine?

    Basics of File Recovery
    Files in Trash
    If you simply put files in the Trash you can restore them by opening the Trash (left-click on the Trash icon) and drag the files from the Trash to your Desktop or other desired location.  OS X also provides a short-cut to undo the last item moved to the Trash -press COMMAND-Z.
    If you empty the Trash the files are gone. If a program does an immediate delete rather than moving files to the Trash, then the files are gone.  Recovery is possible but you must not allow any additional writes to the hard drive - shut it down. When files are deleted only the directory entries, not the files themselves, is modified. The space occupied by the files has been returned to the system as available for storage, but the files are still on the drive. Writing to the drive will then eventually overwrite the space once occupied by the deleted files in which case the files are lost permanently. Also if you save a file over an existing file of the same name, then the old file is overwritten and cannot be recovered.
    General File Recovery
    If you stop using the drive it's possible to recover deleted files that have not been overwritten by using recovery software such as Data Rescue II, File Salvage or TechTool Pro.  Each of the preceding come on bootable CDs to enable usage without risk of writing more data to the hard drive.  Two free alternatives are Disk Drill and TestDisk.  Look for them and demos at MacUpdate or CNET Downloads.
    The longer the hard drive remains in use and data are written to it, the greater the risk your deleted files will be overwritten.
    Also visit The XLab FAQs and read the FAQ on Data Recovery.

  • How do i put the result of a sum in a variable ?

    Hi All...
    I have two columns in my template, one is debit and another one is credit...
    I did a sum in debit column and a sum in the credit column...
    Now i need to subtract the sum of debit from the sum of credit,
    i was thinkin about put these results in a variable (something like make a "sumResultA" and "sumResultB" and make a field like this <?((sumResultA) - (sumResultB))?>...
    so... how do i put the result of a sum in a variable ???

    <?xdoxslt:set_variable($_XDOCTX, 'variablesumResultA', (sumResultA))?>
    <?xdoxslt:set_variable($_XDOCTX, 'variablesumResultB', (sumResultB))?>
    <?xdoxslt:set_variable($_XDOCTX, 'variablesumResultAB', ((sumResultA) - (sumResultB)))?>to set the, use as above.
    to display them
    <?xdoxslt:get_variable($_XDOCTX, 'variablesumResultB')?>
    <?xdoxslt:get_variable($_XDOCTX, 'variablesumResultA')?>
    <?xdoxslt:get_variable($_XDOCTX, 'variablesumResultAB')?>

  • Is it possible to uninstall IE 11 from Windows Server 2012 R2 and replace it with the latest version of IE 10?

    Is it possible to uninstall IE 11 from Windows Server 2012 R2 and replace it with the latest version of IE 10? We have a remote desktop farm setup with 2012 R2 servers and we are publishing some web links that only work with IE10. As a result, we need to
    downgrade the remote desktop servers to IE10. I have a feeling that this isn't possible, but if I could get a definitive answer, I would greatly appreciate it, thank you!

    Hi,
    Agreed with DonPick.
    Internet Explorer 11 is preinstalled with Windows 8.1 and Windows Server 2012 R2.
    More information regarding Internet Explorer 11, please check:
    Internet Explorer 11 - FAQ for IT Pros
    http://msdn.microsoft.com/en-us/library/dn268945.aspx
    Best regards
    Michael Shao
    TechNet Community Support

  • OBIEE Report - filter based on the result from another analysis

    Hi,
    I am using OBIEE 11g,
    I am trying to use a filter which is based on the result from another analysis. I have an analysis A which is as table 1, and I want to filter the respective columns of analysis B (Table B) based on analysis A to remove the duplicates for march 01, 02, and 07 , but it is not working properly. I took a max of start and end time when I created analysis A. Please let me know if I did anything wrong. thanks.
    Table 1
    Employee Number
    Date
    IN
    Out
    Start Time
    End Time
    xxxxxxx
    2015-02-26
    9:00
    13:00
    00:00:00
    00:00:00
    2015-02-27
    12:00
    18:00
    00:00:00
    00:00:00
    2015-02-28
    8:00
    14:00
    00:00:00
    00:00:00
    2015-03-01
    14:00
    20:00
    14:00:00
    20:00:00
    2015-03-02
    16:00
    20:00
    16:00:00
    20:00:00
    2015-03-07
    14:06
    20:02
    14:00:00
    20:00:00
    2015-03-11
    16:00
    20:00
    16:00:00
    20:00:00
    2015-03-14
    8:00
    14:00
    00:00:00
    00:00:00
    2015-03-25
    14:00
    20:00
    16:00:00
    20:00:00
    Table 2
    Employee Number
    Date
    IN
    Out
    Start Time
    End Time
    Hours
    xxxxxxx
    2015-02-26
    9:00
    13:00
    00:00:00
    00:00:00
    -3
    2015-02-27
    12:00
    18:00
    00:00:00
    00:00:00
    6
    2015-02-28
    8:00
    14:00
    00:00:00
    00:00:00
    6
    2015-03-01
    14:00
    20:00
    00:00:00
    00:00:00
    6
    14:00:00
    20:00:00
    6
    2015-03-02
    16:00
    20:00
    00:00:00
    00:00:00
    4
    16:00:00
    20:00:00
    4
    2015-03-07
    14:06
    20:02
    00:00:00
    00:00:00
    6
    14:00:00
    20:00:00
    6
    2015-03-11
    16:00
    20:00
    16:00:00
    20:00:00
    4
    2015-03-14
    8:00
    14:00
    00:00:00
    00:00:00
    6
    2015-03-25
    14:00
    20:00
    16:00:00
    20:00:00
    4

    Why avg here?
    What columns you want to show in the report?
    for a employee for given date if he have 2 rows then you may sum up hours right?
    Employee Number
    Date
    IN
    Out
    Start Time
    End Time
    Hours

  • HT201812 In the past it was possible to delete songs/tones from iTunes but this no longer seems to be the case.  Is it possible to delete songs or tones if they are not duplicated - I just no longer want them in my library?

    In the past it was possible to delete songs/tones from iTunes but this no longer seems to be the case.  Is it possible to delete songs or tones if they are not duplicated - I just no longer want them in my library?

    Howdy SJHocking,
    It sounds like you want to know how to dele songs and ringtones from iTunes. Take a look at the article linked below, it’ll walk you through the process of deleting content from iTunes.
    Delete songs, playlists, or other items - iTunes Help
    If you have iTunes Match enabled, take a look at this article which will walk you through the process of deleting songs from iCloud.
    iTunes Store: How to delete songs from iCloud - Apple Support
    Cheers,
    -Jason

  • How to export the result from executing sql statement to excel file ?

    HI all,
    Great with Oracle SQL Developer, but I have have a trouble as follwing :
    I want to export the result from executing sql statement to excel file . I do easily like that in TOAD ,
    anyone can help me to do that ? Thanks so much
    Sigmasvn

    Hello Sue,
    I just tried to export to excel with the esdev extension and got java.lang.NumberFormatException. I found the workaround at Re: Windows Multi-language env, - how do I set English for application lang?
    open the file sqldeveloper\jdev\bin\sqldeveloper.conf and add the following two lines:
    AddVMOption -Duser.language=en
    AddVMOption -Duser.country=USyet now my date formats in excel are 'american-style' instead of german. For example 01-DEC-01 so excel does not recognize it as date and therefore I can not simply change the format.
    When export to excel will be native to 1.1 perhaps someone can have a look at this 'feature'
    Regards
    Marcus

  • If the result from the stored procedure returns 0 rows I get this error returned:

    If the result from the following stored procedure returns 0
    rows I get this error returned:
    faultCode:Server.Processing faultString:'Variable transfers
    is undefined.' faultDetail:''
    How can I get round this?

    Well if I try this in a cfm page:
    <cfstoredproc procedure="GetTransfers"
    datasource="datasource" returncode="true">
    <cfprocparam type="in" cfsqltype="CF_SQL_VARCHAR"
    value="4">
    <cfprocparam type="in" cfsqltype="cf_sql_date"
    value="12/09/2006 08:42:00">
    <cfprocparam type="in" cfsqltype="cf_sql_date"
    value="12/09/2008 08:42:00">
    <cfprocresult name="transfers">
    I get an error like:
    [Macromedia][SQLServer JDBC Driver][SQLServer]Procedure or
    function 'GetTransfers' expects parameter '@fromdate', which was
    not supplied.
    But this procedure only accepts 3 parameters.

Maybe you are looking for

  • New window with same document

    I'm considering switching from Excel to Numbers, and looking at the functions I use the most. In Excel I often have 2 windows open with the same document (one with my income, and one with my expenses for instance). Are you able to open a new window o

  • Third-party editing

    Hi - I wonder if I build a site in Muse, can I later host it outside - from i.e. GoDaddy -- and still have third party editing capablilty?  How does this work?  The domain name for the site I am building already exists - so it would also be fine if I

  • Funtion Module: SO_NEW_DOCUMENT_ATT_SEND_API1-How to add TO and CC email id

    In the Funtion Module: SO_NEW_DOCUMENT_ATT_SEND_API1- How to add TO and CC email ids? In the TABLE parameter RECEIVERS, there is field RECEIVER where we pass email ids and field COPY which should be 'X'. But my concern is how will it distinguish that

  • I can't get the construction guides to work

    I like to use the construction guides in Illustrator, however I can't get them to work. I have it checked off in Preferences. Please help!

  • ASR9K NTP Question

    Hello all,  I received a report from one of the ASR9Ks and when I checked the log and did a little research using this site(http://www.cisco.com/c/en/us/td/docs/ios_xr_sw/iosxr_r4-2/error/messages/em42sems/em42ip.html) and  here is what I found out: