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
Data Types in SQL SQL's concept does not differ significantly from that defined in the theory book, apart from that business concerning NULL. However, the theory book equates

Using Operator VALUE: As you may expect, the operator VALUE returns the value of an object. The VALUE takes its argument a correlation variable.  For illustration, to return a

Many of the reports generated from the system calculate the total dollars in a shopper''s purchases. Follow these steps to create a function named TOT_PURCH_SF that accepts a shopp

Example of Tables within a Table - SQL Example: Obtaining C_ER from COURSE and EXAM_MARK SELECT CourseId, CAST (TABLE (SELECT DISTINCT StudentId, Mark FROM EXAM_MARK AS EM

Example of ADD CONSTRAINT in SQL Example: Alternative formulation for MAX_ENROLMENTS ALTER TABLE IS_ENROLLED_ON ADD CONSTRAINT MAX_ENROLMENTS CHECK ((SELECT COUNT (*)

Recursion versus Iteration Dissimilar the iteration, recursion is not crucial to PL/SQL programming. Any problem which can be solved using recursion can be solving using the it

Question: a) Given the following relation: Location(loc_id, bldg_code, room, capacity) The underlined field is a primary key. (i) Write a PL/SQL program using the impl

The Package Specification The package specifications contain the public declarations. The scopes of these declarations are local to your database representation and global to t

Defining and Declaring Collections To create the collections, you must define a collection type, and then declare the collections of that type. You can define the VARRAY types a

Advantages of PL/SQL The PL/SQL is a high-performance transaction processing, completely portable language that offers the following advantages as shown: 1) Support for SQL