Unexpected Result Sets by Changing MAX to MIN

I was expecting the identical result sets from the following two SQL statements:
SELECT HIST.LDR_SYSTEM_ID "MISSING SYSTEM PK"
FROM GM_SYSTEM_HIST HIST
WHERE HIST.SYSTEM_HIST_ID = (SELECT MAX (DUPL.SYSTEM_HIST_ID) /* SYSTEM_HIST_ID is the PK for GM_SYSTEM_HIST */
FROM GM_SYSTEM_HIST DUPL
WHERE HIST.LDR_SYSTEM_ID = DUPL.LDR_SYSTEM_ID)
AND HIST.LDR_SYSTEM_ID NOT IN (SELECT SYSTEM_ID FROM GM_SYSTEM) /* SYSTEM_ID is the PK for GM_SYSTEM */
AND HIST.SYSTEM_HIST_ID IN
(SELECT SYSTEM_HIST_ID FROM GM_INTGRTY_INVN
UNION
SELECT SYSTEM_HIST_ID FROM GM_INTGRTY_PROXIMITY);
SELECT HIST.LDR_SYSTEM_ID "MISSING SYSTEM PK"
FROM GM_SYSTEM_HIST HIST
WHERE HIST.SYSTEM_HIST_ID = (SELECT MIN (DUPL.SYSTEM_HIST_ID) /* SYSTEM_HIST_ID is the PK for GM_SYSTEM_HIST */
FROM GM_SYSTEM_HIST DUPL
WHERE HIST.LDR_SYSTEM_ID = DUPL.LDR_SYSTEM_ID)
AND HIST.LDR_SYSTEM_ID NOT IN (SELECT SYSTEM_ID FROM GM_SYSTEM) /* SYSTEM_ID is the PK for GM_SYSTEM */
AND HIST.SYSTEM_HIST_ID IN
(SELECT SYSTEM_HIST_ID FROM GM_INTGRTY_INVN
UNION
SELECT SYSTEM_HIST_ID FROM GM_INTGRTY_PROXIMITY);
MISSING SYSTEM PK
411539
610343
311152
311155
431231
631785
6 rows selected.
MISSING SYSTEM PK
332000
612339
2 rows selected.
Why would the result sets change from MAX to MIN?

Bob from Austin wrote:
I was expecting the identical result sets from the following two SQL statements:And why would they be the same? Assume table GM_SYSTEM_HIST has:
SYSTEM_HIST_ID LDR_SYSTEM_ID
1              10
2              10
3              10Now, even though resgrless if you use MAX or MIN you will get back LDR_SYSTEM_ID = 10, using MAX will return row
3              10while using MIN will return row:
1              10And it could be row
3              10satisfies other where clause conditions:
    AND HIST.LDR_SYSTEM_ID NOT IN (SELECT SYSTEM_ID FROM GM_SYSTEM) /* SYSTEM_ID is the PK for GM_SYSTEM */
    AND HIST.SYSTEM_HIST_ID IN (
                                 SELECT SYSTEM_HIST_ID FROM GM_INTGRTY_INVN
                                UNION
                                 SELECT SYSTEM_HIST_ID FROM GM_INTGRTY_PROXIMITY
                               );while row
1              10does not. Or vice versa.
SY.
Edited by: Solomon Yakobson on Dec 16, 2009 2:49 PM

Similar Messages

  • Setting the max and min bounds of a result set

    I'm trying to set the upper and lower bound values of a result set. Meaning, I want to limit the values in my result set to not be below/above a certain number, BUT I want any number in my result set that is below/above the lower/upper bound that i have designated to be decoded to the lower/upper bound number that I have designated. Here's an example to help clarify:
    WITH temp_table AS
    SELECT 1231.12 AS col FROM dual UNION ALL
    SELECT 1001.00 FROM dual UNION ALL
    SELECT -32.0 FROM dual UNION ALL
    SELECT -3.0 FROM dual UNION ALL
    SELECT 332.0 FROM dual UNION ALL
    SELECT 211.0 FROM dual
    SELECT CASE WHEN col < 0 -- 0 is the lower bound
                THEN
                     0
                WHEN col > 1000 -- 1000 is the upper bound
                THEN
                     1000
                ELSE
                     col
           END as desired_result
    FROM   temp_tabledesired result set:
            DESIRED_RESULT
         1000
         1000     
            0
         0
         332
         211I was wondering if there was another function or method of achieving my desired result set without having to use a CASE statement? I have to do this to several columns, and it doesn't seem very efficient to throw a CASE statement around each one.

    LEAST and GREATEST will do that too :
    SQL> WITH temp_table AS
      2  (
      3   SELECT 1231.12 AS col FROM dual UNION ALL
      4   SELECT 1001.00 FROM dual UNION ALL
      5   SELECT -32.0 FROM dual UNION ALL
      6   SELECT -3.0 FROM dual UNION ALL
      7   SELECT 332.0 FROM dual UNION ALL
      8   SELECT 211.0 FROM dual
      9   )
    10  SELECT least(greatest(col, 0), 1000)
    11  FROM temp_table
    12  ;
    LEAST(GREATEST(COL,0),1000)
                           1000
                           1000
                              0
                              0
                            332
                            211
    6 rows selected
    I have to do this to several columns, and it doesn't seem very efficient to throw a CASE statement around each one.Any test case showing CASE as not efficient?
    Edited by: odie_63 on 25 juil. 2012 23:20

  • How to split a result set into n-number ranges, each range has same max-min

    Hi guys,
    suppose there's a table T1(fvalue number),
    we can easily get the MAX and MIN of fvalue, for example, 19 and 5, I need to split them into, for example, 3 ranges, 5-9, 10-14, 15-19, they have the same max-min. And for each range, I need to know the count of rows that fall into this range.
    does anyone have any clues? is there any analytic function i can use to accomplish this?
    many thanks.

    There are the NTILE and WIDTH_BUCKET functions that may be of use. However, I'm not exactly sure what you are after.
    It is always helpful to provide the following:
    1. Oracle version (SELECT * FROM V$VERSION)
    2. Sample data in the form of CREATE / INSERT statements.
    3. Expected output
    4. Explanation of expected output (A.K.A. "business logic")
    5. Use \ tags for #2 and #3. See FAQ (Link on top right side) for details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • I buy a mac mini from amazon, and it is registered on another Apple ID, and i need to change it to mine, how can i do that, note that i can't contact the previous owner of this mac, what shall i do to set it under my Apple ID

    i buy a mac mini from amazon, and it is registered on another Apple ID, and i need to change it to mine, how can i do that, note that i can't contact the previous owner of this mac, what shall i do to set it under my Apple ID.
    Thanks

    As I said you need to:
    You need to wipe the hard disk and reinstall the OS by booting into the recovery partition and reinstall the original OS via the internet. It will ask you to enter your ID
    OS X: About OS X Recovery
    Also see:
    OS X Mountain Lion: Erase and reinstall OS X

  • XY Graph-Setting Y-Scale visible to False still Shows Corresponding Y scale Max and Min

    Hi Guys,
    I use XY graph to display the data with 3 Y-scales.
    When I set any Y scale Visiblity property to False,its still display the Y scale Max and Min range Lines in plot area of the  Graph and making cross line or extra parralel line with other visible scales.
    Attached the screen shot  for ref.
    And I know the cross line may be due to different Y scales range setting.But XY graph should not display the invisible Y scales and its property  as well.
    please provide your suggestions to avoid that.
    Solved!
    Go to Solution.

    The scales and the lines associated with those scales are separate properties. I have never tried it, and right now I am not at a computer, but there should be properties for setting the grid line colors. Set them to transparent.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Result Set is getting close in 12 Min

    Hi,
    I am facing one issue here with the JDBC.
    I am doing a query to the oracle db , where I have more the 80K records in our one of table. Once I recieved the data in resultset. I am iterating them in batch of length 1024 from the result set. But I am able to do only 5 Iteration and result set getting connection closed SQLException in 12 Min. Here is the stack trace.
    Caused by: java.sql.SQLException: Closed Connection: next
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:181)-
    I have seen that result set has all the records.
    Can you please help me here is that any time can mentioned in resultSet.
    Thanks,
    Mukesh

    Hi,
    After run some more test execution and adding the connection.isClosed() in the traces I have seen that below mentioned exception.
    Caused by: java.sql.SQLException: Operation invoked on a bad Jdbc connection please check database connectivity
    at com.inprise.visitransact.jdbc2.ConnectionProxy.checkConnectionTimeout(ConnectionProxy.java:1136)
    at com.inprise.visitransact.jdbc2.ConnectionProxy.isClosed(ConnectionProxy.java:891)
    at com.lucent.iems.platform.fm.dataaccess.AbstractBaseQuery.getData(AbstractBaseQuery.java:144)
    ... 30 more
    I have seen the connection was not closed till 10 min 19 sec. I have printed in logs also.
    2010/05/14 10:16:11;conn is valid before:false
    2010/05/14 10:21:25;conn is valid before:false
    2010/05/14 10:24:15;conn is valid before:false
    2010/05/14 10:26:30;conn is valid before:false
    Is it possible that connection get bad in this time period. This exception I saw in Borland Application server API
    private void checkConnectionTimeout()
    throws SQLException
    if(_holder != null)
    if(_holder.getState() == Jdbc2ConnState.BusyTimedOut)
    throw new SQLException("A JDBC connection can't be used beyond transaction timeout or busyTimeout");
    if(_holder.getState() == Jdbc2ConnState.Discarded)
    throw new SQLException("Operation invoked on a bad Jdbc connection please check database connectivity");
    But not sure why this connection is discarded.

  • Change display of result set from 'showing data as rows, to showing data as one or more columns'

    Hi Everyone,
    I am interested in changing the way that data is displayed in my result set.
    Essentially I want to display a selection of rows (1 to n) as columns, the following diagram explains my intentions -
    Perhaps one of the greatest challenges here is the fact that I do not have a concrete number of rows (or BIN numbers).
    Each stock item could be stored in one or more BINS, which I will not know until running my query.
    Any suggestions here will be greatly appreciated.
    Kind Regards,
    David

    Can you explain on what basis you select those BinLabels? There're lots of other labels also available on your sample data so whats the rule which determines which all BinLabels should be selected?
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
    Agree with Visakh16's opinion. In addition, it might be helpful if you can post your DDL here.
    Regards,
    Elvis Long
    TechNet Community Support

  • How to Programmatically Set the limit (max, min input) of a control inside a cluster?

    I want to programmatically set the limit (max, min input) of a control inside a cluster. (see attached VI).
    The max, min value will be read from a file. The input of the control must be within the range defined by the max and min value.
    Can anyone tell me how to do it?
    Thanks a lot for your kind help.
    Xiaogang

    Accessing the properties of a cluster (or array) is not a trivial operation until you have done it once. It's a two step (at least) process : first, ask for a reference (array of...) to the objects contained in the cluster, then tell LV what kind of object you are adressing.
    See the attachment.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    How to set limit[1].vi ‏52 KB

  • BW Web Report Issue - Result set too large

    Hi,
    When I execute a BEx Query on Web I am getting “Result set too large ; data retrieval restricted by configuration (maximum = 500000 cells)”.
    Following to my search in SDN I understood we can remove this restriction either across the BW system globally or for a specific query at WAD template.
    In my 7x Web template I am trying to increase default max no of rows parameters, As per the below inputs from SAP Note: 1127156.
    But I can’t find parameter “Size Restriction for Result Sets” for any of the web items (Analysis/Web Template properties/Data Provider properties)….in the WAD Web template
    Please advise where/how can I locate the properites
    Instructions provided in SAP Note…
    The following steps describe how to change the "safety belt" for Query Views:
    1. Use the context menu Properties / Data Provider in a BEx Web Application to maintain the "safety belt" for a Query View.
    2. Choose the register "Size Restriction for Result Sets".
    3. Choose an entry from the dropdown box to specify the maximum number of cells for the result set.
                  The following values are available:
    o Maximum Number
    o Default Number
    o Custom-Defined Number
                  Behind "Maximum Number" and "Default Number" you can find the current numbers defined in the customizing table RSADMIN (see below).
    4. Save the Query View and use it in another Web Template.
    Thanks in advance

    Hi Yasemin,
    Thanks for all help...i was off couple of days.
    To activate it I can suggest to create a dummy template, add your query in it, add a menu bar component add an action to save the query view. Then you run the template and change the size restriction for result set then you can save it by the menu.
    Can you please elaborate on the solution provided,I created dummy template with analysis and Menu bar item...i couldn't able to configure menu bar item...
    Thanks in advance

  • RDBMS Event Generator Issue - JDBC Result Set Already Closed

    All -
    I am having a problem with an RDBMS event generator that has been exposed by our Load Testing. It seems that after the database is under load I get the following exception trace:
    <Aug 7, 2007 4:33:06 PM EDT> <Info> <EJB> <BEA-010213> <Message-Driven EJB: PollerMDB_SessionRqt_1186515408009's transaction was rolledback. The transact ion details are: Xid=BEA1-7F8C65474500D80A5B94(218826722),Status=Rolled back. [Reason=weblogic.transaction.internal.AppSetRollbackOnlyException],numRepli esOwedMe=0,numRepliesOwedOthers=0,seconds since begin=0,seconds left=60,XAServerResourceInfo[JMS_Affinity_cgJMSStore_auto_1]=(ServerResourceInfo[JMS_Affi    nity_cgJMSStore_auto_1]=(state=rolledback,assigned=wli_int_1),xar=JMS_Affinity_cgJMSStore_auto_1,re-Registered = false),XAServerResourceInfo[ACS.Telcordi    a.XA.Pool]=(ServerResourceInfo[ACS.Telcordia.XA.Pool]=(state=rolledback,assigned=wli_int_1),xar=ACS.Telcordia.XA.Pool,re-Registered = false),XAServerReso urceInfo[JMS_Affinity_cgJMSStore_auto_2]=(ServerResourceInfo[JMS_Affinity_cgJMSStore_auto_2]=(state=rolledback,assigned=wli_int_2),xar=null,re-Registered = false),SCInfo[wli_int_domain+wli_int_2]=(state=rolledback),SCInfo[wli_int_domain+wli_int_1]=(state=rolledback),properties=({START_AND_END_THREAD_EQUAL    =false}),local properties=({weblogic.jdbc.jta.ACS.Telcordia.XA.Pool=weblogic.jdbc.wrapper.TxInfo@d0b2687}),OwnerTransactionManager=ServerTM[ServerCoordin    atorDescriptor=(CoordinatorURL=wli_int_1+128.241.233.85:8101+wli_int_domain+t3+, XAResources={weblogic.jdbc.wrapper.JTSXAResourceImpl, Affinity_cgPool, J    MS_Affinity_cgJMSStore_auto_1, ACSDispatcherCP_XA, ACS.Dispatcher.RDBMS.Pool, ACS.Telcordia.XA.Pool},NonXAResources={})],CoordinatorURL=wli_int_1+128.241 .233.85:8101+wli_int_domain+t3+).>
    <Aug 7, 2007 4:33:06 PM EDT> <Warning> <EJB> <BEA-010065> <MessageDrivenBean threw an Exception in onMessage(). The exception was:
    javax.ejb.EJBException: Error occurred while processing message received by this MDB. This MDB instance will be discarded after cleanup; nested exceptio n is: java.lang.Exception: Error occurred while preparing messages for Publication or while Publishing messages.
    javax.ejb.EJBException: Error occurred while processing message received by this MDB. This MDB instance will be discarded after cleanup; nested exception is: java.lang.Exception: Error occurred while preparing messages for Publication or while Publishing messages
    java.lang.Exception: Error occurred while preparing messages for Publication or while Publishing messages
    at com.bea.wli.mbconnector.rdbms.intrusive.RDBMSIntrusiveQryMDB.fetchUsingResultSet(RDBMSIntrusiveQryMDB.java:561)
    at com.bea.wli.mbconnector.rdbms.intrusive.RDBMSIntrusiveQryMDB.onMessage(RDBMSIntrusiveQryMDB.java:310)
    at weblogic.ejb20.internal.MDListener.execute(MDListener.java:400)
    at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:333)
    at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:298)
    at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2698)
    at weblogic.jms.client.JMSSession.execute(JMSSession.java:2523)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    Caused by: java.sql.SQLException: Result set already closed
    at weblogic.jdbc.wrapper.ResultSet.checkResultSet(ResultSet.java:105)
    at weblogic.jdbc.wrapper.ResultSet.preInvocationHandler(ResultSet.java:67)
    at weblogic.jdbc.wrapper.ResultSet_oracle_jdbc_driver_OracleResultSetImpl.next()Z(Unknown Source)
    at com.bea.wli.mbconnector.rdbms.intrusive.RDBMSIntrusiveQryMDB.handleResultSet(RDBMSIntrusiveQryMDB.java:611)
    at com.bea.wli.mbconnector.rdbms.intrusive.RDBMSIntrusiveQryMDB.fetchUsingResultSet(RDBMSIntrusiveQryMDB.java:514)
    ... 8 more
    javax.ejb.EJBException: Error occurred while processing message received by this MDB. This MDB instance will be discarded after cleanup; nested exception is: java.lang.Exception: Error occurred while preparing messages for Publication or while Publishing messages
    at com.bea.wli.mbconnector.rdbms.intrusive.RDBMSIntrusiveQryMDB.onMessage(RDBMSIntrusiveQryMDB.java:346)
    at weblogic.ejb20.internal.MDListener.execute(MDListener.java:400)
    at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:333)
    at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:298)
    at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2698)
    at weblogic.jms.client.JMSSession.execute(JMSSession.java:2523)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    >
    I have tried several things and had my team do research but we have not been able to find an answer to the problem.
    If anyone can offer any insight as to why we might be getting this error it would be greatly appreciated. Thanks!

    i also have same error during load testing, mainly this error
    "Unexpected exception while enlisting XAConnection java.sql.SQLException"
    i tried rerunning after increasing connection pool sizes, transaction timeout, but no luck, marginal improvement in performance though
    also tried changing the default tracking levl to none, but no luck.
    i am with 8.1SP5, how about you ?
    do share if you are able to bypass these errors
    cheers

  • How to hold the result set

         We have a GUI swing screen in which we have navigation buttons.
         when the user clicks the previous ,next, last,first buttons we have to show the records accordingly.
         The min. size of the database is around 1 million.and each row has 60 columns.
         Our approach is screen--->servlet-->ejb beans --->database.
         since the database is huge how to hold the values, and where, without affecting the performance.
         If we get the resultset it holds all the data.since the data size is huge,we are looking for a solution.The user may browse through the data ,edit the data and delete the data.
         we have to perform accordingly. Also, if, for example, user1 is seeing record no.1 & user 2 has modified record no.3 in the meanwhile, when user1 goes to record no.3, he should see the
         modified record. In short, the user should always see the latest values.
         please give us the best approach to solve this problem.
    Also this is in a multi user environment.

    It seems like you need to look at threads to update current values in the display and narrow the result set that you retrieve to match the criteria needed for display. You might consider making the method to change values a syncronized one.

  • JdbcodbcDriver uses the wrong charSet for interpreting the result set data

    Hi everyone,
    I?m having trouble getting results from a MS Access database which uses Greek characters. All the characters in the range 0-127 are returned good but I get ??? for all above 127.
    Here is some more details:
    OS: win2k
    Local setting for current user: Greek (not that it makes a difference)
    Default Language setting for the System: English (Astralia). This uses charSet Cp1252 or ISO 8859-1 encoding.
    Environment: JBuilder 7.0
    JDK: 1.4.1
    DB: MS Access
    DB charSet: Cp1253 (Greek encoding or ISO 8859-7)
    Connection method:
         java.util.Properties prop = new java.util.Properties();
         prop.put("user" , userName);
         prop.put("password" , password);
         //driver is "sun.jdbc.odbc.JdbcOdbcDriver";     
         //none of these work
         //prop.put("charSet", "UTF-8");
         //prop.put("charSet", "Greek");
         prop.put("charSet", "Cp1253");
         connection = DriverManager.getConnection(MY_ACCESS_DB,prop);
    DataSet Access method:
         // run query and get resultSet rs here
         char[] cBuff= new char[1000];
         // I have tried getString(), getBytes(), getBinaryStream also
         Reader rReader = rs.getCharacterStream(3);
         BufferedReader fIn = new BufferedReader(rReader);
         int res = fIn.read(cBuff, 0, 999);
         // contents of cBuff is incorrect here
    I have also used -Dfile.encoding=Cp1253 in command line which seems to change the default charSet of the JVM. Tested
         String en = new InputStreamReader(System.in).getEncoding();
         System.out.println("Default encoding: " + en);
    By enabling trace and looking at the content of the resultSet object it shows that
    rs.OdbcApi.charSet = "Cp1253"
    So I'm absolutely stumped. The only possible problems I can think of is either a bug in the jdbcodbcDriver or in my native ODBC driver. The latter is less likely since I connected to the same datasouce using a different application and get the right result.
    One more thing that may be helpful, if I set up the default charSet under Win2K to "Greek" (that is setting default language setting in Regional Options under Control Panel)
    Everything works fine.
    Is there anyone out there with answer to my problem?
    Thanks in advance.

    Tried your program and it does exactly as I expected. I get a whole lot of '?'s with my OS default language setting on English but it works fine as soon as I set it to Greek. It does not make a difference if I change the "input language" on the language bar (shift+ctrl) to Greek or not. Or if I change the charSet in your program to something else. Which bring up the question what do you use the charSet setting on your program for? If it is for byte conversion, I don't think you need it since the OS default charset is used by ResultSet.GetString and that needs to be set anyway.
    Anyhow your program basically behaves exactly the same way as mine does. I am almost 100% sure that the problem is with the properties used (or not used) when creating the connections. There has got to be a (provider) property like "useUnicode" or "charSet" or something that is passed through jdbcodbc bridge to ODBC to MS Access to force it to return the result set in UTF-8 format. I confirmed this by using Visual C++ data access program that i wrote (which has the same sort of problem). All other MS Office products know about this property that why they work when i imort data from them.
    This means I don't have a jdbc or even a java problem but my problem is MS Access related. So I�m going to post a question on an MS Access user group (if I find one) and see what I get). Thanks for your help with this.
    By the way AOKabc crashed once and froze another time. I think it had more to do with the libraries you are using rather than your code. I have a trace log if you are interested.
    Soheil

  • Access pagination result set

    all,
    in my htmldb 1.6 application, i have a report region that displays the records from a table with pagination. i would like to write out some javascript only for the records that are displayed in the report region and not the entire contents of the table (just the 10 rows returned from the pagination).
    is there a way to access either the page variables that are passed when using pagination(so i can construct my own query to get the rows returned by the pagination) or a way to access the result set that is returned by the pagination scheme?
    paul

    Vikas,
    i have a page that i'm using to assign and remove users from oid groups. the page is split into two report regions that display sql queries, a user and a group region. on the left the user region is a paginated report that lists all the users(can be up to 6000) that also uses the htmldb_item.radiogroup control. on the right there is a group region which is a report of all the groups the user can belong to which also uses the htmldb_item.checkbox control so the administrator can select and deselect groups for the selected user.
    i'm using javascript on the user radio group to drive the group checkboxes. when an administrator selects a user record from the paginated radio group, the checkboxes next to the group they belong to in the group region becomes checked.
    to accomplish this i'm writing an after header javascript block that loops through the user sql query i used in the user region. as i loop through the user records i'm writing out javascript variables for each user that are arrays of the groups the user belongs to so i can use it to populate the group checkboxes. since the user query is paginated i want to limit my query and only write out the javascript variables for the records that are displayed on the page. so i need to know what is the max and min records displayed from the query. i can get this info from the htmldb global variables:
    wwv_flow.g_flow_current_min_row
    wwv_flow.g_flow_current_max_rows
    wwv_flow.g_flow_current_rows_fetched
    wwv_flow.g_request
    but only after the pagination controls are used. so the first time a user hits a paginated page the variables above are set to their defaults(min=1, max=10, rows fetched=0) and i have to hardcode a max value into my sql query. so i was wondering if i can somehow access it from the database/an api for that paginated region or if there is some other way to determine the record set being displayed for a paginated page.
    hope this clears it up.
    Paul

  • 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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • WAD : Result set is too large; data retrieval restricted by configuration

    Hi All,
    When trying to execute the web template by giving less restiction we are getting the below error :
    Result set is too large; data retrieval restricted by configuration
    Result set too large (758992 cells); data retrieval restricted by configuration (maximum = 500000 cells)
    But when we try to increase the number of restictions it is giving output. For example if we give fiscal period, company code ann Brand we are able to get output. But if we give fical period alone it it throwing the above error.
    Note : We are in SP18.
    Whether do we need to change some setting in configuration? If we yes where do we need to change or what else we need to do to remove this error
    Regards
    Karthik

    Hi Karthik,
    the standard setting for web templates is to display a maximum amount of 50.000 cells. The less you restrict your query the more data will be displayed in the report. If you want to display more than 50.000 cells the template will not be executed correctly.
    In general it is advisable to restrict the query as much as possible. The more data you display the worse your performance will be. If you have to display more data and you execute the query from query designer or if you use the standard template you can individually set the maximum amount of cells. This is described over  [here|Re: Bex Web 7.0 cells overflow].
    However I do not know if (and how) you can set the maximum amount of cells differently as a default setting for your template. This should be possible somehow I think, if you find a solution for this please let us know.
    Brgds,
    Marcel

Maybe you are looking for

  • Embedded pdf files will not open

    Dell Laptop Windows XP up to date, Firefox 4.0, Adobe Reader 10.0.1 Since updating to Firefox 4.0 certain embedded pdf files will not open forcing me to use my Internet Explorer browser to access these files. Tried all of the FAQ suggestions with no

  • Problem of memory size

    I developed an applet which permits to see some 3D object (from a VRML file). When the source file is light (between 1 to 4 MB), there is not problem, but if its size is 15MB for example, nothing appears ! With a normal java program, I would have to

  • How to check internet connection available or not in adobe flash builder 4.6

    Hi Can you please help me for the above query. Thanks In Advance.

  • Coupons at Sub-Category Level

    Hi Everyone, I have a customer who would like to create coupons or promotions at the Sub-Category level, rather than at the parent category.  Is this possible?  In the drop-down I am only seeing the Parent level, so I was just curious.  Please let me

  • I can't open my *tdv - files

     I can't open my *tdv - files i made two months ago in diadem view. I run diadem 9.1.SP2c on Windows XP SP2 and we have Macaffee Enterprise 8i.When i make a new *tdv - file and save it, i can open it properly.