Oracle9i SQL Reference
Release 1 (9.0.1)

Part Number A90125-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Functions, 96 of 166


REF

Syntax

ref::=


Text description of functions43a.gif follows
Text description of ref

Purpose

In a SQL statement, REF takes as its argument a correlation variable (table alias) associated with a row of an object table or an object view. A REF value is returned for the object instance that is bound to the variable or row. The sample schema oe contains a type called cust_address_typ, described as follows:

 Attribute                                 Type
 ----------------------------- ----------------
 STREET_ADDRESS                    VARCHAR2(40)
 POSTAL_CODE                       VARCHAR2(10)
 CITY                              VARCHAR2(30)
 STATE_PROVINCE                    VARCHAR2(10)
 COUNTRY_ID                             CHAR(2)

Example

The following example creates a table based on cust_address_typ, inserts a row into the table, and retrieves a REF value for the object instance of the type in the addresses table:

CREATE TABLE addresses OF cust_address_typ;

INSERT INTO addresses VALUES (
   '123 First Street', '4GF H1J', 'Our Town', 'Ourcounty', 'US');

SELECT REF(e) FROM addresses e;

REF(E)
--------------------------------------------------------------------------------
00002802097CD1261E51925B60E0340800208254367CD1261E51905B60E034080020825436010101820
000

See Also:

Oracle9i Database Concepts 


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback