Scrollable cursors in oracle 8.1.7

We are devloping application which is using VB as a front-end and SQL Server 2000 & Oracle 8.1.7 as back-end. I have created the procedure in SQL Server 2000 in which we have made an extensive use of scrollable cursors. But now i want to create such procedure in oracle 8.1.7, But i am not getting any help regarding scrollable cursors in oracle 8.1.7. So can anyone tell me is there any scrollable attribute defined in oracle 8.1.7 so that the previous or next record can be retreived.
Thanks in Advance !

For further reading:
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1180618018840#3260280102622
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:127412348064#6969336986834
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:311216724461#31102007054659

Similar Messages

  • Scrollable cursors

    Hello
    I'm trying to explain why ansi style scrollable cursors are missing from Oracle to a group of people who are used to working with SQL server etc. Their position is that it's a pain in the backside to write a paging service into their application that will need to issue(taken from asktom)
    select *
      from ( select a.*, rownum rnum
               from ( YOUR_QUERY_GOES_HERE -- including the order by ) a
              where rownum <= MAX_ROWS )
    where rnum >= MIN_ROWSAs I understand, SQL server etc offer server side cached scrollable cursors but oracle does not. As I have seen so far, there is normally a very good reason why Oracle not to support a particular feature so in this case, does anyone know what it is?
    Cheers
    David

    Andrew,
    I've not been able to get a difinitive answer on whether JDBC supports the MS style scrollable cursors or not but from the discussion I had with a SQL server dba, he said that you could only specify the attributes of a cursor in TSQL. The more I thought about what our java guy was talking about and the inteded design of the system, the more I realised that he didn't really understand what he was asking. They are intending to use hibernate, which will generate SQL statements for basic crud operations and and wrap them in a set of java classes. They are not intending to use stored procs/ref cursors for anything so there is no way they could use the type of cursor he is on about (on SQL server or Oracle if it provided them)...or any declared type of cursor for that matter., they are just receiving result sets from straight sql statements.
    3360
    I have to agree with you whole heartedly. I've been on this contract for 5 weeks and so far I've produced one script to produce one table. The port is from a cobol system...The main idea is to treat the database as...you guessed it...a black box so that the application can be simply[i] put on any chosen database platform without batting an eyelid, and we retain all the "advantages" of platform independence.
    Anyway, with very little else to do all day I'll continue to look for other work while keeping an eye on the forums and reading some very interestiong articles on ask tom. Sorry for the little rant, but I am going slowy insane ;-)
    David

  • Oracle JDBC 8.1.6/Scrollable Cursor

    When using scrollable cursor on a table with varchar, getString() and getFloat() works but getObject() does not work. Why?

    Hi Ken,
    we have the same problem. getObject returns NULL on scrollable / updatable cursor while getString works. Using an ordinary statement (i.e. not JDBC2.0) both methods are working. We need the updatable cursor so if there will be no solution in time we have to switch back to an other database...
    Hopefully some one from Oracle will respond.
    Cheers.
    null

  • Problem with scrollable cursors

    Hello,
    When I try to make a cursor scrollable by using SQLSetStmtAttr with parameters SQL_ATTR_CURSOR_SCROLLABLE and SQL_SCROLLABLE I get the error "[Oracle][ODBC]Optional feature not implemented".
    I have tried it with different types of cursors (Static, Keyset Driven, Dynamic). Isolation level is READ COMMITTED (default). I use ODBC Oracle Driver 11.1.
    What am I doing wrong?

    Can you pls check this link
    How do I get scrollable cursors with instant client unixODBC driver?

  • FOR UPDATE on scrollable cursor and error: ORA-00907: missing right parenthesis

    If change my query to have a FOR UPDATE and make it an updatable scrollable cursor I get an error on the updateRow() command saying "ORA-00907: missing right parenthesis"
    If I remove the FOR UPDATE it works OK.
    The problem I have is trying to update a CLOB from a ResultSet. If I do not upate any other column I get the error saying that the error"
    "ORA-22920: row containing the LOB value is not locked"
    I can get around this by adding FOR UPDATE. But if I add FOR UPDATE and try to update any non-CLOB column I get the 00907 error above.
    Hmmmm. So here is what I can and cannot do:
    - I CAN update the CLOB IF I update another column 1st and NO FOR UPDATE clause.
    - I CAN update the CLOB only if I have FOR UPDATE clause.
    - I CANNOT update just the CLOB without FOR UPDATE.
    - I CANNOT update any non-CLOB column with FOR UPDATE.
    What a pain in the ***! How am I to provide generic access to the applications being built on my DB layer. This is crazy!

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Andrew Edgar ([email protected]):
    I have this same problem!
    The error occurs when performing updateRow.
    The turning off of auto commit only gets the query to work but not the actual update.
    Will this be fixed in the next version of the Driver?<HR></BLOCKQUOTE>
    Here is the stack Trace I recieved:
    java.sql.SQLException: ORA-00907: missing right parenthesis
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
    at oracle.jdbc.driver.UpdatableResultSet.execute_updateRow(UpdatableResultSet.java:2135)
    at oracle.jdbc.driver.UpdatableResultSet.updateRow(UpdatableResultSet.java:1322)

  • Scrollable Cursor in Stored Procedure

    I am trying to implement a scrollable cursor that exists in a stored procedure. Here is my situation:
    o Oracle 9i (9.2.0.1.0) for both client and server.
    o OCI Interface in purely C++ environment
    o I am able to compile/link program with 9i client library, and successfully fetch data from a stored proc that contains a nonscrollable/forward only/traditional cursor without any problems.
    I have a stored proc that looks like this:
    procedure test(
    testcursor out cv_types.cv_fit_data
    ) as
    begin
    open testcursor
    for select data_id,
    text
    from data;
    end test;
    This is where I run into problems:
    First I allocate an OCIStmt handle and bind it to the proc. Then using the stmt handle that points to the proc, I bind a secondary handle that points to the cursor (testcursor above) by calling OCIBindByPos with type=SQLT_REF (See OCI ref manual on binding ref cursor). Next, I execute the proc via OCIStmtExecute with the mode=OCI_STMT_SCROLLABLE_READONLY using the statement handle that points to the procedure. Then I use that secondary stmt handle to fetch the rows via OCIStmtFetch2(). I am able to fetch the rows if I stick to OCI_FETCH_NEXT, but when I attempt to use any scrollable features such as OCI_FETCH_ABSOLUTE, it bails with an ORA-24391 error. Upon further investigation, I found out that this error occurs when the stmt is not executed with mode=OCI_STMT_SCROLLABLE_READONLY. The clincher is that I did execute in that mode... Has anyone been faced with a similar situation? Am I tackling this the wrong way? Any help, even pointers to any docs I missed on the subject, is greatly appreciated.
    Thanks,
    Bryan
    I am using OCI in C++ to fetch the data via OCIStmtFetch2(...) method.

    vaidyanathanraja wrote:
    4. If there is a logical error, the same procedure should not generate data when it is rerun. Behaviour should be the same at all times.Incorrect. Something like NLS settings for example can make the same code, behave differently. E.g. a date string is passed and implicitly converted to a date. And this will work for most dates from different session using different NLS settings (e.g. yyyy/mm/dd versus yyyy/dd/mm). And these sessions will provide different results using the same parameters calling the same application code.
    There are a number of such run-time factors that influences code.
    5. Failed means it didn't generate the expected output. Which means that there is a problem with that SQL being executed the way it is, with the parameters used. You need to isolate the problem further.
    6. Parameter values are right.Have you proved that by using a test case that runs the very same SQL via a test proc, using the same parameter, via a job? Ran that test case interactively via sqlplus?
    You need to pop the hood and isolate the problem.
    7. I came across one blog saying different behaviour for REF CURSOR between oracle 10g and 11g and he says it is oracle bug. I don't know whether it is applicable for this case also.Bahumbug. There are many Oracle bugs. As there is in all software. However, you have not provided any evidence of a bug.
    Application code is behaving inconsistently. That is the symptom. Oracle system code is not relevant until you can prove that the inconsistency is not in the application code, but lower down the call stack.

  • Scrollable Cursor lockup

    Hi,
    I'm using scrollable cursors to page a large result set. When two identical queries are issued in two separate threads, the application stops responding.
    On examining the code I find that the lockup occurs in the scrollable result set code, in particular, the ScrollableCursor::next(int number) method.
    Has anyone seen this, or have a suggestion on a different approach for solving this problem? Am I doing something obviously wrong? I've tried using the scrollable policy shown below, as well as the default one.
    I'm using classes12.zip.
    The code for the query is as follows:
              ReadAllQuery readAllQuery = readAllQueryForClass(targetClass);
              readAllQuery.setSelectionCriteria(whereExpression);
              readAllQuery.useScrollableCursor();
              ScrollableCursorPolicy scrollableCursorPolicy = (ScrollableCursorPolicy) readAllQuery.getContainerPolicy();
              scrollableCursorPolicy.setResultSetConcurrency(ScrollableCursorPolicy.CONCUR_READ_ONLY);
              scrollableCursorPolicy.setResultSetType(ScrollableCursorPolicy.TYPE_SCROLL_INSENSITIVE);
              readAllQuery.addOrdering(sortedByExpression);
              ScrollableCursor scrollableCursor =
                   (ScrollableCursor) this.acquireUnitOfWork().executeQuery(readAllQuery);
    The next is as follows:
    scrollableCursor.next(intValue);
    Thanks in advance
    - ted

    Look in the concepts for definition
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14220/sqlplsql.htm#sthref3449
    They are however supported currently only in OCI and recent JDBC afaik, not in PL SQL ( however can be simulated by means of collections).
    Best regards
    Maxim

  • "Scroll" cursor in Oracle?

    I going to use server-side cursors from ADO.NET, like in this article.
    Creating and Managing Server-Side Cursors with ADO.NET:
    http://www.betav.com/Files/Content/Whitepapers/SS%20Cursors%20with%20ADO.NET.pdf
    Do Oracle has such kind of cursor ("scroll cursors")?
    PS. I'm newbie to databases and Oracle is my first experience.
    But in this article I've read about cursors that I ever meet in Oracle.
    Thanks in advance.

    > I just need to write simple application which will interact with Oracle in
    "connected mode".
    Unsure what is meant by "connected mode". You need to connect to Oracle to change data in Oracle. There is no other way.
    Whether that connection is made by a web application server, command line SQL*Plus, a tool like TOAD, or a client written in Delphi/Visual Basic... a connection must be made.
    > Logic is very easy "if user changed row it must be instantly changed in
    database"
    "Good Logic". Reason: often database rows are cached by the client. The client makes changes to its cached rows. The same thing happens at another client. That user too changes the cached rows. Both users now inform their client applications to "flush" (write/sync) these changed rows to the database. But now there is a conflict as both users have changed the same rows. There can only be one winner. Which means one of the user's changes will be written to the database, overwriting the changes made by the other user. This is called lost updates - and is a result of not locking rows in the database when planning to change those rows.
    Scrollable cursors depends on caching of data - which is not always a good idea. There is read consistency to consider, and the resources required for maintaining this scrollable cursor's results.
    > But yesterday I found this article and decided to write managed class to
    wrap such functionality. It's very sad that I can't do it in PL/SQL...
    Why not? This should be the standard consideration in client-server design. Stored procedures are used in the database to provide an abstraction layer - hiding the complexities of SQL (and different flavours of the language) from the client, hiding the complexities of the physical db design, etc.
    It also reduces the network bandwidth (stored proc calls are up to 80% smaller than SQL calls). Changes in this database does not impact the client. Database SQL tuning can be performed without having to touch and recompile a single character of client source code.
    Stored procs are essentially use to create an Application Programming Interface (API) for the client. The client can then implement these API calls (to stored procs) as classes.
    This approach is true for Oracle as it is for SQL-Server. And has been the preferred approach for client-server design since the early 90's.

  • Scrollable cursor

    whats the meaning of scrollable cursor when we use this cursor?

    Look in the concepts for definition
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14220/sqlplsql.htm#sthref3449
    They are however supported currently only in OCI and recent JDBC afaik, not in PL SQL ( however can be simulated by means of collections).
    Best regards
    Maxim

  • Viewer leaving open cursors in Oracle

    We are using the JRC to display reports in our software. We are running jboss-4.2.0 as our application server. The backend could be either SQL Server or Oracle. For Oracle we are using the oracle.jdbc.driver.OracleDriver driver. The reports are set up using a JDBC (JNDI) connection. Generally we have it working ok but in Oracle the JRC is leaving open cursors leading to  ORA-01000: MAXIMUM OPEN CURSORS EXCEEDED. I have found that a new cursor is opened when the data source is changed in the following code snippet
    Iterator tableIT = tableNames.iterator();
    while (tableIT.hasNext()) {
      ITable oldTable = (ITable)tableIT.next();
      ITable table = (ITable) ((IClone)oldTable).clone(true);
      table.setQualifiedName(table.getName());
      clientDoc.getDatabaseController().setTableLocation(oldTable, table);
    When we hit the last line in this loop, a new cursor is opened in Oracle so if a report has 10 tables, I get 10 cursors opened. I know that I need to close the cursors somehow but nothing I do seems to make a difference. After my processHttpRequest call to the viewer I added:
    crystalReportPageViewer.getReportSource().dispose();
    clientDoc.getReportSource().dispose();
    The code definately executes but the the number of open cursors in Oracle does not change. I am at a loss.

    A couple more things to think about then.
    1.  When you go through your loop to set your table location, you are using the clone method to create a new table and then pass that table to the report.  Cloning tables is no longer necessary with the JRC.  We do know that a fix was provided for the JRC SDK, however this fix would probably not have been applied to the clone method since it has been deprecated.
    I have attached a sample that shows the new methodology for setting table location; very similar, just not using clone anymore.
    2.  When you want to destroy any connections that the ReportClientDocument has made, you will need to call .close() on this object.  This can be done in conjunction with the viewer.dispose().  One thing to note is that if you call the .close() method, it will need to be done as the user is closing the browser, or you will not have access to your report object when you have it open in the HTML Viewer.

  • Cursor in ORACLE FORMS 10g/6i

    Dear All Seniors
    Please tell me with complete example about CURSORS in ORACLE 10g/ 6i.
    i.e
    -> declaration
    ->opening
    -> fetching
    -> close etc
    Shall be very thankfull to him.
    thanks in advance
    yassen

    Here is an example
    DECLARE
         /* cursor declaration */
         CURSOR C IS
         SELECT  EMP_MST.EMP_ID,EMP_MST.EMP_DESIG_ID,     
         EMP_MST.EMP_CODE, EMP_MST.EMP_NAME,
         DESIG_MST.DESIG_NAME,EMP_MST.EMP_MIN_DOLLAR,EMP_MST.EMP_GROSS_SAL,  EMP_MST.EMP_BASIC,
         EMP_MST.EMP_MOBILE_BILL,EMP_MST.EMP_TA,EMP_MST.EMP_FES_BONUS
         FROM EMP_MST, DEPT_MST,DESIG_MST
         WHERE NVL(EMP_MST.EMP_QUIT, 0) = 0
         AND EMP_MST.EMP_CID_ID=:GLOBAL.GUNIT_ID
         AND EMP_MST.EMP_DEPT_ID=:GLOBAL.GDEPT_ID
         AND EMP_MST.EMP_DEPT_ID=DEPT_MST.DEPT_ID
         AND EMP_MST.EMP_DESIG_ID=DESIG_MST.DESIG_ID
         AND EMP_MST.EMP_SAL_TYPE=1
         ORDER BY EMP_MST.EMP_CODE;
         ALT NUMBER;
         R C%ROWTYPE;
         N NUMBER;
         errnum NUMBER       := ERROR_CODE;
      V_COUNT NUMBER;
      SD_COUNT NUMBER;
         V_ADD_AMT NUMBER;
         V_ADD_DEDUCT NUMBER;
         V_SAL_ADD_AMT NUMBER;
    BEGIN     
         SELECT COUNT(SD_EMP_ID) INTO SD_COUNT
         FROM SALARY_DTL,SALARY_MST
         WHERE SALARY_DTL.SD_SM_ID=SALARY_MST.SM_ID
         AND SALARY_MST.SM_MONTH=:SALARY_MST.SM_MONTH;
    /*cursor open*/
         OPEN C;
         --=================
           IF errnum = 40508 THEN    
                ALT:=SHOW_ALERT('DUP_MYD');
                RAISE Form_Trigger_Failure;
           END IF;      
         --================     
              GO_BLOCK('SALARY_DTL');     
              IF SD_COUNT=0 THEN
              FIRST_RECORD;
              ELSE
                   LAST_RECORD;
                   NEXT_RECORD;
              END IF;
         LOOP
          FETCH C INTO R;               ----cursor fetch/read
          EXIT WHEN C%NOTFOUND;     
          :SALARY_DTL.SD_EMP_ID:=R.EMP_ID;         --- data assign...
          :SALARY_DTL.SD_DESIG_ID:=R.EMP_DESIG_ID;     
          :SALARY_DTL.TXT_EMP_CODE:=R.EMP_CODE;     
          :SALARY_DTL.TXT_NAME:=R.EMP_NAME;     
          :SALARY_DTL.TXT_DESIG:=R.DESIG_NAME;
          :SALARY_DTL.SD_OLD_GROSS_SAL:=R.EMP_GROSS_SAL;
          :SALARY_DTL.SD_GROSS_SAL:=ROUND(R.EMP_MIN_DOLLAR*:SALARY_MST.SM_DOLLAR_RATE);
    --      :SALARY_DTL.SD_ORG_BASIC:=R.EMP_BASIC;     
          :SALARY_DTL.SD_ORG_BASIC:=ROUND(:SALARY_DTL.SD_GROSS_SAL*60/100);
          :SALARY_DTL.SD_MOBILE_BILL:=R.EMP_MOBILE_BILL;     
          IF NVL(:SM_BONUS_MONTH,0) =1 THEN
               :SALARY_DTL.SD_FES_BONUS:=R.EMP_FES_BONUS;     
          ELSE
               :SALARY_DTL.SD_FES_BONUS:=NULL;
          END IF;
          NEXT_RECORD;     
         END LOOP;
         PREVIOUS_RECORD;
         CLOSE C;
    END;Hope this helps..

  • To_date function in cursor in oracle 8i

    Please tell me how to use to_date in cursor in oracle 8i. when i m using to_date in where clause in cursor it's giving error to_date function is out of scope.

    CURSOR C1 IS
    SELECT A.XO_NO,to_char(A.XO_DATE,'dd-mm-yyyy') XO_DATE,A.TO_CITY,A.FILE_CODE F_CODE,A.ARR_DATE,A.DEP_DATE,A.VCH_TYPE_CODE,
    A.VCH_NO,A.REMARKS,A.AMOUNT,A.COMP_CODE,to_char(A.SERVICE_DATE,'dd-mm-yyyy')SERVICE_DATE,
    B.AGENT_CODE,B.ROOM_TYP_CODE,
    (B.NO_OF_SINGLE+B.NO_OF_DOUBLE*2+B.NO_OF_EX_BED+B.NO_OF_TWIN*2) NO_OF_PAX,
    B.PER_SR SNGL_BED,B.PER_DR DOUBLE_BED,B.PER_EB TWIN,B.PER_DR EXTRA_BED,B.MEAL_PLAN,
    B.EXCH_RATE,A.FILE_CODE,C.COMP_NAME
    FROM XOS_MS A,QUOT_HOTEL_DS B,AC_COMPANY_MS C
    WHERE A.COMP_CODE=B.COMP_CODE
    AND A.XO_NO=B.XO_NO
              AND A.COMP_CODE=C.COMP_CODE
    AND TRUNC(A.XO_DATE)=TO_DATE('21/03/2005','DD/MM/YYYY');

  • Using Implicit REF Cursor in Oracle DB 12c

    For those interested in using ODP.NET implicit REF Cursors in Oracle DB 12c, the syntax is different from what was available in Oracle 11g. Here's a 12c-specific example:
    =======================
    Create or Replace PROCEDURE GetEmpAndDept
    AS
    EMPS  sys_refcursor;
    DEPTS  sys_refcursor;
    BEGIN
      OPEN EMPS for SELECT empno, ename from emp;
      dbms_sql.return_result(EMPS);
      OPEN DEPTS for SELECT deptno, dname from dept;
      dbms_sql.return_result(DEPTS);
    END;
    =======================
    // C#
    OracleConnection conn = new OracleConnection("User Id=scott; Password=tiger);
      conn.Open(); // Open the connection to the database
    // Create the command object for executing cmdTxt
      OracleCommand cmd = new OracleCommand("GetEmpAndDept", conn);
      cmd.CommandType = CommandType.StoredProcedure;
      OracleDataReader rdr = cmd.ExecuteReader();
      while(rdr.Read())
         Console.WriteLine("{0}\t{1}", rdr.GetInt32(0), rdr.GetString(1) );
      rdr.NextResult();
       while(rdr.Read())
           Console.WriteLine("{0}\t{1}", rdr.GetInt32(0), rdr.GetString(1) );

    i am using Oracle.ManagedDataAccess.dll v4.121.1.0
    Oracle Data Base 12c
    Visual Studio 2012 .net framework 4
    But if I use Unmanaged Dll I get implicit results in my .net application.

  • "fast cursor " in oracle

    Hi
    is there any concept "fast cursor " in oracle.Some one ask me this question.please help me.

    No, seriously, what is a "fast cursor" supposed to be? Possibly a close relative of a Better Performance using Fast Delete instead of Bulk Delete or Normal Delet? (One hopes not, of course.)

  • Scrollable Cursor Vs Cursored Stream

    While working with streams in Toplink, are there any general guidelines? I mean the scenarios in which Cursored stream is beneficial and the scenarios in which Scrollable cursor is beneficial.
    From the outset it appears to me that Scrollable cursor is a better option, because i see that Cursored Stream always generates an additional count(*) query when i retrieve the total size of the cursor and because of this takes more time as compared to a Scroallable cursor.
    Thanks in advance for any information on this.

    The cursored stream must use a separate query to figure out its size. The scrollable cursor can simply scroll to the end and then scroll back. Scrolling to the end and then back is typically less efficient then a separate count(*) query.
    Doug

Maybe you are looking for

  • Uadro

    I recently got a G5 with a 30" Cinema Display with the NVIDIA Quadro FX graphis card and discovered that the screen savers I have of nature lack enough resolution to be attractive on the new display. Does anyone know of a source of high resolution sc

  • Help with pass code locks

    My daughter has locked herself off her iPhone and totally messed up the settings to where I can't get into it to restore it. It has find my iPhone on how can we turn this off to restore it. I've looked everywhere for help. There is just a whole lot o

  • Table on Page One Blocking Layout/Section Break & Distinct Headers/Footers

    Is there any way to start a new Header/Footer on page 2, after a page one table that fills the page? I've created my first page as a Table (entire page) in order to recreate the front page of my newsletter, as used by a previous editor. Works great,

  • Problem with WebDynpro tutorial

    Hello Folks, i currently try out WebDynpro to get some experience with this technology. I used the "Web Dynpro for ABAP: Tutorial 1- Create a simple Web Dynpro Application" and created a table display using this "context" stuff with reference to a ta

  • Image in column

    hi can anyone help with my problem.... i have a table with 2 columns Col1 and Col2 , Col1 it's a primary key and filling from sequence , Col2 have only two value ( 0 or 1) i want that in my report in column Col2 shows images yes.gif or no.gif instead