Result Set re assign issue.

Just a novice question. I have a code like
ResultSet rs = psmt.executeQuery("some query here");
// perform iterate on rs.
rs = psmt.executeQuery("some other query here");
on finally,
rs.close();
My question is will it create two instance on rs and left one closed and another unclosed or will it close both the ResultSet?
Regards,
A.

Ananth Durai wrote:
The real question is on issuing finally {rs.close}, will it close both instance?No, it won't. close() is invoked on the currently referenced object. Which is why I pointed out that you should close resources when done with them. Before even thinking of assigning the same variable to another instance, and before the variable goes out of scope.
If you need two ResultSets in the same scope, use two variables. Than you can close both in the same finally block.
will it cause memory leak?Probably. I don't do JDBC, so I won't categorically say it will.
db

Similar Messages

  • Problem in creating Saved Result Set (SRS) in OBIEE 10.1.3.4

    Hi,
    We have migrated Siebel Analytincs 7.8.5 to OBIEE 10.1.3.4, and we are now unable to create any SRS from OBIEE though we can create Segment and marketing cache for the segment.
    We did the following steps -
    1. Unisntall Siebel Analytincs 7.8.5
    2. Install OBIEE 10.1.3.4
    3. Use MIGRATE tool (sawmigrate) to migrate RPD & WEBCAT
    4. We have ALTERed the SRS tables - M_SR_HEADER, M_SR_ACCOUNT (as in OBIEE version there are many new columns have been added)
    5. We passed GLOBAL CONSISTENCY in the RPD
    6. We followed the steps in the document *"Oracle®Marketing Segmentation Guide Version 10.1.3.4 July 2008"*
    7. We created a Saved Result Set Format as instructed in the document - here we are very confused to select the list of columns - we don't know what should be the excat source / format
    8. Then we click the SRS create button
    9. We got the below error -
    Error Codes: QS2QOLYY:GDL67CY9:IHVF6OM7:OPR4ONWY:U9IM8TAC
    Error in getting cursor for WorkNode (Id:0)
    Authentication Failure.
    Odbc driver returned an error (SQLDriverConnectW).
    *State: 08004. Code: 10018. [NQODBC] [SQL_STATE: 08004] [nQSError: 10018] Access for the requested connection is refused. [nQSError: 43001] Authentication failed for Administrator in repository Star: invalid user/password. (08004)*
    Can anyone help us to resolve the issue ?
    A quick response is much much appreciated.
    Many Thanks,
    Prasanta

    Hi,
    It seems like you didnt setup the Administrator user for Saved Result Sets as it mentioned in the Marketing Segmentation Guide.
    Here is an extract from the guide:
    Setting Up the Web Administrator for Managing Cache and Saved Result Sets
    Some queries issued by the segmentation engine require the use of the Execute Physical stored
    procedure. These queries include delete statements on the cache, delete statements on the saved
    result sets, and insert statements for the cache and saved result set. The Execute Physical stored
    procedure must be run by a user with administrator privileges. The administrator user is set up in
    the instanceconfig.xml file.
    NOTE: The BI Administrator password and login parameters are case sensitive.
    To set up the administrative user in the instanceconfig.xml file
    1 Open a command shell and navigate to the <OracleBI>/web/bin, where <OracleBI> represents
    the root directory of the installation.
    2 Execute the following command:
    cryptotools credstore -add -infile <OracleBIData>/web/config/credentialstore.xml
    3 When prompted, enter the following values:
    Credential Alias: admin
    Username: Administrator
    Password: <enter Admin password here>
    Do you want to encrypt the password? y
    Passphrase for encryption: <password >
    Do you want to write the passphrase to the xml? n
    File "<OracleBIData>/web/config/credentialstore.xml" exists. Do you want to overwrite it? y
    4 Open the credentialstore.xml file and verify that the following section has been created:
    <sawcs:credential type="usernamePassword" alias=“admin">
    <sawcs:username> Administrator </sawcs:username>
    <sawcs:password>
    <xenc:EncryptedData>

  • Issue with result set of query

    I have the following tables:
    --soccer.soccer_optical_player_gm_stats
    --This is only sample data
    GAME_CODE    PLAYER_ID    NUMBER_OF_SPRINTS
    88884               84646                    55              
    88884               64646                    15  
    88884               55551                    35
    88884               88446                    10
    etc...--soccer.soccer_optical_team_gm_stats
    --This is only sample data
    GAME_CODE    TEAM_ID
    88884               13
    88884               13
    88884               15
    88884               13
    etc...--customer_data.cd_soccer_schedule
    --sample data
    GAME_DATE                     5/2/2009 7:30:00 PM
    GAME_CODE                     88884              
    GAME_CODE_1032                     2009050207
    HOME_TEAM_ID_1032              13
    HOME_TEAM_ID                     5360
    HOME_TEAM_NAME                     Los Angeles
    HOME_TEAM_NICKNAME             Galaxy
    HOME_TEAM_ABBREV                LA
    AWAY_TEAM_ID_1032              15
    AWAY_TEAM_ID                     5362
    AWAY_TEAM_NAME                     New York
    AWAY_TEAM_NICKNAME          Red Bulls
    AWAY_TEAM_ABBREV               RBSo using the tables above i'm trying to sum the number of sprints for each team and output it...
    With the following code:
    select          distinct
                     sch.game_date,
                     tm.team_id,
                     sch.game_code,
                     sch.game_code_1032,
                     sch.home_team_id_1032,
                     sch.home_team_id,
                     sch.home_team_name,
                     sch.home_team_nickname,
                     sch.home_team_abbrev,
                     sch.away_team_id_1032,
                     sch.away_team_id,
                     sch.away_team_name,
                     sch.away_team_nickname,
                     sch.away_team_abbrev,
                     home_tm_sprints,
                     away_tm_sprints
           -- bulk collect into distance_run_leaders
            from 
                     customer_data.cd_soccer_schedule sch,
                     soccer.soccer_optical_team_gm_stats tm,
                           select distinct
                                  sum(plyr.number_of_sprints) as home_tm_sprints,
                                  sch.game_code,
                                  sch.home_team_name,
                                  sch.away_Team_name,
                                  sch.game_code,
                                  rank () over (order by sum(plyr.number_of_sprints) desc) as rankings_order_home
                           from
                                  soccer.soccer_optical_player_gm_stats plyr,
                                  soccer.soccer_optical_team_gm_stats tm,
                                  customer_data.cd_soccer_schedule sch
                           where  sch.season_id = 200921
                           and    tm.team_id = sch.home_team_id
                           and    sch.game_code = plyr.game_code
                           group by
                                  sch.game_code,
                                  sch.home_team_name,
                                  sch.away_Team_name,
                                  sch.game_code
                           order by rankings_order_home asc
                      ) home_team,
                        select distinct
                               sum(plyr.number_of_sprints) as away_tm_sprints,
                               sch.game_code,
                               sch.home_team_name,
                               sch.away_Team_name,
                               sch.game_code,
                               rank () over (order by sum(plyr.number_of_sprints) desc) as rankings_order_away
                        from
                               soccer.soccer_optical_player_gm_stats plyr,
                               soccer.soccer_optical_team_gm_stats tm,
                               customer_data.cd_soccer_schedule sch
                        where  sch.season_id = 200921
                        and    tm.team_id = sch.away_team_id
                        and    sch.game_code = plyr.game_code
                        group by
                               sch.game_code,
                               sch.home_team_name,
                               sch.away_Team_name,
                               sch.game_code
                       order by rankings_order_away asc
                    ) away_team
            where    sch.game_code = tm.game_code
            and      sch.season_id = 200921Issues:
    1. The output above returns multiple entries(like 30 or so) for each game_code (i only want two entries returned for each game_code).
    --(Only difference between the two result sets is the team_id, which ultimatly lets me know if it a result for the home or away team)
    Something like:
    GAME_DATE                     5/2/2009 7:30:00 PM        5/2/2009 7:30:00 PM
    TEAM_ID                                13                                  15 
    GAME_CODE                     88884                             88884                  
    GAME_CODE_1032                     2009050207                    2009050207
    HOME_TEAM_ID_1032               13                                  13  
    HOME_TEAM_ID                     5360                               5360
    HOME_TEAM_NAME                     Los Angeles                      Los Angeles
    HOME_TEAM_NICKNAME           Galaxy                              Galaxy
    HOME_TEAM_ABBREV               LA                                   LA
    AWAY_TEAM_ID_1032             15                                   15
    AWAY_TEAM_ID                     5362                               5362
    AWAY_TEAM_NAME                     New York                        New York
    AWAY_TEAM_NICKNAME               Red Bulls                         Red Bulls
    AWAY_TEAM_ABBREV                  RB                                  RB
    HOME_TM_SPRINTS                    152                                152
    AWAY_TM_SPRINTS                   452                                 4522. In addition to that, I'm also having an issue trying to figure out how to do a general ranking...in the from clause i'd so a seperate ranking for just the home teams and just the away the teams. I can't seem to figure out how to merge the rankings into one, and just have one general ranking.
    Edited by: user652714 on May 7, 2009 4:18 PM
    Edited by: user652714 on May 8, 2009 7:14 AM

    ok maybe I just need to give you a better understanding of what i'm trying to ultimatly do, and maybe that will help clarify things.
    In the original code I posted the following subquery in the from clause...
    select distinct
                                  sum(plyr.number_of_sprints) as home_tm_sprints,
                                  sch.game_code,
                                  sch.home_team_name as home_team_name,
                                  sch.game_code,
                                  rank () over (order by sum(plyr.number_of_sprints) desc) as rankings_order_home
                           from
                                  soccer.soccer_optical_player_gm_stats plyr,
                                  soccer.soccer_optical_team_gm_stats tm,
                                  customer_data.cd_soccer_schedule sch
                           where  sch.season_id = 200921
                           and    tm.team_id = sch.home_team_id
                           and    sch.game_code = plyr.game_code
                           group by
                                  sch.game_code,
                                  sch.home_team_name,
                                  sch.away_Team_name,
                                  sch.game_code
                           order by rankings_order_home asc the result set was this...
        HOME_TM_SPRINTS     GAME_CODE           HOME_TEAM_NAME                  GAME_CODE                  RANKINGS_ORDER_HOME
         576                 870988                New York                   870988                     1
         480                 870991                Chicago                 870991                     2
         435                 870945                 Chicago                 870945                     3
         416                 870983                 San Jose                 870983                     4
         402                 870961                 D.C.                 870961                     5
         322                 870972                 Columbus                 870972                     6
         236                 870957                 Columbus                 870957                     7
         215                 870986                 Kansas City                 870986                     8
         143                 870984                 Los Angeles                 870984                     9Here is the other subquery that i had originally posted:
      select distinct
                               sum(plyr.number_of_sprints) as away_tm_sprints,
                               sch.game_code,
                               sch.away_team_name away_team ,
                               sch.game_code,
                               rank () over (order by sum(plyr.number_of_sprints) desc) as rankings_order_away
                        from
                               soccer.soccer_optical_player_gm_stats plyr,
                               soccer.soccer_optical_team_gm_stats tm,
                               customer_data.cd_soccer_schedule sch
                        where  sch.season_id = 200921
                        and    tm.team_id = sch.away_team_id
                        and    sch.game_code = plyr.game_code
                        group by
                               sch.game_code,
                               sch.home_team_name,
                               sch.away_Team_name,
                               sch.game_code
                       order by rankings_order_away ascResult rest:
       AWAY_TM_SPRINTS                    GAME_CODE                AWAY_TEAM        GAME_CODE           RANKINGS_ORDER_AWAY
         483                     870972                     Chicago                     870972                                1
         435                     870945                     New York                870945                           2
         430                     870986                     D.C.                     870986                                3
         429                     870984                     New York                870984                           4
         402                     870961                     New England            870961                             5
         384                     870988                     San Jose                870988                           6
         320                     870991                     New England            870991                             7
         208                     870983                     Chivas USA                870983                           8
         118                     870957                     Colorado                870957                           9Final output that I want/trying to get
    TM_SPRINTS  GAME_CODE    TEAM           GAME_CODE       RANKINGS_ORDER
    576          870988          New York          870988          1
    483          870972          Chicago          870972          2
    480          870991          Chicago          870991          3
    435          870945          Chicago          870945          4
    435          870945          New York     870945          4
    430          870986          D.C.          870986          6
    429          870984          New York     870984          7
    416          870983          San Jose     870983          8
    402          870961          D.C.          870961          9
    402          870961          New England     870961          9
    384          870988          San Jose     870988          11
    322          870972          Columbus     870972          12
    320          870991          New England     870991          13
    236          870957          Columbus     870957          14
    215          870986          Kansas City     870986          15
    208          870983          Chivas USA     870983          16
    143          870984          Los Angeles     870984          17
    118          870957          Colorado     870957          18The above is what i'm going for...but if it's to difficult to merge the columns into one (instead of having a seprate column for home_team_* and away_team_* that's fine to.
    Edited by: user652714 on May 11, 2009 9:04 AM

  • 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

  • Result Set Causing out of memory issue

    Hi,
    I am having trouble to fix the memory issue caused by result set.I am using jdk 1.5 and sql server 2000 as the backend. When I try to execute a statement the result set returns minimum of 400,000 records and I have to go through each and every record one by one and put some business logic and update the rows and after updating around 1000 rows my application is going out of memory. Here is the original code:
    Statement stmt = con.createStatement();
    ResultSet   rs = st.executeQuery("Select * from  database tablename where field= 'done'");
                while(rs!=null && rs.next()){
                System.out.println("doing some logic here");
    rs.close();
    st.close();
    I am planning to fix the code in this way:
    Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY,
                          ResultSet.CONCUR_UPDATABLE);
    stmt.setFetchSize(50);
    ResultSet   rs = st.executeQuery("Select * from  database tablename where field= 'done'");
                while(rs!=null && rs.next()){
                System.out.println("doing some logic here");
    rs.close();
    st.close();But one of my colleague told me that setFetchSize() method does not work with sql server 2000 driver.
    So Please suggest me how to fix this issue. I am sure there will be a way to do this but I am just not aware of it.
    Thanks for your help in advance.

    Here is the full-fledged code.There is Team Connect and Top Link Api being used. The code is already been developed and its working for 2-3 hours and then it fails.I just have to fix the memory issue. Please suggest me something:
    Statement stmt = con.createStatement();
    ResultSet   rs = st.executeQuery("Select * from  database tablename where field= 'done'");
                while(rs!=null && rs.next()){
                 /where vo is the value object obtained from the rs row by row     
                if (updateInfo(vo, user)){
                               logger.info("updated : "+ rs.getString("number_string"));
                               projCount++;
    rs.close();
    st.close();
    private boolean updateInfo(CostCenter vo, YNUser tcUser) {
              boolean updated;
              UnitOfWork unitOfWork;
              updated = false;
              unitOfWork = null;
              List projList_m = null;
              try {
                   logger.info("Before vo.getId() HERE i AM" + vo.getId());
                   unitOfWork = FNClientSessionManager.acquireUnitOfWork(tcUser);
                   ExpressionBuilder expressionBuilder = new ExpressionBuilder();
                   Expression ex1 = expressionBuilder.get("application")
                             .get("projObjectDefinition").get("uniqueCode").equal(
                                       "TABLE-NAME");
                   Expression ex2 = expressionBuilder.get("primaryKey")
                             .equal(vo.getPrimaryKey());// primaryKey;
                   Expression finalExpression = ex1.and(ex2);
                   ReadAllQuery projectQuery = new ReadAllQuery(FQUtility
                             .classForEntityName("EntryTable"), finalExpression);
                   List projList = (List) unitOfWork.executeQuery(projectQuery);
                   logger.info("list value1" + projList.size());
                   TNProject project_hist = (TNProject) projList.get(0); // primary key
                   // value
                   logger.info("vo.getId1()" + vo.getId());
                   BNDetail detail = project_hist.getDetailForKey("TABLE-NAME");
                   project_hist.setNumberString(project_hist.getNumberString());
                   project_hist.setName(project_hist.getName());
                   String strNumberString = project_hist.getNumberString();
                   TNHistory history = FNHistFactory.createHistory(project_hist,
                             "Proj Update");
                   history.addDetail("HIST_TABLE-NAME");
                   history.setDefaultCategory("HIST_TABLE-NAME");
                   BNDetail histDetail = history.getDetailForKey("HIST_TABLE-NAME");
                   String strName = project_hist.getName();
                   unitOfWork.registerNewObject(histDetail);
                   setDetailCCGSHistFields(strNumberString, strName, detail,
                             histDetail);
                   logger.info("No Issue");
                   TNProject project = (TNProject) projList.get(0);
                   project.setName(vo.getName());
                   logger.info("vo.getName()" + vo.getName());
                   project.setNumberString(vo.getId());
                   BNDetail detailObj = project.getDetailForKey("TABLE-NAME"); // required
                   setDetailFields(vo, detailObj);//this method gets the value from vo and sets in the detail_up object
                   FNClientSessionManager.commit(unitOfWork);
                   updated = true;
                   unitOfWork.release();
              } catch (Exception e) {
                   logger.warn("update: caused exception, "
                             + e.getMessage());
                   unitOfWork.release();
              return updated;
         }Now I have tried to change little bit in the code. And I added the following lines:
                        updated = true;
                     FNClientSessionManager.release(unitOfWork);
                     project_hist=null;
                     detail=null;
                     history=null;
                     project=null;
                     detailObj=null;
                        unitOfWork.release();
                        unitOfWork=null;
                     expressionBuilder=null;
                     ex1=null;
                     ex2=null;
                     finalExpression=null;
    and also I added the code to request the Garbage collector after every 5th update:
    if (updateInfo(vo, user)){
                               logger.info("project update : "+ rs.getString("number_string"));
                               projCount++;
                               //call garbage collector every 5th record update
                               if(projCount%5==0){
                                    System.gc();
                                    logger.debug("Called Garbage Collectory on "+projCount+"th update");
                          }But now the code wont even update the single record. So please look into the code and suggest me something so that I can stop banging my head against the wall.

  • 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

  • Performance issue - Result set

    Hi,
    I am facing performance problem with query execution. The code almost looks like this
    Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
    stmt.setFetchSize(0);
    result = stmt.executeQuery("SELECT  name, phoneNumber from tbluser inner join tblUserDetails ON  tbluser.userid =tblUserDetails.userid WHERE ([phoneNumber] like'%123456789%')  ORDER BY [name], [userID]");This query is taking too much time from the code.The same code is taking only few seconds for execution from the query analyzer.
    when I changed the result set type to TYPE_SCROLL_SENSITIVE its performance improved significantly.
    Please help me to find out y why a scroll sensitive result set performs better than a forward only result set?
    CAn anybody help me how to use client side\server side cursors?
    I have created indexes in tables. Is there any other way to improve the performance? Thanks in advance. Any help will be greatly appreciated.
    Edited by: Aryan.s on Sep 16, 2008 7:49 PM

    Ok, if you wait many rows in the select you change
    stmt.setFetchSize(0);
    to
    stmt.setFetchSize(50);
    Then, if you use "[phoneNumber] like" the database never used the index, you need tu use "=", ">" or "<", etc, if you want the database use the index, you never use "in", "exist", "like" or function "function(column) == variable", my suggestion is:
    result = stmt.executeQuery(
    "SELECT name, phoneNumber " +
    "from tbluser inner join tblUserDetails ON tbluser.userid =tblUserDetails.userid " +
    "WHERE ([phoneNumber] = '123456789') ORDER BY [name], [userID]");
    And use a mask in the input of your application (JFormattedText)

  • More time in Extracting result set ( performence)  VERY URGENT

    Hi all,
    This program is taking much more time in Extracting the  the result set.........(How to increase the performence of this program)
    How to decrease the Execuition of the time.......???
    ***INCLUDE Z00_BCI010 .
    TABLES: z00_bc_cpt_sess,       " Stockage des compteurs associés aux
                                   " progs de traitement.
            z00_bc_erreur,         " Table des anomalies des programmes
    " spécifiques.
    *début ajout FAE 30463
            z00_bc_err_log.        "Table de stockage et retention des
    "erreurs
    *fin ajout FAE 30463
           t100.                  " Messages.
                       Déclaration des données internes                  *
    Table interne des anomalies.
    DATA: BEGIN OF itb_erreur OCCURS 0.
            INCLUDE STRUCTURE z00_bc_erreur.
    DATA: END OF itb_erreur.
    Nombre de jour pour la suppression des données dans la table des
    anomalies
    DATA: i_nb_jour(3) TYPE n.
    *début ajout FAE 30463
    DATA: w_dl_delai    LIKE z00_bc_err_log-z_delai,
          w_in_stockage LIKE z00_bc_err_log-z_stockage VALUE 'X'.
    *fin ajout FAE 30463
    Date et heure d'éxécution.
    DATA: i_dt_date_execution LIKE sy-datum,
          i_hr_heure_execution LIKE sy-uzeit.
    Date de suppression.
    DATA: z_date LIKE sy-datum.
    Compteur de session.
    DATA: o_ct_session LIKE z00_bc_cpt_sess-z_ct_session.
    Compteur pour le numéro de ligne de la table d'anomalie.
    DATA: l_ct_num_ligne LIKE z00_bc_erreur-z_no_num_ligne VALUE '00'.
    Données utile au remplissage de la table interne des anomalies.
    Nom du programme ABAP.
    DATA: i_repid LIKE z00_bc_erreur-z_repid.
    Libellé du traitement.
    DATA: w_lb_traitement LIKE itb_erreur-z_lb_lib_trait.
    Clé identifiant l'objet traité.
    DATA: i_ds_clef_objet LIKE z00_bc_erreur-z_ds_clef_objet.
    Code anomalie.
    DATA: i_cd_message LIKE sy-msgno.
    Type de message d'anomalie.
    DATA: i_ty_message LIKE sy-msgty.
    Classe de message.
    DATA: i_classe_message LIKE sy-msgid.
    Variable de message.
    DATA: i_msgv1 LIKE sy-msgv1,
          i_msgv2 LIKE sy-msgv2,
          i_msgv3 LIKE sy-msgv3,
          i_msgv4 LIKE sy-msgv4.
    Phase d'éxécution du programme.
    DATA: i_in_phase_exec LIKE z00_bc_erreur-z_in_phase_exec.
    Libellé de la clé.
    DATA: i_clef_objet(30).
    Constante.
    CONSTANTS: k_heure(8) VALUE 'Heure',                        "#EC NOTEXT
               k_code(4) VALUE 'Code',                          "#EC NOTEXT
               k_lb_message(80) VALUE 'Désignation',            "#EC NOTEXT
               k_ligne LIKE sy-linsz VALUE '127',
    k_societe LIKE sy-title VALUE 'SCHNEIDER ELECTRIC INDUSTRIES S.A.S.',
               k_projet LIKE sy-title VALUE 'LOGOS'.
                                TRAITEMENT                               *
    Nettoyage de la table interne et des données.
    FREE itb_erreur.
    CLEAR: i_msgv1,
           i_msgv2,
           i_msgv3,
           i_msgv4.
        Form F930_INIT                                                   *
    Fonction :                                                           *
    - Renseigne la table transparente des anomalies.                     *
    Donnée globale :                                                     *
    - ITB_ERREUR             Tables internes des erreurs.                *
    Entrées :                                                            *
    - I_REPID                Nom du programme en erreur.                 *
    - I_NB_JOUR              Nombre de jour avant la suppression des     *
                             enrgistrement de la lable Z00_BC_ERREUR.    *
    Sortie :                                                             *
    - O_CT_SESSION           Compteur de session.                        *
    FORM f930_init USING i_repid
                         i_nb_jour.
    Appel de la routine de suppression des vieux enregistrement.
      PERFORM f911_suppression_anomalie USING i_repid
                                              i_nb_jour.
    Mise à jour des compteur de session.
      PERFORM f912_maj_z00_bc_cpt_sess USING i_repid
                                       CHANGING o_ct_session.
    ENDFORM.
        Form F930_INIT_BLOCAGE                                           *
    Fonction :                                                           *
    - Suppression des vieux enregistrements
    - mise à jour table session
    Donnée globale :                                                     *
    - ITB_ERREUR             Tables internes des erreurs.                *
    Entrées :                                                            *
    - I_REPID                Nom du programme en erreur.                 *
    - I_NB_JOUR              Nombre de jour avant la suppression des     *
                             enrgistrement de la lable Z00_BC_ERREUR.    *
    Sortie :                                                             *
    - O_CT_SESSION           Compteur de session.                        *
    FORM f930_init_blocage USING i_repid
                                 i_nb_jour.
    Appel de la routine de suppression des vieux enregistrement.
    avec contrôle entrée de blocage
      PERFORM f911_suppression_anomalie_bloc USING i_repid
                                                   i_nb_jour.
    Mise à jour des compteur de session.
      PERFORM f912_maj_z00_bc_cpt_sess USING i_repid
                                       CHANGING o_ct_session.
    ENDFORM.
        Form F900_ERREUR                                                 *
    Fonction :                                                           *
    - Renseigne la table transparente des anomalies.                     *
    Donnée globale :                                                     *
    - ITB_ERREUR             Tables internes des erreurs.                *
    Donnée locale :                                                      *
    - l_CT_NUM_LIGNE         Compteur de ligne                           *
    - O_CT_SESSION           Numéro du compteur de session               *
    Entrées :                                                            *
    - I_REPID                Nom du programme en erreur.                 *
    - I_IN_PHASE_EXEC        Phase d'éxécution du programme              *
    - I_DS_CLEF_OBJET        Clé identifiant l'objet traité.             *
    - I_DT_DATE_EXECUTION    Date d'éxécution.                           *
    - I_HR_HEURE_EXECUTION   Heure d'éxécution.                          *
    - I_TY_MESSAGE           Type de message.                            *
    - I_CD_MESSAGE           code anomalie.                              *
    - I_CLASSE_MESSAGE       Classe de message.                          *
    - I_MSGV1                Variable de message.                        *
    - I_MSGV2                Variable de message.                        *
    - I_MSGV3                Variable de message.                        *
    - I_MSGV4                Variable de message.                        *
    FORM f900_erreur USING i_repid
                           i_in_phase_exec
                           i_ds_clef_objet
                           i_dt_date_execution
                           i_hr_heure_execution
                           i_ty_message
                           i_cd_message
                           i_classe_message
                           value(i_msgv1)
                           value(i_msgv2)
                           value(i_msgv3)
                           value(i_msgv4).                      "#EC CALLED
    DE3K913901 début ajout
    On récupère l'incrément qui sera inclu au n°de session :
      IF o_ct_session IS INITIAL
      AND i_repid = 'Z06_MMR001'.
        PERFORM f912_maj_z00_bc_cpt_sess USING 'Z06_MMR001'
                                         CHANGING o_ct_session.
      ENDIF.
    DE3K913901 fin ajout
    Nettoyage de la zone de l'en tete de la table interne.
      CLEAR itb_erreur.
    Incrementation du compteur du numéro de ligne de la table d'anomalie.
      l_ct_num_ligne = l_ct_num_ligne + 1.
    Remplissage de la table interne.
      MOVE: i_repid TO itb_erreur-z_repid,
            l_ct_num_ligne TO itb_erreur-z_no_num_ligne,
            i_dt_date_execution TO itb_erreur-z_dt_date_exec,
            i_hr_heure_execution TO itb_erreur-z_hr_heure_exec,
            w_lb_traitement TO itb_erreur-z_lb_lib_trait,
            i_in_phase_exec TO itb_erreur-z_in_phase_exec,
            i_ds_clef_objet TO itb_erreur-z_ds_clef_objet.
      CONCATENATE i_ty_message
                  i_cd_message
             INTO itb_erreur-z_cd_message.
    Récupération du libellé du message.
      CALL FUNCTION 'MESSAGE_TEXT_BUILD'
           EXPORTING
                msgid               = i_classe_message
                msgnr               = i_cd_message
                msgv1               = i_msgv1
                msgv2               = i_msgv2
                msgv3               = i_msgv3
                msgv4               = i_msgv4
           IMPORTING
                message_text_output = itb_erreur-z_lb_message.
    *début modification FAE 30463
    *Si  le flag est pas coché, on met à jour la table des erreurs
    *Z00_BC_ERREUR
    *s'il n'y a pas d'entrée dans la table on met aussi à jour
    *Z00_BC_ERREUR
      IF NOT w_in_stockage IS INITIAL.
    Mise à jour de la table.
        PERFORM f910_mise_a_jour.
      ENDIF.
    Mise à jour de la table interne.
      APPEND itb_erreur.
    Nettoyage des variables.
      CLEAR: i_msgv1,
             i_msgv2,
             i_msgv3,
             i_msgv4.
    *fin modification FAE 30463
    ENDFORM.
        Form F910_MISE_A_JOUR                                            *
    Fonction :                                                           *
    - Mets à jour les tables Z00_BC_CPT_SESS et Z00_BC_ERREUR.           *
    Donnée globale :                                                     *
    - ITB_ERREUR            Tables internes des erreurs.                 *
    FORM f910_mise_a_jour.
    Mise à jour des anomalies.
      MOVE-CORRESPONDING itb_erreur TO z00_bc_erreur.
      CONCATENATE itb_erreur-z_dt_date_exec
                  itb_erreur-z_hr_heure_exec
                  o_ct_session
             INTO z00_bc_erreur-z_no_num_session.
      MODIFY z00_bc_erreur.
    ENDFORM.
        Form F911_SUPPRESSION_VIEILLE_ANOMALIE                           *
    Fonction :                                                           *
    - Supprime les villes anomalies.                                     *
    Donnée globale :                                                     *
    - Z00_BC_ERREUR       Table des anomalies des programmes spécifiques.*
    Entrée :                                                             *
    - I_REPID             Nom du programme en erreur.                    *
    - I_NB_JOUR           Nombre de jour avant la suppression des        *
                          enrgistrement de la lable Z00_BC_ERREUR.       *
    FORM f911_suppression_anomalie USING i_repid
                                         i_nb_jour.
    début ajout FAE 30463
      SELECT SINGLE z_stockage z_delai
               INTO (w_in_stockage, w_dl_delai)
               FROM z00_bc_err_log
              WHERE z_repid = i_repid.
    *si le programme est dans la table z00_bc_err_log, on récupère la zone
    Z_DELAI (délai de rétention des erreurs)
    *sinon le délai est celui passé en paramètre de cette fonction
      IF sy-subrc = 0.
        z_date = sy-datum - w_dl_delai.
      ELSE.
        z_date = sy-datum - i_nb_jour.
      Pas d'enreg. ds table param, alors on stockera ds Z00_BC_ERREUR
        w_in_stockage = 'X'.
      ENDIF.
    fin ajout FAE 30463
    Suppression des enregistrements trop vieux.
      DELETE FROM z00_bc_erreur WHERE z_repid EQ i_repid
                                  AND z_dt_date_exec LE z_date.
    ENDFORM.
        Form F911_SUPPRESSION_ANOMALIE_BLOC                              *
    Fonction :                                                           *
    - Supprime les villes anomalies en tenant compte des objets de bloc  *
    Donnée globale :                                                     *
    - Z00_BC_ERREUR       Table des anomalies des programmes spécifiques.*
    Entrée :                                                             *
    - I_REPID             Nom du programme en erreur.                    *
    - I_NB_JOUR           Nombre de jour avant la suppression des        *
                          enrgistrement de la lable Z00_BC_ERREUR.       *
    FORM f911_suppression_anomalie_bloc USING i_repid
                                                 i_nb_jour.
    Blocage de la table
      CALL FUNCTION 'ENQUEUE_EZ00_BC_ERREUR'
        EXPORTING
          mode_z00_bc_erreur         = 'E'
          z_mandt                    = sy-mandt
          z_repid                    = i_repid
      X_Z_REPID                  = ' '
      _SCOPE                     = '2'
      _WAIT                      = ' '
      _COLLECT                   = ' '
        EXCEPTIONS
          foreign_lock               = 1
          system_failure             = 2
          OTHERS                     = 3.
    Suppression des enr que si la table pour ce pg n'est pas bloquée
    Si bloquée => ne rien faire car suppression aura déjà eu lieu
      IF sy-subrc EQ 0.
    début ajout FAE 30463
        SELECT SINGLE z_stockage z_delai
                 INTO (w_in_stockage, w_dl_delai)
                 FROM z00_bc_err_log
                WHERE z_repid = i_repid.
    *si le programme est dans la table z00_bc_err_log, on récupère la zone
    Z_DELAI (délai de rétention des erreurs)
    *sinon le délai est celui passé en paramètre de cette fonction
        IF sy-subrc = 0.
          z_date = sy-datum - w_dl_delai.
        ELSE.
          z_date = sy-datum - i_nb_jour.
        Pas d'enreg. ds table param, alors on stockera ds Z00_BC_ERREUR
          w_in_stockage = 'X'.
        ENDIF.
    fin ajout FAE 30463
    Suppression des enregistrements trop vieux.
        DELETE FROM z00_bc_erreur WHERE z_repid EQ i_repid
                                    AND z_dt_date_exec LE z_date.
    Déblocage de la table.
        CALL FUNCTION 'DEQUEUE_EZ00_BC_ERREUR'
             EXPORTING
         MODE_Z00_BC_ERREUR         = 'E'
                  z_mandt              = sy-mandt
                  z_repid              = i_repid.
      ENDIF.
    ENDFORM.
        Form F912_MAJ_Z00_BC_CPT_SESS                                    *
    Fonction :                                                           *
    - Renseigne la table transparente des sessions.                      *
    Données globales :                                                   *
    - z00_BC_CPT_SESS      Stockage des compteurs associés aux progs de  *
                           traitement.                                   *
    - Z00_BC_ERREUR        Table des anomalies des programmes spécifiques*
    Entrée :                                                             *
    - I_REPID              Nom du programme en erreur.                   *
    Sortie :                                                             *
    - O_CT_SESSION         Numéro de session.                            *
    FORM f912_maj_z00_bc_cpt_sess USING i_repid
                                  CHANGING o_ct_session.
    Blocage de la table
      CALL FUNCTION 'ENQUEUE_EZ00_BC_CPT_SESS'
        EXPORTING
          mode_z00_bc_cpt_sess       = 'E'
          z_mandt                    = sy-mandt
          z_repid                    = i_repid
      X_Z_REPID                  = ' '
      _SCOPE                     = '2'
      _WAIT                      = ' '
      _COLLECT                   = ' '
        EXCEPTIONS
          foreign_lock               = 1
          system_failure             = 2
          OTHERS                     = 3.
    Si la table est déjà vérouillée.
      IF sy-subrc NE 0.
        DO.
    Si c'est la 99eme fois que l'on reboucle alors on sort du programme.
          IF sy-index EQ 99.
            STOP.
          ENDIF.
    sinon attendre 1 seconde.
          WAIT UP TO 1 SECONDS.
    Blocage de la table
          CALL FUNCTION 'ENQUEUE_EZ00_BC_CPT_SESS'
            EXPORTING
              mode_z00_bc_cpt_sess       = 'E'
              z_mandt                    = sy-mandt
              z_repid                    = i_repid
             X_Z_REPID                  = ' '
             _SCOPE                     = '2'
             _WAIT                      = ' '
             _COLLECT                   = ' '
            EXCEPTIONS
              foreign_lock               = 1
              system_failure             = 2
              OTHERS                     = 3.
    Si table bloquée.
          IF sy-subrc EQ 0.
            EXIT.
          ENDIF.
        ENDDO.
      ENDIF.
    Lecture dans la table des sessions.
      SELECT SINGLE * FROM z00_bc_cpt_sess WHERE z_repid EQ i_repid.
    Contrôle si un enregistrement avec le même nom de programme existe et
    si le compteur de session est différent de '99'.
      IF sy-subrc EQ 0 AND z00_bc_cpt_sess-z_ct_session NE 99.
        z00_bc_cpt_sess-z_ct_session = z00_bc_cpt_sess-z_ct_session + 1.
        o_ct_session = z00_bc_cpt_sess-z_ct_session.
        MODIFY z00_bc_cpt_sess.
    Si un enregistrement avec le même nom de programme existe et
    si le compteur de session est égal à '99'.
      ELSEIF sy-subrc EQ 0 AND z00_bc_cpt_sess-z_ct_session EQ 99.
        o_ct_session = z00_bc_cpt_sess-z_ct_session.
        MODIFY z00_bc_cpt_sess.
    Sinon.
      ELSEIF sy-subrc NE 0.
        z00_bc_cpt_sess-z_ct_session = '00'.
        z00_bc_cpt_sess-z_repid = i_repid.
        o_ct_session = z00_bc_cpt_sess-z_ct_session.
        MODIFY z00_bc_cpt_sess.
      ENDIF.
      COMMIT WORK.
    Déblocage de la table.
      CALL FUNCTION 'DEQUEUE_EZ00_BC_CPT_SESS'
           EXPORTING
                mode_z00_bc_cpt_sess = 'E'
                z_mandt              = sy-mandt
                z_repid              = i_repid.
      X_Z_REPID                  = ' '
      _SCOPE                     = '3'
      _SYNCHRON                  = ' '
      _COLLECT                   = ' '
    ENDFORM.
        Form F920_TOP_OF_PAGE                                            *
    Fonction :                                                           *
    - Entête Schneider                                                   *
    Entrée :                                                             *
    - I_REPID              Nom du programme en erreur.                   *
    FORM f920_top_of_page USING i_repid.                        "#EC CALLED
    En-tete de page.
      CALL FUNCTION 'Z_00_BC_TOP_OF_PAGE'
           EXPORTING
                p_linsz   = k_ligne
                p_pagno   = sy-pagno
                p_prog    = i_repid
                p_projet  = k_projet
                p_societe = k_societe
                p_sujet   = sy-title.
      IF sy-subrc = 0.
      ENDIF.
    ENDFORM.
        Form F920_EDITION                                                *
    Fonction :                                                           *
    - Edition des erreurs.                                               *
    Données globales :                                                   *
    - ITB_ERREUR           Table interne des anomalies.                  *
    Entrée :                                                             *
    - I_REPID              Nom du programme en erreur.                   *
    - I_CLEF_OBJET,        Désignation de la clé de l'objet.             *
    FORM f920_edition USING i_repid
                            i_clef_objet.                       "#EC CALLED
    En-tete de tableau.
      WRITE AT (sy-linsz) sy-uline.
      WRITE:          sy-vline,
                      k_heure(8),
                      sy-vline,
                      k_code(4),
                      sy-vline,
                      k_lb_message(80),
                      sy-vline,
                      i_clef_objet.
      WRITE AT sy-linsz sy-vline.
      LOOP AT itb_erreur.
    Edition de la table interne des anomalies.
    Controle des couleurs.
        IF itb_erreur-z_cd_message(1) NE 'S'.
          IF itb_erreur-z_cd_message(1) EQ 'W'.
            FORMAT COLOR = 7 INTENSIFIED OFF.
          ELSEIF itb_erreur-z_cd_message(1) EQ 'I'.
            FORMAT COLOR = 3 INTENSIFIED OFF.
          ELSE.
            FORMAT COLOR = 6 INTENSIFIED OFF.
          ENDIF.
        ELSE.
          FORMAT COLOR = 5 INTENSIFIED ON.
        ENDIF.
        WRITE AT (sy-linsz) sy-uline.
        WRITE:          sy-vline,
                        itb_erreur-z_hr_heure_exec,
                        sy-vline,
                        itb_erreur-z_cd_message(4),
                        sy-vline,
                        itb_erreur-z_lb_message(80),
                        sy-vline,
    *Begin change PIT DE3K936510
                       itb_erreur-z_ds_clef_objet(27).
                        itb_erreur-z_ds_clef_objet(59).
    *End change PIT DE3K936510
        WRITE AT sy-linsz sy-vline.
      ENDLOOP.
      WRITE AT (sy-linsz) sy-uline.
    ENDFORM.
    INCLUDE: z00_bci010.                   " Gestion des anomalies.
                          Déclaration des données                        *
                       Tables de la bases de données                     *
    TABLES:
            ekpo,        " Poste document d'achat.
            lfa1,        " Base fournisseurs (généralités).
            marc,        " Données division de l'article.
            z03_bw_cmp1,
            eord,        "Répertoire des sources appro. Achats
            eina,        "Fiche infos-achats - données générales
            t024,        "Groupes d'acheteurs
            tvarv.                                              "FAE17345+
                       Déclaration des données internes                  *
    Déclaration de la table interne qui permet de recuperer les mois.
    DATA: BEGIN OF itb_months OCCURS 12.
            INCLUDE STRUCTURE t247.
    DATA: END OF itb_months.
    Table pour récupération d'infos sur les divisions
    DATA: BEGIN OF itb_t001w OCCURS 0,
            werks LIKE t001w-werks,
            fabkl LIKE t001w-fabkl," Clé du calendrier d'entreprise
          END OF itb_t001w.
    Déclaration de la table interne contenant les infos sur l'adresse du
    fournisseur.
    DATA: BEGIN OF itb_adresse OCCURS 0,
            lifnr LIKE lfa1-lifnr,           " Numéro de compte fournisseur.
            name1 LIKE lfa1-name1,                              " Nom 1.
            name2 LIKE lfa1-name2,                              " Nom 2.
            name3 LIKE lfa1-name3,                              " Nom 3.
            name4 LIKE lfa1-name4,                              " Nom 4.
            stras LIKE lfa1-stras,           " N° de rue et nom de la rue.
            pstlz LIKE lfa1-pstlz,           " Code postal.
            ort01 LIKE lfa1-ort01,           " Localité.
            pfach LIKE lfa1-pfach,           " Boîte postale.
            pstl2 LIKE lfa1-pstl2,           " Code de la boîte postale.
            land1 LIKE lfa1-land1,           " Clé de pays.
            landx LIKE t005t-landx,          " Pays.
            spras LIKE lfa1-spras,           " Code langue
    END OF itb_adresse.
    Déclaration d'une table interne pour les informations sur les
    prévisions de commande.
    DATA: BEGIN OF itb_prev_cde OCCURS 0,
            werks LIKE marc-werks,            " Division
            idnlf LIKE eina-idnlf,            " ADDsde ref article frn
            lifnr LIKE eord-lifnr,            " N° fournisseur.
            ekgrp LIKE marc-ekgrp,            " Groupe d'acheteurs
            dispo LIKE marc-dispo,            " Code gestionnaire MRP
            matnr LIKE eord-matnr,            " Article.
            maktx LIKE makt-maktx,            " Désignation article.
            bstmi LIKE marc-bstmi,            " Quantité de commande.
            men00 LIKE plaf-gsmng,            " Quantité du mois en cours M.
            men01 LIKE plaf-gsmng,            " Quantité pour le mois M+1.
            men02 LIKE plaf-gsmng,            " Quantité pour le mois M+2.
            men03 LIKE plaf-gsmng,            " Quantité pour le mois M+3.
            men04 LIKE plaf-gsmng,            " Quantité pour le mois M+4.
            men05 LIKE plaf-gsmng,            " Quantité pour le mois M+5.
            men06 LIKE plaf-gsmng.            " Quantité pour le mois M+6.
    DATA: END OF itb_prev_cde.
    Structure de travail pour les commandes convernant les PFC
    DATA str_pca_pfc  LIKE itb_prev_cde.
    *add sde
    DATA str_eord_pfc  LIKE itb_prev_cde.
    Structure de travail pour les prévisons PFC
    DATA str_prev_pfc LIKE itb_prev_cde.
    Déclaration d'une table interne pour les informations sur le
    portefeuille des commandes d'achat.
    DATA: BEGIN OF itb_pca OCCURS 0,
            werks LIKE ekpo-werks,    " Division
            idnlf LIKE eina-idnlf,     " ADDsde ref article frn
            lifnr LIKE eord-lifnr,    " N° fournisseur.
            ekgrp LIKE marc-ekgrp,    " Groupe d'acheteurs
            dispo LIKE marc-dispo,    " Code gestionnaire MRP
            matnr LIKE eord-matnr,    " Article.
            maktx LIKE makt-maktx,    " Désignation article.
            ebeln LIKE ekes-ebeln,    " Numéro du document d'achat.
            ebelp LIKE ekes-ebelp,    " Numéro de poste du document d'achat.
            slfdt LIKE eket-slfdt,    " Date de livraison statistique
            eindt LIKE ekes-eindt,    " Date de livraison indiquée dans la
                                      " confirmation de la cde.
            menge LIKE ekes-menge,    " Quantité indiquée dans la confirma-
                                      " tion de la commande.
            attdu LIKE eket-wemng,    " Portefeuille fournisseur.
            netpr LIKE ekpo-brtwr,    " Prix net du document d'achat dans
                                      " la devise du document.
            rtard TYPE i,             " Retard en jours ouvres.
            wemng LIKE eket-wemng,    " Quantité de l'entrée de marchandise.
            bldat LIKE mkpf-bldat,    " Date inscrite sur la pièce/sur le
                                      " document.
            qtran LIKE ekes-menge,    " Quantité en transit.
            dtran LIKE ekes-eindt.    " Date du dernier avis de transit.
    DATA: END OF itb_pca.
    DATA: w_i TYPE i,                "Compteur
          w_i_char(1) TYPE c,        "Texte pour récupérer compteur
          w_nm_zone(20) TYPE c,      "Nom zone pour assign au field-symbols
          w_nb_j TYPE i,             "Nb de jours ouvrés jusqu'à fin mois
          w_nb_j_tot TYPE i.         "Nb de jours ouvrés du mois
    FIELD-SYMBOLS:       TYPE ANY.
    Déclaration d'une table contenant les fiches info achat.
    DATA: BEGIN OF itb_eina OCCURS 0,
            matnr LIKE eina-matnr,
            lifnr LIKE eina-lifnr,
            idfnl LIKE eina-idnlf.
    DATA: END OF itb_eina.
    Déclaration d'une table contenant les infos groupe acheteur.
    *DATA: BEGIN OF itb_t024 OCCURS 0,
           ekgrp LIKE t024-ekgrp,
           eknam LIKE t024-eknam,
           ektel LIKE t024-ektel,
           telfx LIKE t024-telfx.
    *DATA: END OF itb_t024.
    Déclaration d'une table pour le transfert du fichier.
    DATA: BEGIN OF itb_transfert OCCURS 0,
            col00(8),                 "division
            col00bis(20),             "Reference article
            col01(18),                "No article
            col02(45),                "libelle article
            col021(17),               "Groupe acheteur
            col022(13),               "gestionnaire
            col03(17),                "qte commandée ou No de commande
            col04(13),                "Mois 1 ou No poste cde
            col05(20),                "Mois 2 ou délai initial
            col06(33),                "Mois 3 ou délai négocié
            col07(13),                "Mois 4 ou qté cdée
            col08(13),                "Mois 5 ou qté attendue
            col09(13),                "Mois 6 ou Montant attendu
            col10(13),                "Mois 7 ou retard
            col11(13),                "qte partielle livree
            col12(13),                "date livraison partielle
            col13(13),                "qté en transit
            col14(13).                "date
    DATA: END OF itb_transfert.
    Déclaration d'une table contenant la liste des fournisseurs.
    DATA: BEGIN OF itb_lifnr OCCURS 0,
            werks LIKE marc-werks,
            idfnl LIKE eina-idnlf,
            lifnr LIKE eord-lifnr,
            ekgrp LIKE marc-ekgrp,
            spras LIKE lfa1-spras,
            eknam LIKE t024-eknam,
            ektel LIKE t024-ektel,
            telfx LIKE t024-telfx.
    DATA: END OF itb_lifnr.
    Déclaration d'une structure pour la selection dans la table MSEG.
    DATA : BEGIN OF itb_mseg OCCURS 0,
             mblnr LIKE mseg-mblnr,
             mjahr LIKE mseg-mjahr,
             ebeln LIKE mseg-ebeln,
             ebelp LIKE mseg-ebelp,
           END OF itb_mseg.
    déclaration d'une structure pour la selection dans EKPO.
    DATA : BEGIN OF itb_ekpo OCCURS 0,
    ebeln LIKE ekpo-ebeln,
             lifnr LIKE ekko-lifnr,
             ekgrp LIKE ekko-ekgrp,
             ebelp LIKE ekpo-ebelp,
             matnr LIKE ekpo-matnr,
             werks LIKE ekpo-werks,
             menge LIKE ekpo-menge,
             bpumz LIKE ekpo-bpumz,
             netpr LIKE ekpo-netpr,
             peinh LIKE ekpo-peinh,  "Base de prix FAE17345+
              "AFT++
             bpumn LIKE ekpo-bpumn,
             dispo LIKE marc-dispo,   "AFT++
           END OF itb_ekpo.
    déclaration d'une structure pour la selection dans EKPO.
    DATA : BEGIN OF itb_ekko OCCURS 0,
             ebeln LIKE ekko-ebeln,
             lifnr LIKE ekko-lifnr,
             spras LIKE ekko-spras,
           END OF itb_ekko.
    déclaration d'une structure pour la selection dans EKES.
    DATA : BEGIN OF itb_ekes OCCURS 0,
             ebeln LIKE eket-ebeln,
             ebelp LIKE eket-ebelp,
             etens LIKE ekes-etens,
             ebtyp LIKE ekes-ebtyp,
             eindt LIKE ekes-eindt,
             menge LIKE ekes-menge,
             dabmg LIKE ekes-dabmg,
           END OF

    hai ,
    use code inspector to find the performance issue sorce code and also it gives some tips to tune the peformance.
    Go to program in display mode or editable mode and in  menu bar you
    have program menu in first......chose it and go to cheak....select it we have list including code inspector do it and tune it............
    plzz reward if useful
    regards,
    jai.m

  • Can I use same result set for two queries?

    Hi,
    Can I use the same result set for two queries?
    For example:
    ResultSet rs = null;
    rs = ps.executeQuery(query1);
    while (rs.next()) {
    rs = ps.executeQuery(query2);
    while (rs.next()) {
    Is it OK to use? or Is there any preformance issues?
    Appreciate your help.
    Thanks in advance.
    Prasad Vagolu

    Sure. You have a variable of ResultSet type. First you create a ResultSet and assign it to that variable. Then later you create another ResultSet and assign it to that same variable. Assigning an object reference to a variable takes essentially no time, and at any rate it isn't any faster to assign it to a different variable. Also, no matter whether you use one variable or two, you are still creating two ResultSets.
    However, you really should be closing your ResultSets after you finish using them. That's nothing to do with the assigning-to-a-variable question.

  • Problem in Retrive values from result set

    I have a class where i do all database operation .First i fire select query and take values from result set and based on that value i fire update query.
    Problem is that i am not getting all values from result set . i get only last value and when i fire update query i get error as :Resultset is closed.
    I am using acess and java.

    You probably are using the same Statement object for both queries? Try creating separate Statement objects for each query. (My guess is this a problem with the way you're using JDBC, not a Servlet issue.)

  • Query Error Information: Result set is too large; data retrieval ......

    Hi Experts,
    I got one problem with my query information. when Im executing my report and drill my info in my navigation panel, Instead of a table with values the message "Result set is too large; data retrieval restricted by configuration" appears. I already applied "Note 1127156 - Safety belt: Result set is too large". I imported Support Package 13 for SAP NetWeaver 7. 0 BI Java (BIIBC13_0.SCA / BIBASES13_0.SCA / BIWEBAPP13_0.SCA) and executed the program SAP_RSADMIN_MAINTAIN (in transaction SE38), with the object and the value like Note 1127156 says... but the problem still appears....
    what Should I be missing ??????  How can I fix this issue ????
    Thank you very much for helping me out..... (Any help would be rewarded)
    David Corté

    You may ask your basis guy to increase ESM buffer (rsdb/esm/buffersize_kb). Did you check the systems memory?
    Did you try to check the error dump using ST22 - Runtime error analysis?
    Edited by: ashok saha on Feb 27, 2008 10:27 PM

  • Result set does not fit; it contains too many rows

    Dear All,
    We are in BI7 and running reports on Excel 2007. Even though number of rows limitation in Excel 2007 is more than  1Million, when I try to execute a report with more than 65k records of output, system is generating output only for 65k rows with message "Result set does not fit; it contains too many rows".
    Our Patch levels:
    GUI - 7.10
    Patch level is 11
    Is there any way to generate more than 65000 rows in Bex?
    Thanks in advance...
    regards,
    Raju
    Dear Gurus,
    Could you please shed some light on this issue?
    thanks and regards,
    Raju
    Edited by: VaraPrasadraju Potturi on Apr 14, 2009 3:13 AM

    Vara Prasad,
    This has been discussed on the forums - for reasons of backward compatibility I do not think BEx supports more that 65000 rows .... I am still not sure about the same since I have not tried out a query with more that 65K rows on excel 2007 but I think this is not possible...

  • SAP Note: 1127156 Result set is too large

    Hi,
    The note 1127156 explains how to resolve the issue with removing the message "Result Set is too large." I want to check the settings in the template and it gives the following steps but i cannot find the settings on the Analysis web item of the data provider.
    Can someone pls help.
    Query View
    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:
         Maximum Number
         Default Number
         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.
    Many thanks

    Hi,
    I was facing the same issue in BEx analyzer 7.0. The query was working fine in BW 3.5 analyzer but gave error in BEx 7.0.
    When executed in web, it gave error result set is too large.
    The maximum no of cells that can be displayed is 750000.
    Please check the result set returned by the query. Also check note Note 1040454 - Front-end memory requirement of the BEx Analyzer.
    Some enhancement are planned to be delivered in enhancement package 1.
    Regards,
      Niraj

  • Large query result set

    Hi all,
    At the moment we have some java classes (not ejb - cmp/bmp) for search in
    our ejb application.
    Now we have a problem i.e. records have grown too high( millions ) and
    sometimes query results in retrieval of millions of records. It results in
    too much memory consumtion in our ejb application. What is the best way to
    address this issue.
    Any help will be highly appreciated.
    Thanks & regards,
    Parvez

    you can think of following options
    1) paging: read only few thousands at a time and maintain a index to page
    through complete dataset
    2) caching!
    a) you can create a serialized data file in server to cache the result set
    and can use that to browse through. you may do on the fly
    compression/uncompression while sending data to client.
    b) applet based solution where caching could be in client side. Look in
    http://www.sitraka.com/software/jclass/cs_ims.html
    thanks,
    Srinivas
    "chauhan" <[email protected]> wrote in message
    news:[email protected]...
    Thanks Slava Imeshev,
    We already have search criteria and a limit. When records exceeds thatlimit
    then we prompt user that it may take sometime, do you want to proceed? If
    he clicks yes then we retrieve those records. This results in lot ofmemory
    consumtion.
    I was thinking if there is some way that from database I can retrieve some
    block of records at a time rather the all records of a query. I wander how
    internet search sites work, where thousnds of sites/pages match criteriaand
    client can move back & front on any page.
    Regards,
    Parvez
    "Slava Imeshev" <[email protected]> wrote in message
    news:[email protected]...
    Hi chauhan,
    You may want to narrow search criteria along with processing a
    limited number of resulting records. I.e. if the size of the result
    is bigger than a limit, you stop fetching results and notify the client
    that search criteria should be narrowed.
    HTH.
    Regards,
    Slava Imeshev
    "chauhan" <[email protected]> wrote in message
    news:[email protected]...
    Hi all,
    At the moment we have some java classes (not ejb - cmp/bmp) for
    search
    in
    our ejb application.
    Now we have a problem i.e. records have grown too high( millions ) and
    sometimes query results in retrieval of millions of records. It
    results
    in
    too much memory consumtion in our ejb application. What is the best
    way
    to
    address this issue.
    Any help will be highly appreciated.
    Thanks & regards,
    Parvez

  • Result Set Too Large : Data Retrieval restricted by configuration

    Hi Guys,
    I get the above error when running a large dataset, with a hierarchy on - but when I run without a hierarchy I am able to show all data.
    The Basis guys increased the ESM buffer (rsdb/esm/buffersize_kb) but it still causes an issue.
    Anyone any ideas when it comes to reporting large volumes with a hierarchy?
    Much appreciated,
    Scott

    Hi there
    I logged a message on service marketplace andg got this reply from SAP:
    ' You might have to increase the value for parameters
    BICS_DA_RESULT_SET_LIMIT_DEF and BICS_DA_RESULT_SET_LIMIT_MAX as it
    seems that the result set is still too large. Please check your
    parameters as to how many data cells you should expect and set the
    parameter accordingly.
    The cells are the number of data points that would be send from abap
    to java. The zero suppression or parts of the result suppression are
    done afterwards. As a consequence of this, the number of displayed
    data cells might differ from the threshold that is effective.
    Starting with SPS 14 you get the information how many data cells are
    rejected. That gives you better ways to determine the right setting.
    Currently you need to raise the number to e.g. 2.000.000 to get all
    data.
    If BICS_DA_RESULT_SET_LIMIT_MAX is set to a lower value than
    BICS_DA_RESULT_SET_LIMIT_DEF, it would automatically cut the value of
    BICS_DA_RESULT_SET_LIMIT_DEF down to its own..
    Please note that altough this parameter can be increased via
    configuration, you should do a proper system sizing according to note
    927530 to ensure that the system can handle the number of users and
    resultset sizes you are expecting."
    Our basis team have subsequently apllied these changes, and I will be testing today.
    Thx

Maybe you are looking for