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
What are 3 good practices of modeling and/or implementing data warehouses?

What Is a Package? The package is a schema object that group logically related PL/SQL items, types, and subprograms. The Packages usually have 2 parts, a specification & a bo

Dynamic Ranges The PL/SQL lets you determine the loop range dynamically at run time, as the example below shows: SELECT COUNT(empno) INTO emp_count FROM emp; FOR i IN 1..emp_cou

Implicit Cursor Attributes The Implicit cursor attributes returns the information about the execution of an INSERT, DELETE, UPDATE, or SELECT INTO statement. The cursor attribu

query to Find the account numbers of all customers whose balance is more than 10,000 $

DBMS_OUTPUT: The Package DBMS_OUTPUT enables you to display output from the PL/SQL subprograms and blocks, that makes it easier to test and debug them. The procedure put_ line

Cursor Attributes   The Cursors and cursor variables have 4 attributes which give you helpful information about the execution of a data manipulation statement. Syntax:

ORIGIN OF EARTH - BIG-BAN G HYPOTHESIS - Origin of life is linked to origin of earth. Cosmos, the Universe originated 10-20 billion years ago by Big Bang (thermonu

Declaring and Initializing Objects: An object type is once defined and installed in the schema; you can use it to declare the objects in any PL/SQL, subprogram, block or packa

WHEN or THEN Key Constraints Suppose a table has two columns representing a period of time throughout which the information conveyed by the other columns is recorded as having