Database selection with invalid cursor with MaxDB database

Hi Experts,
I encountered the this error:
"Database selection with invalid cursor
The database interface was called by a cursor (in a FETCH or CLOSE
cursor operation) that is not flagged as opened. This can occur if a
COMMIT or ROLLBACK was executed within a SELECT loop (which closes all
opened cursors), followed by another attempt to access the cursor (for
example, the next time the loop is executed)."
We are using bw support package 19 early this month. Previously is working fine but this problem occured from the last 2 days.
We are using MaxDB database.
Really appreciate any speedy responds.

Hi,
We finally resolved the issue.
The solution:
We check the RFC connection test in SM59. There are connection error.
There is an error that related J2EE_ADMIN user.
SO we reset the J2EE_ADMIN id in SU01.
The problem goes away.
Many thanks

Similar Messages

  • Database selection with invalid cursor !

    hi experts,
        When  execute SAP BW processchar, it occur some system error: (sm21)
    Database selection with invalid cursor
    The database interface was called by a cursor (in a FETCH or CLOSE
    cursor operation) that is not flagged as opened. This can occur if a
    COMMIT or ROLLBACK was executed within a SELECT loop (which closes all
    opened cursors), followed by another attempt to access the cursor (for
    example, the next time the loop is executed).
    this error occur when apply bw support package 19.
    sap notes 1118584 Solution is: Import Support Package 17 . but my support package is 19.
    how can i solve this error?
    thanks,
    xwu.

    I am only assuming things, but it might be worth to look closely if you were experiencing an ORA- error during the execution. This could have caused a rollback and thus closed the cursor. Please check the job log, the workprocess trace (dev_wX file) and the system log SM21 and ST22 as well.
    Besides that check the oracle alertlog and the usertrace destination.
    Best regards, Michael

  • Load data error: Database selection with invalid cursor (sm21)

    hi experts,
    when I execute processchar, it occur some system error:
    "Database selection with invalid cursor ",
    "Documentation for system log message BY 7 :
    The database interface was called by a cursor (in a FETCH or CLOSE
    cursor operation) that is not flagged as opened. This can occur if a
    COMMIT or ROLLBACK was executed within a SELECT loop (which closes all
    opened cursors), followed by another attempt to access the cursor (for
    example, the next time the loop is executed). "
    the error msg occur when apply bw support package19.
    data from DSO to CUBE, Transferred Recodes is not zero, but Added Recodes is zero.
    Request status always yellow, process is running.
    current sys info: BI7 and BW19, BASIS17,PI_BASIS17, the database is oracle10g R2.
    thanks for your help.

    I have solved this issue, The Oracle checkpoint not complete.
    thanks,
    xwu.

  • Processchar occur error:  Database selection with invalid cursor (sm21)

    hi,
       when I execute processchar, it occur some system error:
    "Database selection with invalid cursor ",
    "Documentation for system log message BY 7 :
    The database interface was called by a cursor (in a FETCH or CLOSE
    cursor operation) that is not flagged as opened. This can occur if a
    COMMIT or ROLLBACK was executed within a SELECT loop (which closes all
    opened cursors), followed by another attempt to access the cursor (for
    example, the next time the loop is executed). "
    the error msg occur when apply bw support package19.
    data from DSO to CUBE, Transferred Recodes is not zero, but Added Recodes is zero.
    Request status always yellow, process is running.
    current sys info: BI7 and BW19, BASIS17,PI_BASIS17, the database is oracle10g R2.
    thanks for your help.

    I have solved this issue , The Oracle checkpoint is not complete.
    thanks,
    xwu.

  • Database selection with Invalid Cursor error in RSDRI_INFOPROV_READ

    Hi Everyone.
    I am using RSDRI_INFOPROV_READ Function module for reading data from a multiprovider.
    Logic of the code is as following
    while <more data>
    CALL RSDRI_INFOPROV_READ reading data in E_T_DATA
    Append lines of E_T_DATA to EO_T_DATA.
    If total lines of data in EO_T_DATA > 200000
    <save EO_T_DATA in a file using GUI_DOWNLOAD>
    <clear EO_T_DATA>
    EndIF
    EndWhile.
    As soon as number of record exceed 200000 first file is saved, but after that next data call results in error.
    Error says "Database selection with invalid cursor".
    I suspect that this because of call to FM GUI_DOWNLOAD. While calling this FM after RSDRI_INFOPROV_READ causes system to commit and again the cursor is tried to open in next call casuing it to fail.
    But it is imperative for me to save data in file at regular intervals as data volume is huge.
    Any pointers in this direction will be helpful.

    Hi Everyone.
    I am using RSDRI_INFOPROV_READ Function module for reading data from a multiprovider.
    Logic of the code is as following
    while <more data>
    CALL RSDRI_INFOPROV_READ reading data in E_T_DATA
    Append lines of E_T_DATA to EO_T_DATA.
    If total lines of data in EO_T_DATA > 200000
    <save EO_T_DATA in a file using GUI_DOWNLOAD>
    <clear EO_T_DATA>
    EndIF
    EndWhile.
    As soon as number of record exceed 200000 first file is saved, but after that next data call results in error.
    Error says "Database selection with invalid cursor".
    I suspect that this because of call to FM GUI_DOWNLOAD. While calling this FM after RSDRI_INFOPROV_READ causes system to commit and again the cursor is tried to open in next call casuing it to fail.
    But it is imperative for me to save data in file at regular intervals as data volume is huge.
    Any pointers in this direction will be helpful.

  • Need help with **** Invalid Cursor State ****

    Hi,
    can someone tell me why am i getting this error....
    //******java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
    Any help is greatly appreciated.....
    Thanks in advance.
    //***********this is the output on servlet side**************//
    Starting service Tomcat-Standalone
    Apache Tomcat/4.0.3
    Starting service Tomcat-Apache
    Apache Tomcat/4.0.3
    init
    DBServlet init: Start
    DataAccessor init: Start
    Accessor init: Loading Database Driver: sun.jdbc.odbc.JdbcOdbcDriver
    DataAccessor init: Getting a connection to - jdbc:odbc:SCANODBC
    username SYSDBA
    password masterkey
    DataAccessor init: Preparing searchPolicy
    DataAccessor init: Prepared policySearch
    DataAccessor init: Prepared ssnSearch
    DataAccessor init: End
    After the myDataAccessor
    Database Connection...
    in doGet(...)
    SSSSSSSGetpolicynumber
    In GetPolicyInformation
    b05015195
    Getting Policy Informaton for = b05015195
    okay, building vector for policy
    in GetPolicyInformation for = b05015195
    starting query... policy Information
    finishing query... Policy Information
    Inside the while(next) loop
    sun.jdbc.odbc.JdbcOdbcResultSet@4db06e
    sun.jdbc.odbc.JdbcOdbcResultSet@4db06e
    b05015195
    policy information constructor with resultset
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6031)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188)
    at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3266)
    at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:
    5398)
    at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:326)
    at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:383)
    at viewscreenappletservlet.policyinformation.<init>(policyinformation.ja
    va:56)
    at viewscreenappletservlet.DatabaseAccessor.getPolicyInformation(Databas
    eAccessor.java:145)
    at viewscreenappletservlet.Servlet.policyDisplay(Servlet.java:108)
    at viewscreenappletservlet.Servlet.doGet(Servlet.java:91)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServl
    et.java:446)
    at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java
    :180)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
    at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
    at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
    torBase.java:475)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
    2343)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:180)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
    rValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
    468)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcesso
    r.java:1012)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.ja
    va:1107)
    at java.lang.Thread.run(Thread.java:484)
    result set closed
    1
    sending response
    Sending policy vector to applet...
    Data transmission complete.

    1) JDBC-ODBC driver is buggy
    2) Some drivers (truly speaking most of them) doesn't
    support cursors or supports them in a wrong way
    Paul

  • Going on my nerf with Invalid cursor state

    Hi all,
    It's going to make me mad : i can't retrieve value from resultset
    for(int t=0;t<Integer.parseInt(request.getParameter("ResList"));t++)
    ran=(int)(Math.random()*(maximum-minimum))+(minimum+1);
    System.out.println("Voici le chiffre randomiser : " + ran);
    renstr=entete+ran;
    System.out.println("Voici le str randomiser : " + renstr);
    psQuery= " SELECT Case_ID_, create_time, Requester_Name_,Description from aradmin.helpdeskcases where Case_ID_='" + renstr + "'";
    System.out.println("La reQ :" + psQuery);
    rs=statement.executeQuery(psQuery);
    //num=rs.getString("Case_Id_");
    //System.out.println("Contenu de num : " + num);
    result[t]=rs.getString(1);
    System.out.println("Le tabl:" + result[t]);
    //n++;
    //result[n]=rs.getString("Requester_name_");
    //n++;
    //result[n]=rs.getString("Description");
    }

    Maybe you don't have the record in the database where Case_ID_= dynamic value.
    Try to print the value of renstr(your dynamic value) and then print the query.
    Then run the same query as printed in the web page in your database. If you find records then try below in your jsp.
    rs=statement.executeQuery(psQuery);
    while(rs.nest()) {
    result[t]=rs.getString(1);
    System.out.println("Le tabl:" + result[t]);
    Rakesh.

  • Using Entry&Approval with MAXDB database

    Hi all,
    I'm trying to use the Entry&Approval module of SSM, but I'm getting into some problems that maybe someone can help me. I'm using SSM7.5 SP6 with MAXDB as my system database.
    I already create my PAS database, I create the metric sets, I put some data there, but when I try to load the data into PAS database I get this error in the trace file:
    LSS>
    LSS> ... WFMDE_SETUP.PRO FOR MAXDB
    LSS>
    LSS> output REVIEW_LOAD;SAMPLE over
    LSS> echo LOADSTARTED
    LOADSTARTED
    LSS> output off
    LSS>
    LSS> checkpoint update
    LSS> checkpoint freeze
    LSS>
    LSS> set control WFMDELINK SSM_CB_EA
    LSS>
    LSS> access lslink
    LSLink> connect SSM_CB_EA
    LSLink>
    LSLink> ... clear the scorecard status table
    LSLink> begin
    > DELETE FROM CPMS_SCORE_STATUS
    > WHERE CPMS_CONTEXT_ID IN (SELECT ID FROM CPMS_CONTEXT
    > WHERE CONTEXT_NAME IN (SELECT CONTEXT FROM CPMS_PASUSER
    > WHERE UPPER(USEDB) = UPPER('SAMPLE')))
    > end
    [SAP AG][SQLOD32 DLL][SAP DB] Base table not found;-4004 POS(13) Unknown table name:CPMS_SCORE_STATUS
    SQLSTATE: S0002
    SQL System code: -4004
    LSLink>
    LSLink> ... create the LOADALL proc that will run wfmde_load.pro once for each content set
    LSLink> begin
    > SELECT DISTINCT CPMS_EA_MASTER_ID
    > FROM CPMS_EA_DETAIL
    > WHERE ID IN
    > (
    > SELECT DISTINCT CPMS_EA_DETAIL_ID
    > FROM CPMS_EA_DATA, CPMS_EA_CUBES
    > WHERE CPMS_EA_DATA.CPMS_EA_CUBES_ID = CPMS_EA_CUBES.ID
    > AND UPPER(CUBE_NAME) = 'SAMPLE'
    > )
    > end
    [SAP AG][SQLOD32 DLL][SAP DB] Base table not found;-4004 POS(108) Unknown table name:CPMS_EA_DATA
    SQLSTATE: S0002
    SQL System code: -4004
    LSLink>
    +LSLink> lss create code = "job 'wfmde_load.pro' '" + CPMS_EA_MASTER_ID + "'"+
    LSLink> output proc LOADALL;PIPADMINDEFAULT
    LSLink> peek create nohead nonumb
    No Fields currently Selected
    ACC004:
    No Record Has Been Accessed From the Database.
    ACC004:
    No Record Has Been Accessed From the Database.
    CHE FRE
    CHE UPD
    In PAS I create the linkid ssm_cb_ea pointing to DB3 MAXDB database. I also try for the MAXDB1 database, but the same result
    [http://img713.imageshack.us/img713/8611/72008201.jpg]
    Looks like some tables are missing !?!?!? Did I do any mistake?
    Thanks in advance for all the help
    Pedro

    Hi Bob,
    thanks for your answer.
    I believe that in the LSSERVER.ini all the information is correct, because PAS is working fine, except the selects to the MAXDB database. Here it is the LSSERVER.INI
    [Windows]
    DEFAULTMEMORY=1200000
    DBHOME=C:\Program Files (x86)\SAP BusinessObjects\Strategy Management\ApplicationServer\HOME
    PAGEDB=C:\Program Files (x86)\SAP BusinessObjects\Strategy Management\ApplicationServer\HOME\PAGEDB
    MASTERDB=C:\Program Files (x86)\SAP BusinessObjects\Strategy Management\ApplicationServer\DATA\MASTERDB
    LOCKFILE=C:\Program Files (x86)\SAP BusinessObjects\Strategy Management\ApplicationServer\DATA\LSSLOCK
    JUICE=C:\Program Files (x86)\SAP BusinessObjects\Strategy Management\ApplicationServer\DATA\JUICE.ENG
    TBDB=C:\Program Files (x86)\SAP BusinessObjects\Strategy Management\ApplicationServer\DATA\TBDB.ENG
    APLIB=C:\Program Files (x86)\SAP BusinessObjects\Strategy Management\ApplicationServer\DATA\APLIB
    LIBDB=C:\Program Files (x86)\SAP BusinessObjects\Strategy Management\ApplicationServer\DATA\APLIB
    CGLIB=C:\Program Files (x86)\SAP BusinessObjects\Strategy Management\ApplicationServer\DATA\CGLIB
    SMREPORT=C:\Program Files (x86)\SAP BusinessObjects\Strategy Management\ApplicationServer\DATA\SMREPORT
    INITIAL=C:\Program Files (x86)\SAP BusinessObjects\Strategy Management\ApplicationServer\DATA\INITIAL
    DBPATH=C:\Program Files (x86)\SAP BusinessObjects\Strategy Management\InternetPub\Procs;C:\Program Files (x86)\SAP BusinessObjects\Strategy Management\ApplicationServer\HOME;C:\Program Files (x86)\SAP BusinessObjects\Strategy Management\ApplicationServer\DATA
    VERSION=940
    EDITFULLSCREEN=0
    EDITWINXPOS=0
    EDITWINYPOS=0
    EDITWINWIDTH=0
    EDITWINHEIGHT=0
    [Server]
    SERVERPATH=C:\Program Files (x86)\SAP BusinessObjects\Strategy Management\ApplicationServer
    [localhost]
    tcp_protocol=winsock
    username=pipadmin
    password=?
    PROTOCOL=TCP
    SERVICE=PILOT
    CURSOR=LSSCMPTR
    And when I said changing between DB's I was meaning the two MAXDB databases that exist on my system. I assume that the E&A stuff is stored in the DB3 (in my case) MAXDB database, no? I just test against the MAXDB1 database to be sure that I was not pointing to the wrong database. And because both are MAXDB databases, the proc's are the same.
    Pedro

  • Access Web Database - Select record and make report with all associated records

    Hey everyone,
    Right now I'm in the middle of trying to convert an Access client database to be web compatible and I'm running into some problems. For this question, I think I may need to explain a little bit about the database:
    The database I'm making is designed to store information about music rights for different songs. The users can input information about writers, producers, organizations, properties, businesses - which is stored all in different related tables. Then, when a
    user inputs a song, they choose which writers, produces, organizations, etc. are affiliated with that song. 
    What I'm trying to do is make a report where you can choose a writer from the list of all the writers and then produce a report with all of the songs by that writer. 
    I was able to do this in the Access client by making a report that, when opened would trigger (using the On Open event) a form to open where you would choose a writer from a combo box and then click a button. When the button was clicked, it would use the value
    in the combo box in a query, which would find all of the songs by that writer and then open up the report which would have the writer and all of their songs on it. 
    Because web reports don't have many event options and web queries are very limited, I have not found a way to make this report.
    Any help at all would be greatly appreciated!

    Hi,
    I found that you've cross post the quesion on our Answer forum, are you satisfiled the reply from there?
    http://answers.microsoft.com/en-us/office/forum/office_2010-access/web-database-select-record-and-make-report-with/04ce4e25-a964-4146-9a34-f9cb26bb0496
    Regards,
    George Zhao
    TechNet Community Support

  • DBIF_RSQL_INVALID_CURSOR: Invalid interruption of a database selection.

    I have created an external program that extracts a very large table from SAP 7.0 through RFC using the NetWeaver SDK APIs. This program repeatedly calls an RFC-enabled function written in ABAP. On the first
    call the function does "OPEN CURSOR WITH HOLD" and a "FETCH". On each subsequent call the function does a "FETCH". The cursor is declared as "STATICS".
    When I run the program I am getting the following error:
    DBIF_RSQL_INVALID_CURSOR: Invalid interruption of a database selection.
    This error manifests itself in two ways.
    1) When time interval between RfcInvoke() calls is about 0.5 sec., it takes 30 sec. to 90 sec. for the error to come out.
    2) When time interval between RfcInvoke() calls is about 0.2 sec. or lower, it takes 8 min. to 17 min. for the error to come out, but sometimes the program completes successfully in 25 min.
    1) What is causing this error?
    2) If it has something to do with SAP configuration, how it be modified to extract this particular table.
    3) Is it possible in general to extract a table of any size (on the magnitude of gigabytes) using such an approach, that is, a "pull".
    4) If the answer is negative, what approach do you think is appropriate.
    Any help will be appreciated.

    Hi Andrew Coleman  ,
                                     This error sounds like problem is in the way you are calling the RFC Function module (n -number of times). Looks like during the subsequent calls the Select / ENDSELECT  is failing need to check that logic.
    Thanks,
    Greetson

  • Error: Invalid interruption of a database selection

    Hi,
    When i execute the below code, the output is displayed without any problem.
    <b>tables lfa1.
    select * from lfa1 order by lifnr.
    write / lfa1-lifnr.
    endselect.</b>
    But however when i debug this piece of code, i get an error as below.
    ShrtText - Invalid interruption of a database selection
    Runtime Errors - DBIF_RSQL_INVALID_CURSOR
    Exceptn - CX_SY_OPEN_SQL_DB
    Can anybody help me with the reason for the occurence of this problem.

    Hi Vijay,
    Just go through the following link:
    Re: DBIF_RSQL_INVALID_CURSOR dump during debugging
    As Sooness pointed out, SELECT-ENDSELECT dumps only the first time. Try re-executing it and it will work fine.
    Meanwhile, it is always better to use INTO TABLE OF instead of SELECT-ENDSELECT, as this minimizes database hits.
    Regards
    Anil Madhavan

  • PLS-00428 Why SELECT must be adorned with REF CURSOR to work?

    hello
    *"PLS-00428: an INTO clause is expected in this SELECT statement"* - This problem has been resolved. I just want to understand WHY SELECT statements need to be paired with REF CURSOR.
              To reproduce this,
                   DECLARE
                        Id1 numeric(19,0);
                        Id2 numeric(19,0);
                        CreateTimestamp date;
                   BEGIN
                   -- ATTN: You'd either need to select into variable or open cursor!
                   select * from SystemUser left join Person on Person.Id = SystemUser.PersonId WHERE Person.PrimaryEmail in ('[email protected]','[email protected]');
                   END;
              Solution?
                   * In install script:
                        CREATE OR REPLACE PACKAGE types
                        AS
                             TYPE cursorType IS REF CURSOR;
                        END;
                   * Then in your query:
                        DECLARE
                             Id1 numeric(19,0);
                             Id2 numeric(19,0);
                             Result_cursor types.cursorType;
                        BEGIN
                        OPEN Result_cursor FOR select * from SystemUser left join Person on Person.Id = SystemUser.PersonId WHERE Person.PrimaryEmail in ('[email protected]','[email protected]');
                        END;
    I Googled for reasonable explaination - closest is: http://www.tek-tips.com/viewthread.cfm?qid=1338078&page=34
    That in oracle block or procedures are expected to do something and a simple SELECT is not!! (Very counter intuitive). What needs to be done is therefore to put the select output into a ref-cursor to fool oracle so that it thinks the procedure/block is actually doing something. Is this explanation right? Sounds more like an assertion than actually explaining...
    Any suggestion please? Thanks!

    Opening a cursor (ref cursor or otherwise) is not the same as executing a select statement.
    A select statement returns data, so if you are using it inside PL/SQL code it has to return that data into something i.e. a local variable or structure. You can't just select without a place for the data to go.
    Opening a cursor issues the query against the database and provides a pointer (the ref cursor), but at that point, no data has been retrieved. The pointer can then be used or passed to some other procedure or code etc. so that it may then fetch the data into a variable or structure as required.
    It's not counter-intuitive at all. It's very intuitive.

  • Invalid Cursor when I want to modify itab with READ TABLE ?

    Following code causes a core dump and says invalid cursor.
    What should I do if I want to change gt_itab .?
    REPORT  ZEV_READ_TABLE.
    data: begin of gt_itab occurs 0,
           key like vbrk-vbeln,
           name(10) type C,
           amount type i,
          end of gt_itab .
    start-of-SELECTION.
          gt_itab-key = 1.
          gt_itab-name = 'erkan'.
          gt_itab-amount = 10.
          append gt_itab.
          gt_itab-key = 2.
          gt_itab-name = 'dilem'.
          gt_itab-amount = 20.
          append gt_itab.
          LOOP AT gt_itab.
            write:/ gt_itab-key,
                    gt_itab-name,
                    gt_itab-amount.
          ENDLOOP.
          Read table gt_itab with key Key = 1.
           if sy-subrc = 0.
              gt_itab-amount = 100.
              modify gt_itab.
           endif.
    Kind Regards.
    Erkan VAROL

    Change the code this way & try
    modify gt_itab index sy-tabix.

  • I have a column where I have implemented writeback, its working fine. On top of this I need to show 0 as No and 1 as yes in our report, that is also done. Now I want to enter Yes in a column where it was no and I want database table to get update with 1.

    I have a column where I have implemented writeback, its working fine. On top of this I need to show 0 as No and 1 as yes in our report, that is also done. Now I want to enter Yes in a column where it was no and I want database table to get update with 1. I am not sure how to do it. SOmeone please help me out.

    Hi ,
    In your write back XML  try the below  query insert
    INSERT INTO TABLE_XYZ (attribute1)  values (SELECT CASE  WHEN @{C1}=’Yes’ then 1 when @{C1}=’No’ then 0 else null end from dual)
    Regards
    Rajagopal

  • Dealing with null values from a database (easy?)

    I'm sure this should be a simple question :
    I'm creating a dynamic dropdown of my companies products that once a product is selected draws values (links) from a database and displays them (links to User guides, FAQs etc).
    My problem is dealing with blank entries in the database - i.e. if a product doesn't have a User guide I've left the database blank.
    I'd like to show 'none' or 'not available' if the entry is blank rather than the 'null' I currently get.
    I'm sure it should be a straightforward if .... else .... but I'm struggling and would appreciate any help,
    Many thanks,
    Mo

    Thanks for the message, the cut down piece of code I'm using for the output is:
    <%
    while (rs.next())
    //header row
    out.println("<tr bgcolor='#666666'>");
    out.println("<td><font style='font-family:arial;color:#ffffff;font-size:10px;'>Product Name</font></td>");
    out.println("<td><font style='font-family:arial;color:#ffffff;font-size:10px;'>FAQs</font></td>");
    out.println("<td><font style='font-family:arial;color:#ffffff;font-size:10px;'>Technical Information</font></td>");
    out.println("</tr>");
    //results
    out.println("<tr border='1' bordercolor='#CCCCCC' bgcolor='#FFFFFF'>");
    out.println("<td><font style='font-family:arial;font-size:12px;font-weight:bold;'><a style='text-decoration:none' href=" + rs.getString("ProductURL") + " target='_blank'><font color='#669999'>" + rs.getString("ProductName") + "</a></td>");
    out.println("<td><font style='font-family:arial;color:#000000;font-size:10px;'>" + rs.getString("FAQs") + "</td>");
    out.println("<td><font style='font-family:arial;color:#000000;font-size:10px;'>" + rs.getString("TechInfo") + "</td>");
    out.println("</tr>");
    stmt.close();
    conn.close();
    %>
    It's the FAQs and TechInfo strings I need to use the statement on - if there's no entry show 'none',
    Thanks again,
    Mo

Maybe you are looking for

  • Can I go directly from OS 10.6.8 to Mavericks?

    I am currently on 10.6.8 on my Mcbook Pro. I have purchased OS 10.8.5 and it is on my iMac, but when I try to download it from the app store onto the laptop it gives an error and says it might be corrupted. So I thought I would just go to Mavericks.

  • Phase MAIN_SHDRUN/ACT_UPG hanging?

    <h5> I am upgrading from NW 7.0 Enhancement Package 1 (7.01) using SAPEhpi. The SAPEhpi tools shows that the ABAP progress has status RUNNING 'Executing phase MAIN_SHDRUN/ACT_UPG', and J2EE progress has status WAITING 'Waiting for synchronization eve

  • How to find data's from table whose sum=given input.

    Hi all, how to find values whose sum=given value. i have a master. table master table name amount a 1000 b 6000 c 2000 d 1500 input amount=4500 (may change); how to get name from master table whose sum(amount)=4500; i.e) a,c,d as output.

  • Annual tax report for customer/vendor (Italy) - RFIDITCVL program

    Hello, we're using the Annual tax report for customer/vendor (Italy) in the ECC 6.0 version but we've the following problems: - We only see a list of records in the List error section, where the field "Group" is not valued, so we don't know if the li

  • Images links (jpegs) that show on Macs but not PC?

    Okay, I'm curious! Help me out here if you can... I update images on a company website using a Mac. After updating, all testing on my end shows the image as it should. I have a co-worker test on there Mac and it's fine on their computer. But, when an