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

Home -> Community -> Usenet -> c.d.o.misc -> Object Type Error

Object Type Error

From: Chris \( Val \) <chrisval_at_bigpond.com.au>
Date: Sun, 23 Mar 2003 21:12:22 +1100
Message-ID: <b5k1a4$29c3fl$1@ID-110726.news.dfncis.de>


Hi everyone.

I'm not sure if this is allowed, but here is what I'm trying to do.

I can create an object type like so:

CREATE OR REPLACE TYPE MyType AS OBJECT
(

  fname VARCHAR2( 30 ),
  lname VARCHAR2( 30 ),
  age NUMBER( 3 )
 );

But when I try to create it using the '%TYPE', I get the error listed below(after typing show errors), but I'm not sure why.

CREATE OR REPLACE TYPE MyType AS OBJECT
(

  fname MyTable.FirstName%TYPE,
  lname MyTable.LastName%TYPE,
  age   MyTable.Age%TYPE

 );

Errors for TYPE MYTYPE:

LINE/COL ERROR

-------- ----------------------------------------------------------
0/0      PL/SQL: Compilation unit analysis terminated
3/9      PLS-00201: identifier 'MYTABLE.FIRSTNAME' must be declared


Can someone advise as to why I can't do this please ?.

Thanks.
Chris Val

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
Received on Sun Mar 23 2003 - 04:12:22 CST

Original text of this message

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