Result Set fetching data not sequentially?

The result set I am using to fetch data from a table in MS-Access following the query "select * from fun",is fetching the recors but not sequentially from data base? How do I fix that?
Thanx in adv
Amit

If you want your data in a particular order then you must include an ORDER BY clause in your SQL. Otherwise the database may return the data in any order it finds convenient.

Similar Messages

  • JDBC-ODBC Bridge to SPSS data files - Result Set Type is not supported

    Hello,
    As mentioned in the subject I am trying to read SPSS data files using the SPSS 32-Bit data driver, ODBC and the JDBC-ODBC Bridge.
    Using this SPSS Driver I manged to read the data directly into an MS-SQL Server using:
    SELECT [...] FROM
    OPENROWSET(''MSDASQL.1'',''DRIVER={SPSS 32-BIT Data Driver (*.sav)};DBQ=' SomePathWhereTheFilesAre';SERVER=NotTheServer'', ''SELECT 'SomeSPSSColumn' FROM "'SomeSPSSFileNameWithoutExt'"'') AS a
    This works fine!
    Using Access and an ODBC System DNS works for IMPORTING but NOT for LINKING.
    It is even possible to read the data using the very slow SPSS API.
    However, when it comes to JDBC-ODBC the below code does only work in part. The driver is loaded successfully, but when it comes to transferring data into the resultset object the error
    SQLState: null
    Result Set Type is not supported
    Vendor: 0
    occurs.
    The official answer from SPSS is to use .Net or to use their implementation with Python in their new version 14.0. But this is obviously not an option when you want to use only Java.
    Does anybody have experience with SPSS and JDBC-ODBC??? I have tried the possible ResultSet Types, which I took from:
    http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/rjvdsprp.htm
    and none of them worked.
    Thank you in advance for your ideas and input & stay happy!
    Here the code without all the rest of the class arround it:
    // Module:  SimpleSelect.java
    // Description: Test program for ODBC API interface.  This java application
    // will connect to a JDBC driver, issue a select statement
    // and display all result columns and rows
    // Product: JDBC to ODBC Bridge
    // Author:  Karl Moss
    // Date:  February, 1996
    // Copyright: 1990-1996 INTERSOLV, Inc.
    // This software contains confidential and proprietary
    // information of INTERSOLV, Inc.
    public static void main1() {
      String url   = "jdbc:odbc:SomeSystemDNS";
      String query = "SELECT SomeSPSSColumn FROM 'SomeSPSSFileName'";
      try {
        // Load the jdbc-odbc bridge driver
        Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
        DriverManager.setLogStream(System.out);
        // Attempt to connect to a driver.  Each one
        // of the registered drivers will be loaded until
        // one is found that can process this URL
        Connection con = DriverManager.getConnection (url);
        // If we were unable to connect, an exception
        // would have been thrown.  So, if we get here,
        // we are successfully connected to the URL
        // Check for, and display and warnings generated
        // by the connect.
        checkForWarning (con.getWarnings ());
        // Get the DatabaseMetaData object and display
        // some information about the connection
        DatabaseMetaData dma = con.getMetaData ();
        System.out.println("\nConnected to " + dma.getURL());
        System.out.println("Driver       " +
          dma.getDriverName());
        System.out.println("Version      " +
          dma.getDriverVersion());
        System.out.println("");
        // Create a Statement object so we can submit
        // SQL statements to the driver
        Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY ,ResultSet.CONCUR_READ_ONLY);
        // Submit a query, creating a ResultSet object
        ResultSet rs = stmt.executeQuery (query);
        // Display all columns and rows from the result set
        dispResultSet (rs);
        // Close the result set
        rs.close();
        // Close the statement
        stmt.close();
        // Close the connection
        con.close();
      }

    Thank you for your reply StuDerby!
    Actually the above script was before, as you suggested, leaving the ResultSetTeype default. This did not work...
    I am getting gray hair with SPSS - in terms of connectivity and "integratebility" none of their solutions offered is sufficient from my point of view.
    Variable definitions can only be read by the slow API, data can only be read by Python or Microsoft Products... and if you want to combine both you are in big trouble. I can only assume that this is a company strategy to sell their Dimensions Platform to companies versus having companies developping their applications according to business needs.
    Thanks again for any furthur suggestions and I hope, that some SPSS Developper will see this post!
    Cheers!!

  • RIDC api: The result set 'content' was not found or is empty

    Hi,
    I am trying to add a revision using COLLECTION_CHECKIN_REVISION. The content which I want to add a revision has only one revision i.e. 1,
    and its dID is 3746 and is already checked out.
    <code>
         binder.putLocal ("IdcService", "COLLECTION_CHECKIN_REVISION");
         // get the binder
         binder.putLocal ("dDocTitle", "Html file");
         binder.putLocal ("dDocName", "SUN00100");
         binder.putLocal ("dDocType", "Document");
         binder.putLocal ("dSecurityGroup", "Public");
         binder.putLocal("hasCollectionID", "true");
         binder.putLocal("dID", "3746");
         binder.putLocal("dRevLabel", "2");
         binder.putLocal("dCollectionID", this.getFolderIdFromPath(idcClient, userContext, PATH));
         System.out.println("dCollectionID###############################" +binder.getLocal("dCollectionID"));
         binder.addFile ("primaryFile", new TransferFile(new File("D:\\P6WS\\RIDC Test\\src\\com\\oracle\\ridc\\poc\\2.html")));
         // checkin the file
         response = idcClient.sendRequest(userContext, binder);
         System.out.println("response "+response.getResponseAsString());
    </code>
    And the output is as follows
    dCollectionID###############################739373434448003784
    response <?hda version="11gR1-11.1.1.5.0-idcprod1-110413T184243" jcharset=UTF-8 encoding=UTF-8?>
    @Properties LocalData
    deleteCompleteInCollections=true
    dDocType=Document
    refreshSubMonikers=
    dUser=sysadmin
    anyState=true
    primaryFile=2.html
    StatusMessage=<strong>The result set 'content' was not found or is empty.</strong>
    UserTimeZone=UTC
    localizedForResponse=1
    dDocName=SUN00100
    changedMonikers=
    I want to understand which content is being referred. The primaryFile is existing in the same location.
    Did I missed out any required parameter.
    regards,
    Sunil Kumar Dhage
    Edited by: 881595 on Aug 26, 2011 4:18 AM

    Like last time: documentation is not a big help here, so you have to do a bit of investigation yourself.
    In order to understand result sets, check this link: http://download.oracle.com/docs/cd/E17904_01/doc.1111/e10726/c04_master_usage.htm#CSIDO249
    ('content' is the name of the result set)
    I can't imagine why you would need such a result set while checkin in a new revision to a folder, but the documentation (http://download.oracle.com/docs/cd/E17904_01/doc.1111/e11011/c08_folders.htm#i1082329) advices that some sub services are called, so it might actually be an error coming from these subservices. I'd suggest to narrow down the search first - turn on requestaudit in server-wide tracing (see here: http://download.oracle.com/docs/cd/E17904_01/doc.1111/e10792/c02_processes.htm#CSMSP536).
    Alternatively, you could also perform your service call from GUI and trace what parameters are provided. I guess something will be missing.

  • Result Set fetch agonisingly slow

    I am having sporadic trouble retrieving data from a ResultSet. I do not know how to tell if it is an Oracle problem or a JDBC problem.
    In a while( results.next() ) loop, for some result sets it pauses for several seconds after every 10 iterations. This usually causes a webserver time-out and the results never get to the browser. It is NOT volume related, as some LARGER result sets from almost identical queries (i.e. with just one value in the where clause changed) run fine. We are using Oracle 8i, and the "problem" query always runs fine in SQLPlus (i.e. less than ten seconds for the execution and display of ~700 rows).
    some relevant evidence:
    a) Usually the PreparedStatement.execute() itself is pretty quick - just a few seconds at worst
    b) All result sets from this query pause every 10 iterations, but most pause for just a fraction of a second
    c) With a certain value in the where clause, the pauses are 4-30 seconds, which, even when only ~700 rows are returned, results in a response time of several minutes.
    d) The pauses are in the results.next() statement itself (I have output timestamps at the very beginning and the very end of the loop to show this).
    e) the query is a join of six tables
    f) the part of the where clause that changes is: AND FULFILLER.NAME IN (...) , where the IN clause can contain single or multiple names (but I am using a single value in the "problem" query)
    g) The FULFILLER.NAME column IS an indexed field, and that index IS being used (according to "EXPLAIN PLAN") in both the fast queries and the slow queries.
    What confuses me (amongst several things) is this: I would have thought that the values in the where clause would only affect the creation of the ResultSet, and not the reading of that result set. Am I wrong? Any ideas anyone?
    Thanks,
    Martin Reynolds (renozu)

    I am having sporadic trouble retrieving data from a
    ResultSet. I do not know how to tell if it is an
    Oracle problem or a JDBC problem.
    In a while( results.next() ) loop, for some
    result sets it pauses for several seconds after every
    10 iterations. This usually causes a webserver
    time-out and the results never get to the browser. It
    is NOT volume related, as some LARGER result sets from
    almost identical queries (i.e. with just one value in
    the where clause changed) run fine. We are using
    Oracle 8i, and the "problem" query always runs fine in
    SQLPlus (i.e. less than ten seconds for the execution
    and display of ~700 rows).
    some relevant evidence:
    a) Usually the PreparedStatement.execute() itself is
    pretty quick - just a few seconds at worst
    b) All result sets from this query pause every
    10 iterations, but most pause for just a fraction of a
    second
    c) With a certain value in the where clause, the
    pauses are 4-30 seconds, which, even when only ~700
    rows are returned, results in a response time of
    several minutes.
    d) The pauses are in the results.next() statement
    itself (I have output timestamps at the very beginning
    and the very end of the loop to show this).
    e) the query is a join of six tables
    f) the part of the where clause that changes is:
    AND FULFILLER.NAME IN (...) , where the IN
    clause can contain single or multiple names (but I am
    using a single value in the "problem" query)
    g) The FULFILLER.NAME column IS an indexed field, and
    that index IS being used (according to "EXPLAIN PLAN")
    in both the fast queries and the slow queries.
    What confuses me (amongst several things) is this: I
    would have thought that the values in the where clause
    would only affect the creation of the
    ResultSet, and not the reading of that result
    set. Am I wrong? Any ideas anyone?
    this honestly doesn't HAVE to be the case... depending on the cursor.
    i think if one has a forward only cursor the database could figure it out as it scans along the table. it should be fater in fact because if it does like this you only do one table scan and not two. this theory seems to fall apart when you say it is using the index BUT if I was writing a database and you had a forward only cursor AND the distribution of keys in the index indicated that there were many rows that would match your query I might ignore the index and do it as described.
    so call me crazy but here is my suggestion...
    if the cursor you are using is a forward only cursor then try a scrollable cursor.
    if it is already a scrollable cursor or changing it didn't help then try this...
    rs.last();
    rs.beforeFirst();
    // now process normally using next()i would think that this would force the database to find all the rows.... so it should help.
    also the server timeout issue will sort of need to be addressed also if the query still takes a long time to run...
    Thanks,
    Martin Reynolds (renozu)

  • Result set fetching

    I'm pretty sure this is basic stuff, and I should probably know this already, but here goes:
    when you execute a query through EntityManager, are results eagerly fetched, or are they being loaded as the result set is iterated through?
    I was wondering if when I iterate through only the first 5 results, is the whole result set still being populated?
    I've been learning this stuff for a while but, to make matters worse, I was required to learn some LINQ in the mean time, so similar concepts got messed up in my mind... thus this question.
    Thanks for the time!

    It would depend on the implementation of the JDBC driver what it does, but generally you're going to get eager fetching of at least the first level records.
    Linked records (non-primitive fields fetched from other tables) may be eagerly or lazily fetched depending on the configuration set. by default however those are eagerly fetched (and that's what JPA means when it talks about eager fetching).
    If your dependency tree is deep and the child records are needed relatively rarely (for example you're not going to display them initially after a fetch, but only when explicitly drilling down), lazy fetching of those can improve performance. If they are required to be fetched as the norm, lazy fetching there can cost performance, so it's a design decision that requires some thought.

  • FMPLUP-Plan uploading result OK while data not be posted, without Log

    Hi Expert
    I have created planning layout and assigned to planner profile with excel integration. I've got the file description to be specific in the Flxible Upload screen.
    When I upload data in transaction code FMPLUP, the result is OK. However, the plan data is not input to the layout / report. (I can directly post the planning in SAP.). I tried uploading by other file that not related to the file description. The result should be error but it still OK without any posting.
    How should I resolve this plan uploading issue?
    Rgds
    Ton

    First I want to ask about planning layout. What tcode did you use when you create the planning layout? Is FMPLLI?
    I ever created the planning layout with excel integration. Then I use tcode FMPLCPD to insert the budget planning with form based.

  • How can I display more than one record with result set meta data?

    Hi,
    My code:
        ArrayList<String> resultList = new ArrayList<String>();
        rs=ps.executeQuery();      
        ResultSetMetaData rsmd = rs.getMetaData();      
        while(rs.next()){      
         for(int k=1;k<=rsmd.getColumnCount();k++){            
            resultList.add(rs.getString(k)); 
        ps.close();       
        }catch(Exception e){                                 
        e.printStackTrace();      
        return resultList;
        public String test(ArrayList result)throws Exception{ 
        String data=         
            "<tr>"+ 
            "<td class=normalFont>"+result.get(0)+"</td>"+ 
            "<td class=normalFont>"+result.get(1)+"</td>"+ 
            "</tr>"; 
        return data; 
        }  All the things are wroking but the problem is that ArrayList is displaying just one record whereas I have more than 20 records to display. I tried with loop like: i<result.size(); and result.get(i) then its throwing exception
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 I stuck here for the last more than 2 days. Please help me
    Best regards

    Raakh wrote:
    Still waiting .....I would have answered much earlier, but when I saw this little bit of impatience, I decided to delay answering for a while.
    ArrayList<String> list = new ArrayList<String>();
    list.add("abc");
    list.add("def");
    list.add("ghi");
    System.out.println(list.get(0));
    abc
    System.out.println(list.get(1));
    def
    System.out.printnln(list);
    [abc, def, ghi]That list has 3 items. Each one is a String.
    But here is what you appear to be doing:
    select * from person
    +-----+-------------+-------------+--------+
    | id  |  first name |  last name  | height |
    +-----+-------------+-------------+--------+
    |   1 | Joe         | Smith       | 180    |
    +-----+-------------+-------------+--------+
    |   2 | Mary        | Jones       | 144    |
    +-----+-------------+-------------+--------+
    for each row in ResultSet {
      for each column in ResultSet {
        list.add(that element);
    // which becomes
    list.add(1);
    list.add("Joe");
    list.add("Smith");
    list.add(180);
    list.add(2);
    list.add("Mary");
    list.add("Jones");
    list.add(144);
    System.out.println(list.get(0));
    1
    System.out.println(list.get(1));
    Joe
    System.out.printlN(list);
    [1, Joe, Smith, 180, 2, Mary, Jones, 144]That list has 8 items. Some of them are Strings and some of them are Integers. I would assume that, for this sample case, you would want a list with 2 items, both of which are Person objects. However, it really isn't clear from your posts what you are trying to do or what difficulty you're having, so I'm just guessing.

  • Data set in Data not fill properly using ODP(Oracle.DataAccess.dll 64bit)

    public void BindFun()
                OracleParameter[] o_OracleParameters;
                OracleConnection o_Connection = new OracleConnection(VRODPConnection());
                OracleCommand o_OracleCommand = new OracleCommand();          
                OracleDataAdapter o_OracleDataAdapter;    
                DSSearchResults = new DataSet();
                // Narendra : 03/11/2014
                o_OracleParameters = new OracleParameter[16];
                o_OracleParameters[0] = new OracleParameter("iv_LastName", OracleDbType.Varchar2, ParameterDirection.Input);
                o_OracleParameters[0].Value = "";
                o_OracleParameters[1] = new OracleParameter("iv_FirstName", OracleDbType.Varchar2, ParameterDirection.Input);
                o_OracleParameters[1].Value = "";
                o_OracleParameters[2] = new OracleParameter("iv_MiddleName", OracleDbType.Varchar2, ParameterDirection.Input);
                o_OracleParameters[2].Value = "";
                o_OracleParameters[3] = new OracleParameter("iv_MotherMaidenLastName", OracleDbType.Varchar2, ParameterDirection.Input);
                o_OracleParameters[3].Value = "";
                o_OracleParameters[4] = new OracleParameter("v_SearchRangeFrom", OracleDbType.Varchar2, ParameterDirection.Input);
                o_OracleParameters[4].Value = "01-01-2014";
                o_OracleParameters[5] = new OracleParameter("v_SearchRangeTo", OracleDbType.Varchar2, ParameterDirection.Input);
                o_OracleParameters[5].Value = "12-01-2014";
                // "01-12-2014";//Narendra 04/11/14 14:17//
                o_OracleParameters[6] = new OracleParameter("v_RecordTypeId", OracleDbType.Varchar2, ParameterDirection.Input);
                o_OracleParameters[6].Value = "2,4,5";
              // IN this
                o_OracleParameters[7] = new OracleParameter("v_PagingRequired", OracleDbType.Int32, ParameterDirection.Input);
                o_OracleParameters[7].Value = 1;
                o_OracleParameters[8] = new OracleParameter("v_PageNum", OracleDbType.Int32, ParameterDirection.Input);
                o_OracleParameters[8].Value = 1;
                o_OracleParameters[9] = new OracleParameter("v_PageSize", OracleDbType.Int32, ParameterDirection.Input);
                o_OracleParameters[9].Value = 1000;
                o_OracleParameters[10] = new OracleParameter("v_SortFieldName", OracleDbType.Varchar2, ParameterDirection.Input);
                o_OracleParameters[10].Value = "VitalRecordsLastName";
                o_OracleParameters[11] = new OracleParameter("v_Sealed", OracleDbType.Int32, ParameterDirection.Input);
                o_OracleParameters[11].Value = 1;
                o_OracleParameters[12] = new OracleParameter("v_CurrentRecordsOnly", OracleDbType.Int32, ParameterDirection.Input);
                o_OracleParameters[12].Value = 0;
                o_OracleParameters[13] = new OracleParameter("v_AccessID", OracleDbType.Int32, ParameterDirection.Input);
                o_OracleParameters[13].Value = 5;
                o_OracleParameters[14] = new OracleParameter("v_TotalRecs", OracleDbType.Int32, ParameterDirection.Output);
                o_OracleParameters[14].Value = 0;
                o_OracleParameters[15] = new OracleParameter("pResult", OracleDbType.RefCursor);
                o_OracleParameters[15].Direction = ParameterDirection.Output;
                o_Connection.Open();
                o_OracleCommand.Connection = o_Connection;
                o_OracleCommand.CommandText = "VR_AllGeneral_Search";
                o_OracleCommand.CommandType = CommandType.StoredProcedure;
                o_OracleCommand.Parameters.AddRange(o_OracleParameters);      
                o_OracleDataAdapter = new OracleDataAdapter(o_OracleCommand);o_OracleDataAdapter.Fill(DSSearchResults);
               dataGridView1.DataSource = DSSearchResults.Tables[0];
                o_Connection.Close();
                o_Connection.Dispose();
              // 2 pass than ans total record =127 than after pass 4 ans =413 than after 5 ans=413
              // 4 pass than ans total record =286 than after pass 2 ans =413 than after 5 ans=413
               // 5 pass than ans total record =0 than after pass 2 ans =127 than after 4 ans=413
    What is the problem of above code pls info 

    Hi,
    but when i install oracle express edition 10g on that machine i am able to connect to the remote database
    Does the client machine have an Oracle Client installed before you do this at all? An Oracle Client is required in some fashion to use ODP.NET - either a full-client or the instant client if you are using a version that supports instant client.
    - Mark

  • How to return the result set of multiple select statements as one result set?

    Hi All,
    I have multiple select statements in my stored procedure that I want to return as one result set 
    for instance 
    select id from tableA
    union 
    select name from table b 
    but union will not work because the result sets datatypes are not identical so how to go about this ?
    Thanks

    You have to CAST or CONVERT (or implicitly convert) the columns to the same datatype.  You must find a datatype that both columns can be converted to without error.  In your example I'm guessing id is an int and name is a varchar or nvarchar. 
    Since you didn't convert the datatypes, SQL will use its data precedence rules and attempt to convert name to an int.  If any row contains a row that has a value in name that cannot be converted to an int, you will get an error.  The solution is
    to force SQL to convert the int to varchar.  So you want something like
    select cast(id as varchar(12)) from tableA
    union
    select name from tableb
    If the datatypes are something other that int or varchar, you must find a compatable datatype and then convert one (or both) of the columns to that datatype.
    Tom

  • Updateable scrollable result sets with join statement

    I am writing a generic GUI fronend for any database that has a JDBC2.0 driver available.
    I have been using scrollable updateable result sets. These work well for individual tables but as soon as two tables are linked either implicitly or explicitly with a join statement the result set meta data isDefinitelyWriteable is set to false thus preventing the result set from being updated.
    Assuming I am using the JDBC-ODBC driver with java sdk1.4.0 and MS Access (although I have used other databases and JDBCs I assume that the one mentioned will be a common combination and needs to work) is there any way of getting linked tables to be updateable with scollable result sets.
    I am using scrollable result sets since this prevents the necessity of putting the data in a secondary data store.
    I am able to link tables programmatically by requerying the linked table with a new where clause each time the cursor moves in the linked table but this seems rather wasteful. This method is not vey satisfactory when attempting to display data from more than one table which have more than one linked level (i.e. cascaded links).
    Is there a simple solution to this problem or do I have to do a rewrite using an update statement instead of having an updateable result set. I assume this method would also require the result set to be reloaded after the update.
    Any suggestions much appreciated.

    I am trying to make the GUI as flexible as possible by constructing "views" which if necessary link tables on one field in each table. This is fine for two tables but when linking to several tables the information thats produced cannot be read easily because as it stands the information from each table is displayed on a separate tabbed page. This mechanism allows me to keep each record set for each table separate and updateable.
    Since I could see that this was not very user friendly in the way that it displayed the data I decided to try and introduce a join on two or more tables and hence the introduction of the current problem.
    I mentioned that the objective was to be flexible and therefore I also allow queries to be written by the user to facilitate for any shortfalls of the automatic query construction produced by using the "views" mechanism.
    So the answer to your question is yes I do control the SQL selections with one mechanism but ultimately no I do not because I provide a fail safe which allows the user to enter arbitary SQL.
    I only really want a solution for the controlled SQL construction mechanism where I create the link between two or more tables. As mentioned earlier these are linked on one field only but I wish to provide the option of displaying the result in a single table (tabbed page) rather than spread across multiple tabbed pages.

  • Result set not visible in Test View for Physical data service

    I have configured a MS SQL server stored procedure as a data service. It returns a resultset. I am calling this data service (physical) from a logical data service. I am able to see the returned result set in the test view (workshop) of the logical data service but not in the test view of the physical data service? Is this a problem within the workshop?
    Any help is appreciated.

    Never heard of this before. Can you turn on Auditing of XQuery parameters and results and then show me the audit information so I can see you are calling both the logical and the physical data service with the same arguments?
    It would also help to see both the logical and physical ds and their schemas. Just zip and post the whole dsp project if possible.

  • Avoid JDBC sender error: Execute statement did not return a result set

    Hi!
    My JDBC sender adapter towards MS SQL server works fine, with an Execute statement calling a stored procedure that returns the source data needed. The stored procedure itself updates the status of database table records, so that only the unread records are returned each time the stored procedure is called.
    However, the communication channel monitoring sets a red flag for the JDBC sender adapter, when there are no values to fetch from the database table (using the stored procedure). Message says: "Database-level error reported by JDBC driver while executing statement 'EXECUTE FetchMessage 1, 9000'. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.'. For details, contact your database server vendor."
    This is not an error situation, as I do not expect there to be any values to fetch from the database at all times.
    I do not see how to change the stored procedure to avoid this error.
    Is there a parameter to be set on the JDBC adapter that I can use, so the red flag is avoided?
    Thanks for any input!
    Regards,
    Oeystein Emhjellen

    Hi Oeystein Emhjellen.
    The problem is Store Procedure that has to generate always a ResultSet (or cursor). If it doesn't have a output, you have to generate an Empty ResultSet.
    Like a SELECT Statement:
    If there are data, SELECT get an output result but if it get nothing the SELECT Statement get a empty ResultSet.
    Ask to your database team.
    I hope it helps you.
    Bruno.

  • How should i use the two results sets in one single report data region?

    Hi frnz,
     I have to create a report using the below condition...
    Here my given data  set query gives you the two result sets ,so how should i use that two result sets information in single report....when i accessing that data set query it will take the values off the first result set not for the second result set.
    without using sub report and look up functionality..... if possible
    is there any way to achieve this.....Please let me know..
    Thanks!

    You cant get both resultsets in SSRS. SSRS dataset will only take the first resultset
    you need to either create them as separate queries or merge them into a single resultset and return with ad additional hardcoded field which indicates resultset (ie resultset1,resultset2 etc)
    Then inside SSRS report you can filter on the field to fetch individual resultsets at required places. While merging you need to make sure metadata of two resultsets are made consistent ie number of columns and correcponding column data types should be same.
    In absence of required number of columns just put some placeholders using NULL
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Lookup Data For Each Record of Result Set

    I'm trying to determine if the following task is possible in BPEL and how to implement it.
    Assume I have two DB Adapters returning data from two different databases.
    The first excepts no inputs returns 5 records in a collection looking somewhat like the following.
    Order ID, Item ID
    1, 2
    2, 1
    3, 1
    4, 2
    5, 3
    The second accepts an Item ID as input and returns the description for that item.
    I would like the output of the BPEL Process to look like this.
    Order ID, Item ID, Item Desc
    1, 2, Computer
    2, 1, Desk
    3, 1, Desk
    4, 2, Computer
    5, 3, Lamp
    I'm new to BPEL and I'm assuming this will involve invoking the first db adapter link and then iterator through the result set calling the second db adapter link for each record but I'm not sure where to start. I'm hoping someone can give me a simple example that I can play with. I've looked at How to iterate through multiple records read from a file adapter? and How to pass a single element in an array to XSL from BPEL but I'm getting lost.
    Thanks

    I just got it working in the BPEL for-each loop by creating a variable of type Order which I then assigned the results from that loop and then appended them to my output variable. I'd be interested in seeing how I could do that within a transformation if its quicker. How do I append in a transformation so that I can add the row after each loop.
    Here is the BPEL so far.
    I will note that I think just fetching a complete copy of both data sources and merging wouldn't be ideal as my items table could contain a million records or more and I'm only wanting to fetch the ones I'm interested in.
    Thanks
    <?xml version = "1.0" encoding = "UTF-8" ?>
    <!--
      Oracle JDeveloper BPEL Designer
      Created: Thu Dec 19 10:16:29 CST 2013
      Author:  shawn.c.weeks.ctr
      Type: BPEL 2.0 Process
      Purpose: Synchronous BPEL Process
    -->
    <process name="Lookup_Orders"
                   targetNamespace="http://xmlns.oracle.com/Order_Lookup/Sales_System/Lookup_Orders"
                   xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
                   xmlns:client="http://xmlns.oracle.com/Order_Lookup/Sales_System/Lookup_Orders"
                   xmlns:ora="http://schemas.oracle.com/xpath/extension"
                   xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
             xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
             xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/db/Order_Lookup/Sales_System/get_orders"
             xmlns:ns2="http://www.example.org"
             xmlns:ns3="http://xmlns.oracle.com/pcbpel/adapter/db/top/get_orders"
             xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
             xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
             xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
             xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
             xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
             xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
             xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions"
             xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
             xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
             xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
             xmlns:ns4="http://xmlns.oracle.com/pcbpel/adapter/db/Order_Lookup/Sales_System/get_items"
             xmlns:ns5="http://xmlns.oracle.com/pcbpel/adapter/db/top/get_items"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <import namespace="http://xmlns.oracle.com/Order_Lookup/Sales_System/Lookup_Orders" location="Lookup_Orders.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
        <!--
            PARTNERLINKS                                                     
            List of services participating in this BPEL process              
        -->
      <partnerLinks>
        <!--
          The 'client' role represents the requester of this service. It is
          used for callback. The location and correlation information associated
          with the client role are automatically set using WS-Addressing.
        -->
        <partnerLink name="lookup_orders_client" partnerLinkType="client:Lookup_Orders" myRole="Lookup_OrdersProvider"/>
        <partnerLink name="get_orders" partnerLinkType="ns1:get_orders_plt"
                     partnerRole="get_orders_role"/>
        <partnerLink name="get_items" partnerLinkType="ns4:get_items_plt"
                     partnerRole="get_items_role"/>
      </partnerLinks>
      <!--
          VARIABLES                                                       
          List of messages and XML documents used within this BPEL process
      -->
      <variables>
        <!-- Reference to the message passed as input during initiation -->
        <variable name="inputVariable" messageType="client:Lookup_OrdersRequestMessage"/>
        <!-- Reference to the message that will be returned to the requester-->
        <variable name="outputVariable" messageType="client:Lookup_OrdersResponseMessage"/>
        <variable name="Invoke1_get_ordersSelect_InputVariable"
                  messageType="ns1:get_ordersSelect_inputParameters"/>
        <variable name="Invoke1_get_ordersSelect_OutputVariable"
                  messageType="ns1:OrdersCollection_msg"/>
        <variable name="Invoke2_get_itemsSelect_InputVariable"
                  messageType="ns4:get_itemsSelect_inputParameters"/>
        <variable name="Invoke2_get_itemsSelect_OutputVariable"
                  messageType="ns4:ItemsCollection_msg"/>
        <variable name="Output_Row" element="ns2:OrderCollection"/>
      </variables>
      <!--
         ORCHESTRATION LOGIC                                              
         Set of activities coordinating the flow of messages across the   
         services integrated within this business process                 
      -->
      <sequence name="main">
        <!-- Receive input from requestor. (Note: This maps to operation defined in Lookup_Orders.wsdl) -->
        <receive name="receiveInput" partnerLink="lookup_orders_client" portType="client:Lookup_Orders" operation="process" variable="inputVariable" createInstance="yes"/>
        <!-- Generate reply to synchronous request -->
        <invoke name="Invoke1" bpelx:invokeAsDetail="no" partnerLink="get_orders"
                portType="ns1:get_orders_ptt" operation="get_ordersSelect"
                inputVariable="Invoke1_get_ordersSelect_InputVariable"
                outputVariable="Invoke1_get_ordersSelect_OutputVariable"/>
        <forEach parallel="no" counterName="ForEach1Counter" name="ForEach1">
          <startCounterValue>1</startCounterValue>
          <finalCounterValue>count($Invoke1_get_ordersSelect_OutputVariable.OrdersCollection/ns3:Orders)</finalCounterValue>
          <scope name="Scope1">
            <sequence name="Sequence1">
              <assign name="Assign2">
                <copy>
                  <from>$Invoke1_get_ordersSelect_OutputVariable.OrdersCollection/ns3:Orders[$ForEach1Counter]/ns3:itemId</from>
                  <to>$Invoke2_get_itemsSelect_InputVariable.get_itemsSelect_inputParameters/ns5:item_id</to>
                </copy>
              </assign>
              <invoke name="Invoke2" bpelx:invokeAsDetail="no"
                      partnerLink="get_items" portType="ns4:get_items_ptt"
                      operation="get_itemsSelect"
                      inputVariable="Invoke2_get_itemsSelect_InputVariable"
                      outputVariable="Invoke2_get_itemsSelect_OutputVariable"/>
              <assign name="Assign3">
                <copy>
                  <from>$Invoke1_get_ordersSelect_OutputVariable.OrdersCollection/ns3:Orders[$ForEach1Counter]/ns3:orderId</from>
                  <to>$Output_Row/ns2:Order/ns2:Order_ID</to>
                </copy>
                <copy>
                  <from>$Invoke1_get_ordersSelect_OutputVariable.OrdersCollection/ns3:Orders[$ForEach1Counter]/ns3:itemId</from>
                  <to>$Output_Row/ns2:Order/ns2:Item_ID</to>
                </copy>
                <copy>
                  <from>$Invoke2_get_itemsSelect_OutputVariable.ItemsCollection/ns5:Items[1]/ns5:itemDesc</from>
                  <to>$Output_Row/ns2:Order/ns2:Item_Desc</to>
                </copy>
              </assign>
              <assign name="Assign4">
                <extensionAssignOperation>
                  <bpelx:append>
                    <bpelx:from>$Output_Row/ns2:Order</bpelx:from>
                    <bpelx:to>$outputVariable.payload</bpelx:to>
                  </bpelx:append>
                </extensionAssignOperation>
              </assign>
            </sequence>
          </scope>
        </forEach>
        <reply name="replyOutput" partnerLink="lookup_orders_client" portType="client:Lookup_Orders" operation="process" variable="outputVariable"/>
      </sequence>
    </process>

  • SCROLL_SENSITIVE result set can't see the data inserted.

    hi all ,
    I am trying to display all the latest data available in the table through SCROLL_SENSITIVE and UPDATABLE result set after inserting a new record in the table.
    But the result set obtained after executing the query initially is not able to see the newly inserted record in the table and hence same result is getting printed out in both the cases.
    Can u explain me what's happening in this case ?? And how can i get the updated record also without executing the statement query twice to get the latest result set.
    My full code is given below.
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    public class Misc3 {
    public static void main(String[] args) {
    Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;
    try {
    int empid;
    String lname;
    String fname;
    int deptno;
    int mngrid;
    con = JDBCUtil.getOracleConnection();
    stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    String query = "select employee_id , last_name , first_name , department_number , manager_id from employees ";
    rs = stmt.executeQuery(query);
    System.out.println("Before inserting the new record.....");
    while (rs.next()) {
    empid = rs.getInt(1);
    lname = rs.getString(2);
    fname = rs.getString(3);
    deptno = rs.getInt(4);
    mngrid = rs.getInt(5);
    System.out.println(empid + "\t" + lname + "\t" + fname + "\t" + deptno + "\t" + mngrid);
    System.out.println("Going to insert the new record.....");
    rs.moveToInsertRow();
    rs.updateInt(1, 10);
    rs.updateString(2, "Clark");
    rs.updateString(3, "John");
    rs.updateInt(4, 2);
    rs.updateInt(5, 2);
    rs.insertRow();
    System.out.println("New record inserted successfully.....");
    System.out.println("After inserting the new record.....");
    rs.beforeFirst();
    while (rs.next()) {
    empid = rs.getInt(1);
    lname = rs.getString(2);
    fname = rs.getString(3);
    deptno = rs.getInt(4);
    mngrid = rs.getInt(5);
    System.out.println(empid + "\t" + lname + "\t" + fname + "\t" + deptno + "\t" + mngrid);
    } catch (SQLException ex) {
    System.out.println("error code : " + ex.getErrorCode());
    System.out.println("error message : " + ex.getMessage());
    } finally {
    JDBCUtil.cleanUp(con, stmt);
    *** JDBCUtil Class ****
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    public class JDBCUtil {
    public static Connection getOracleConnection(){
    Connection con = null;
    try{
    // Load the driver
    Class.forName("oracle.jdbc.driver.OracleDriver");
    //Establish Connection
    con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","ex","ex");
    }catch(Exception ex){
    ex.printStackTrace();
    return con;
    public static void cleanUp (Connection con , Statement stmt){
    // Release the resource
    try{
    if(con != null){
    con.close();
    if(stmt != null){
    stmt.close();
    }catch(Exception ex){
    ex.printStackTrace();
    Edited by: user12848632 on Aug 13, 2012 2:06 PM

    >
    Can u explain me what's happening in this case ?? And how can i get the updated record also without executing the statement query twice to get the latest result set.
    >
    Sure - but you could have answered your own question if you had read the doc link I gave you in your other thread and next time you post code use \ tags on the lines before and after the code - see the FAQ for info
    17076 : Invalid operation for read only resultset
    {quote}
    •Internal INSERT operations are never visible, regardless of the result set type.
    {quote}
    See •Seeing Database Changes Made Internally and Externally in the JDBC Dev doc I pointed you to
    http://docs.oracle.com/cd/B28359_01/java.111/b31224/resltset.htm#i1024720
    Did you notice the words 'never visible'? You won't see them as part of the result set unless you requery.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for