Declaring records, PL-SQL Programming

Assignment Help:

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);


Related Discussions:- Declaring records

Example of cast operator - sql, Example of Cast Operator So long as C...

Example of Cast Operator So long as CAST is used as shown, we could obtain the total marks for each exam in similar fashion, using SUM (Mark) AS TotalMarks. However, this giv

Write an anonymous block that contains a pl/sql procedure, Write an anonymo...

Write an anonymous block that contains a PL/SQL procedure. The procedure takes two input parameter: oldZip and newZip, and it updates the zipcodes table by replacing all oldZip wit

Identifiers in pl/sql, Identifiers You use identifiers to name the PL/S...

Identifiers You use identifiers to name the PL/SQL program items and units that include constants, variables, cursors, exceptions, cursor variables, subprograms, and packages.

Using delete - collection method, Using DELETE This process has three ...

Using DELETE This process has three forms. The DELETE removes all elements from the collection. DELETE(n) removes the nth element from the nested table. When n is null, then D

Primary key - sql, Primary Key - SQL A PRIMARY KEY specification carri...

Primary Key - SQL A PRIMARY KEY specification carries an implicit NOT NULL constraint on each column of the specified key. When more than one key constraint is required, the k

Data types and representations, Data Types and Representations This ex...

Data Types and Representations This explains the concept possible representation, abbreviated possrep, and explains how these can be used in conjunction with constraints to de

Write sql queries, Write SQL queries to solve the following specifications....

Write SQL queries to solve the following specifications. Include the query AND THE OUTPUT.  A screen dump of the output is acceptable. Show as many rows as you can. A screen dump i

Comparison operators- pl/sql, Comparison Operators The Comparison operat...

Comparison Operators The Comparison operators can compare one expression to another. The outcome is always true, false, or null. Usually, you use a comparison operators in condi

Cursor variables as parameters, Cursor Variables As Parameters You can...

Cursor Variables As Parameters You can declare the cursor variables as the formal parameters of the functions and procedures. In the illustration below, you define the REF CUR

Declaring cursor variables, Declaring Cursor Variables Once a REF CURS...

Declaring Cursor Variables Once a REF CURSOR type is define by you, and then you can declare the cursor variables of that type in any PL/SQL block or subprogram. In the exampl

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd