Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Object Type Error
Originally posted by Chris \
> "Ed Prochak" wrote in message
> news:3E847FFF.1060607_at_adelphia.net"]| > | 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 ?.
>
>
Yes. Anchoring (%TYPE) is a PL/SQL concept, whereas CREATE TYPE is SQL. You can't do that - same as you can't do:
CREATE TABLE another_table
( fname MyTable.FirstName%TYPE, lname MyTable.LastName%TYPE, age MyTable.Age%TYPE
-- Posted via http://dbforums.comReceived on Tue Apr 01 2003 - 10:32:18 CST
![]() |
![]() |