Oracle8i SQL Reference
Release 2 (8.1.6)

A76989-01

Library

Product

Contents

Index

Prev Up Next

Functions, 25 of 121


DEREF

Syntax


Purpose

DEREF returns the object reference of argument expr, where expr must return a REF to an object.

Example

CREATE TYPE emp_type AS OBJECT
   (eno NUMBER, ename VARCHAR2(20), salary NUMBER);
CREATE TABLE emp_table OF emp_type 
   (primary key (eno, ename));
CREATE TABLE dept_table 
   (dno NUMBER, mgr REF emp_type SCOPE IS emp_table);
INSERT INTO emp_table VALUES (10, 'jack', 50000);
INSERT INTO dept_table SELECT 10, REF(e) FROM emp_table e;
SELECT DEREF(mgr) from dept_table;

DEREF(MGR)(ENO, ENAME, SALARY)
--------------------------------------------------------
EMP_TYPE(10, 'jack', 50000)

Prev Up Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index