Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Whats the diffrence

Whats the diffrence

From: Khurram <oraware_at_gmail.com>
Date: 7 Jul 2006 04:41:04 -0700
Message-ID: <1152272464.562151.306530@75g2000cwc.googlegroups.com>


hi

CREATE TYPE person AS OBJECT (

  name        VARCHAR2(30),
  phone       VARCHAR2(20) );

CREATE TABLE person_table OF person;

SQL> CREATE TABLE person_table OF person;

Table created.

SQL> INSERT INTO person_table VALUES ('KHURRAM','6987270');

1 row created.

SQL> SELECT * FROM person_table;

NAME                           PHONE
------------------------------ --------------------
KHURRAM                        6987270

SQL> CREATE TABLE person_table1 (a PERSON);

Table created.

SQL> INSERT INTO person_table1 VALUES (person('KHURRAM','6987270'));

1 row created.

SQL> SELECT * FROM person_table1;

A(NAME, PHONE)



PERSON('KHURRAM', '6987270') My question is whats the differnce between

CREATE TABLE <tablename> OF <object type name>;

and

CREATE TABLE <tablename>
(<columnname> <object type name>);

Which is best to use ?
Is there any performance,syntax issue?

Khurram Received on Fri Jul 07 2006 - 06:41:04 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US