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 -> Re: Object Type Error

Re: Object Type Error

From: andrewst <member14183_at_dbforums.com>
Date: Tue, 01 Apr 2003 16:32:18 +0000
Message-ID: <2715945.1049214738@dbforums.com>

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 ?.

>

> A person told me during the week that it was not legal to use
> '%TYPE' in this situation, and this is what I'm not sure about.
>

> Could this be the case ?.
> irus Database: 263 - Release Date: 26/03/2003

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.com
Received on Tue Apr 01 2003 - 10:32:18 CST

Original text of this message

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