Over 10 Million Study Resources Now at Your Fingertips


Download as :
Rating : ⭐⭐⭐⭐⭐
Price : $10.99
Language:EN
Pages: 2

These include rowtype matching rules

FETCH building_curvar
INTO home_rec;

/* If I got here, the site was a home, so display it. */ show_home_site (home_rec);
EXCEPTION
/* If the first record was not a home... */
WHEN ROWTYPE_MISMATCH
THEN
/* Fetch that same 1st row into the commercial record. */ FETCH building_curvar
INTO commercial_rec;

• An OPEN statement FOR that query was executed with the cursor variable.• A cursor variable was assigned a value from another cursor variable that refers to that query.

You can perform assignment operations with cursor variables and also pass these vari‐ables as arguments to procedures and functions. To make it possible to perform such actions between cursor variables (and to bind a cursor variable to a parameter), the different cursor variables must follow a set of compile-time and runtime rowtype matching rules.

Cursor Variables and REF CURSORs | 527

— One variable (or parameter) is of any strong REF CURSOR type, and the other is of any weak REF CURSOR type.

• A cursor variable (or parameter) of a strong REF CURSOR type may be OPEN FOR a query that returns a rowtype that is structurally equal to the rowtype_name in the original type declaration.

• A cursor variable (or parameter) of a weak REF CURSOR type may be made to refer to a query of any rowtype, regardless of the query or cursor object to which it may have referred earlier.

• A cursor variable (or parameter) of a strong REF CURSOR type may be made to refer only to a query that matches structurally the rowtype_name of the RETURN clause of the REF CURSOR type declaration.

Cursor variable aliases

If you assign one cursor variable to another cursor variable, they become aliases for the same cursor object; i.e., they share the reference to the cursor object (the result set of

528 |
How It Works
Login account
Login Your Account
Add to cart
Add to Cart
Payment
Make payment
Document download
Download File
PageId: ELICDDA13E
img
Uploaded by :
RE5P5kzo
Page 1 Preview
these include rowtype matching rules
Sell Your Old Documents & Earn Wallet Balance