Selecting objects in pl sql, PL-SQL Programming

Selecting Objects:

Suppose that you have run the SQL*Plus script below that creates object type Person and object table persons, and that you have settled the table:

CREATE TYPE Person AS OBJECT (

first_name VARCHAR2(15),

last_name VARCHAR2(15),

birthday DATE,

home_address Address,

phone_number VARCHAR2(15))

/

CREATE TABLE persons OF Person

/

The sub query below produces a result set of the rows containing only the attributes of the Person objects:

BEGIN

INSERT INTO employees -- another object table of type Person

SELECT * FROM persons p WHERE p.last_name LIKE '%Smith';

Posted Date: 10/6/2012 8:17:38 AM | Location : United States







Related Discussions:- Selecting objects in pl sql, Assignment Help, Ask Question on Selecting objects in pl sql, Get Answer, Expert's Help, Selecting objects in pl sql Discussions

Write discussion on Selecting objects in pl sql
Your posts are moderated
Related Questions
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 supp

BETWEEN Operator The operator BETWEEN, tests whether the value lies in a specified series. That means "greater than or equivalent to low value and less than or equivalent to hig

Fetching from a Cursor Variable The FETCH statement retrieve rows one at a time from the product set of a multi-row query. The syntax for the same is as shown: FETCH {curso

Using DEFAULT You can use the keyword DEFAULT rather than that of the assignment operator to initialize the variables. For e.g. the declaration blood_type CHAR := ’O’; it can b

Closest Approximation to Relational Union - SQL Actually, just as SQL has several varieties of JOIN, it also has several varieties of UNION, none of which is equivalent to th

At times, Brewbean's has changed the id number for existing products. In the past, they have had to add a new product row with the new id to the BB_PRODUCT table, modify all the co

Effects of NULL in Table Literal When a VALUES expression appears as the source value for an SQL INSERT statement, the key word NULL can appear as a field value, such that for

SQL Operators The PL/SQL uses all the SQL set, comparison, and row operators in the SQL statements. This part briefly describes some of these operators.  1. Comparison Opera

NULL Statement The NULL statement clearly specifies in action; it does nothing other than to pass control to the next statement. It can, though, improve the readability. In a

Fetching Across Commits The FOR UPDATE clauses acquire exclusive all row locks. All rows are locked when you open the cursor, and when you commit your transaction they are unl