Keyword and parameter description - cursors, PL-SQL Programming

Keyword and Parameter Description

select_statement:

This is a query which returns a result set of the rows. Its syntax is such that of select_ into_statement without the INTO clause.  When the cursor declaration declares the parameters, then each parameter should be used in the query.

RETURN:

This keyword introduces the RETURN clause that specifies the datatype of a cursor result value. You can use the %ROWTYPE attribute in the RETURN clause to give a record type that presents a row in the database table or a row returned by the formerly declared cursor. You can also use the %TYPE attribute to give the datatype of a formerly declared record.

The cursor body should have a SELECT statement and similar RETURN clause as its corresponding cursor specification. Also, the order, number, and datatypes of select items in the SELECT clause should match the RETURN clause.

parameter_name:

This identifies a cursor parameter; which is, a variable declared as the formal parameter of the cursor. The cursor parameter can become visible in a query where a constant can appear. The formal parameters of the cursor should be IN parameters. The query can also reference the other PL/SQL variables within its scope.

db_table_name:

This identifies a database table (or view) that should be accessible when the declaration is explained.

cursor_name:

This identifies an explicit cursor earlier declared within the present scope.

 record_name:

This identifies a user-defined record formerly declared within the present scope.

 record_type_name:

This identifies a RECORD type formerly defined within the present scope.

Posted Date: 10/8/2012 5:55:16 AM | Location : United States







Related Discussions:- Keyword and parameter description - cursors, Assignment Help, Ask Question on Keyword and parameter description - cursors, Get Answer, Expert's Help, Keyword and parameter description - cursors Discussions

Write discussion on Keyword and parameter description - cursors
Your posts are moderated
Related Questions
Using Invoker Rights: By default, the stored procedure executes with the privileges of its definer, not its invoker. These procedures are bound to the schema in which they inh

OUT Mode An OUT parameter returns values to the caller of a subprogram. Within the subprogram, an OUT parameter act like a variable. That means that you can use an OUT formal

Example of Shorthand for a row constraint Example: Shorthand for a row constraint ALTER TABLE EXAM_MARK ADD CONSTRAINT Mark_in_range CHECK (Mark BETWEEN 0 AND 100);

%ISOPEN The %ISOPEN yields TRUE if its cursor or cursor variable is open; or else, the %ISOPEN yields FALSE. In the illustration, you use the %ISOPEN to select an action:

Varrays versus Nested Tables The Nested tables are differing from varrays in the following ways: 1)  Varrays have a maximum size, while nested tables do not. 2)  Varrays are

Parameter and Keyword Description:   table_reference: This identifies a table or view which should be available when you execute the INSERT statement, and for that you sho

DBMS_PIPE: The Package DBMS_PIPE allows various sessions to communicate over the named pipes. (A pipe is a region of memory used by one of the process to pass information to


Loop Labels Like the PL/SQL blocks, loops can also be labeled. The label, an undeclared identifier enclosed by double angle brackets, should appear at the beginning of the LOOP

Controlling Cursor Variables You use 3 statements to control the cursor variable: OPEN-FOR, FETCH, & CLOSE. At First, you OPEN a cursor variable FOR a multi-row query. Then, y