Initializing records, PL-SQL Programming

Initializing Records

The illustration below shows that you can initialize a record in its type definition. Whenever you declare a record of the type TimeRec, its 3 fields suppose an initial value of zero.

DECLARE

TYPE TimeRec IS RECORD (

secs SMALLINT := 0,

mins SMALLINT := 0,

hrs SMALLINT := 0);

The illustration later shows that you can impose the NOT NULL constraint on any field, and so avoid the assigning of nulls to that field. The Fields declared as NOT NULL should be initialized.

DECLARE

TYPE StockItem IS RECORD (

item_no INTEGER(3) NOT NULL := 999,

description VARCHAR2(50),

quantity INTEGER,

price REAL(7,2));

Posted Date: 10/4/2012 3:37:11 AM | Location : United States







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

Write discussion on Initializing records
Your posts are moderated
Related Questions
Example of GROUPBY Operator Example: How many students sat each exam, using GROUP BY, NATURAL LEFT JOIN, and COALESCE SELECT CourseId, COALESCE (n, 0) AS n FROM COURS

Using Operator REF: You can retrieve refs by using the operator REF that, like VALUE, takes as its argument a correlation variable. In the illustration below, you retrieve one

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

Parameter and Keyword Description:   table_reference: This keyword identifies the table or view that should be accessible when you execute the UPDATE statement, and for wh

Magento change address format depending on store Project Description: What I need is that depending on the store in which the customer bought the address should change the fo

Product-specific Packages The Oracle and different Oracle tools are supplied with the product-specific packages which help you to build the PL/SQL-based applications. For illus

INSERT Statement The INSERT statement adds fresh rows of data to the specified database table or view. Syntax:

Effects of NULL for union - SQL The treatment of NULL in invocations of EXCEPT is as for UNION. This is different from its treatment in those of NOT IN and quantified compari

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

Lightweight system to provide and take info from workers in the field and office, have basic design outlined already just require build and implementation Desired Skills CSS,