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: Ed Prochak <edprochak_at_adelphia.net>
Date: Fri, 28 Mar 2003 16:45:17 GMT
Message-ID: <3E847FFF.1060607@adelphia.net>


Chris ( Val ) wrote:
> "Chris ( Val )" <chrisval_at_bigpond.com.au> wrote in message
> news:b5k1a4$29c3fl$1_at_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 ?.
>
> Anyone out there ?.
>
> Cheers.
> Chris Val

>

Did you read the error message?

Is mytable a synonym? Do you have priveleges to it?   Does mytable have an attribute named "firstname"?   Is mytable in your current schema?
  Is this part of a PL/SQL package or procedure and access to mytable is granted through a ROLE??
  Does mytable even exist???
(other variations of why you cannot access 'MYTABLE.FIRSTNAME')

There are just too many possible answers to your question. But I suggest that the error message is telling you exactly what you need to know.

-- 
Ed Prochak
running: http://www.faqs.org/faqs/running-faq/
family:  http://web.magicinterface.com/~collins
--
"Two roads diverged in a wood and I
I took the one less travelled by
and that has made all the difference."
robert frost
Received on Fri Mar 28 2003 - 10:45:17 CST

Original text of this message

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