Declaring records, PL-SQL Programming

Declaring Records

Whenever you define a RECORD type, you may declare records of that type, as the illustration shows:

DECLARE

TYPE StockItem IS RECORD (

item_no INTEGER(3),

description VARCHAR2(50),

quantity INTEGER,

price REAL(7,2));

item_info StckItem; -- declare record

The identifier item_info represents the whole record.

Like the scalar variables, the user-defined records can be declared as the formal parameters of the procedures and functions. An illustration is as shown:

DECLARE

TYPE EmpRec IS RECORD (

emp_id emp.empno%TYPE,

last_name VARCHAR2(10),

job_title VARCHAR2(15),

salary NUMBER(7,2));

...

PROCEDURE raise_salary (emp_info EmpRec);

Posted Date: 10/4/2012 3:36:27 AM | Location : United States







Related Discussions:- Declaring records, Assignment Help, Ask Question on Declaring records, Get Answer, Expert's Help, Declaring records Discussions

Write discussion on Declaring records
Your posts are moderated
Related Questions
Effects of NULL Operator As a general rule-but not a universal one-if NULL is an argument to an invocation of a system-defined read-only operator, then NULL is the result of t

How Exceptions Propagate ? Whenever an exception is raised, and if the PL/SQL cannot find a handler for it in the present subprogram or block, the exception propagates. That is

Using the FORALL Statement The keyword FORALL instruct the PL/SQL engine to bulk-bind input collections before sending them all to the SQL engine. Though the FORALL statement

Effects of NULL in Table Literal When a VALUES expression appears as the source value for an SQL INSERT statement, the key word NULL can appear as a field value, such that for

Use the NOCOPY Compiler Hint By default, the OUT and IN OUT parameters are passed by the value i.e. the value of an IN OUT actual parameter is copied into the corresponding fo

Parameter and Keyword Description: record_type_name: This identifies the user-defined type specifier that is used in the subsequent declarations of the records. NOT N

Case Sensitivity Similar to all the identifiers, the variables, the names of constants, and parameters are not case sensitive. For illustration, PL/SQL considers the following n

Keyword & Parameter Description: PRAGMA: These keywords signify that the statement is a pragma (i.e. compiler directive). The Pragmas are processed at the compile time, n

Multiple Assignment- SQL SQL supports multiple assignment to local variables and also applies multiple assignment semantics in SET clauses of UPDATE statements, but does not

Example of DELETE - SQL As with UPDATE, a FOR PORTION OF clause can be specified if the target table has a defined period name, as illustrated in Example. Example: Deleting