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
Transaction Control The Oracle is transaction oriented; that is, Oracle uses the transactions to make sure the data integrity. The transaction is a sequence of SQL data manip

Create a procedure named DDPROJ_SP that retrieves project information for a specific project based on a project ID. The procedure should have two parameters: one to accept a projec

Use Object Types and Collections The Collection types and object types increase your efficiency by allowing for the realistic data modeling. The Complex real-world entities an

Row Operators The Row operators return or reference the particular rows. ALL retains the duplicate rows in the result of a query or in an aggregate expression. The DISTINCT el

THEO R Y OF ETERNITY OF LIFE (PRAYER - 1880) - The theory of eternity of life, also called the steady-state theory , states that life has ever been in existence as at presen

I have a Pascal Source file that needs to be compiled into a Service. In addition, there are various functions (Pascal Procedures I guess) that need to be created to Read and Write

Biconditional - SQL The biconditional p ↔ q can be expressed in Tutorial D by p = q and the same is true of SQL. The question then arises as to whether, in SQL, p = q is equiv

Using RENAME in combination with JOIN - SQL Example gives pairs of ids of students having the same name, by joining two renamings of IS_CALLED. Example gives an equivalent ex

Updating Tables in SQL The topic of updating by describing the assignment operator, ":=" in Tutorial D. SQL uses a different syntax for assignment, using the key word SET and

Advantages of Invoker Rights The Invoker-rights routines centralize the data retrieval. They are particularly helpful in applications which store data in various schemas. In su