What are the Restrictions on Cursor Variables?Thanks Ramki, Hyd, TCS

Showing Answers 1 - 8 of 8 Answers

latha

  • Aug 18th, 2006
 

Hi RamaKrishna,Currently, cursor variables are subject to the following restrictions:You cannot declare cursor variables in a package spec. For example, the following declaration is not allowed:CREATE PACKAGE emp_stuff AS TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE; emp_cv EmpCurTyp; -- not allowedEND emp_stuff;You cannot pass cursor variables to a procedure that is called through a database link.If you pass a host cursor variable to PL/SQL, you cannot fetch from it on the server side unless you also open it there on the same server call.You cannot use comparison operators to test cursor variables for equality, inequality, or nullity.You cannot assign nulls to a cursor variable.Database columns cannot store the values of cursor variables. There is no equivalent type to use in a CREATE TABLE statement.You cannot store cursor variables in an associative array, nested table, or varray.Cursors and cursor variables are not interoperable; that is, you cannot use one where the other is expected. For example, you cannot reference a cursor variable in a cursor FOR loop.Regardslatha,Bangalore,TCS

mariashylaja

  • Aug 22nd, 2006
 

What a answere..... excellent...

  Was this answer useful?  Yes

Vidhya

  • Aug 23rd, 2006
 

Answer is very in-depth

  Was this answer useful?  Yes

stan

  • Sep 12th, 2006
 

No need of much more explanation....excellent answer latha..

  Was this answer useful?  Yes

rashid

  • Sep 20th, 2006
 

hi friend

cursor variable can't use with dynamic sql.

cursor variable can't use with in package because it is not having persistent state.

nulls can't assinged to cursor variable.

remote procedure can't accept cursor variable

  Was this answer useful?  Yes

Ashwini

  • Dec 23rd, 2006
 

Cursor Variable Restrictions

Cursor variables are subject to the following restrictions; Oracle may remove some of these in future releases.

  • Cursor variables cannot be declared in a package since they do not have a persistent state.

  • You cannot use RPCs (Remote Procedure Calls) to pass cursor variables from one server to another.

  • If you pass a cursor variable as a bind or host variable to PL/SQL, you will not be able to fetch from it from within the server unless you also open it in that same server call.

  • The query you associate with a cursor variable in an OPEN-FOR statement cannot use the FOR UPDATE clause.

  • You cannot test for cursor variable equality, inequality, or nullity using comparison operators.

  • You cannot assign NULLs to a cursor variable.

  • Database columns cannot store cursor variable values. You will not be able to use REF CURSOR types to specify column types in statements to CREATE TABLEs or CREATE VIEWs.

  • The elements in a nested table, index-by table, or variable array (VARRAY) cannot store the values of cursor variables. You will not be able to use REF CURSOR types to specify the element type of a collection.

  • Cursor variables cannot be used with dynamic SQL (through use of the DBMS_SQL package).

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions