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: Chris \( Val \) <chrisval_at_bigpond.com.au>
Date: Wed, 2 Apr 2003 00:17:56 +1000
Message-ID: <b6c72k$3kn0m$1@ID-110726.news.dfncis.de>

"Ed Prochak" <edprochak_at_adelphia.net> wrote in message news:3E847FFF.1060607_at_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

|
| >

Hi Ed.

I thought no one would ever reply to my post considering when I posted it, so thanks.

| Did you read the error message?

Yes, of course. That's why I posted, because it doesn't make any sense to me. I have created a user and granted that user(to which I am working under), DBA, RESOURCE and CONNECT.

| Is mytable a synonym?

No.

|Do you have priveleges to it?

I think so, yes see above ?.

| Does mytable have an attribute named "firstname"?

Yes.

| Is mytable in your current schema?

Yes.

| Is this part of a PL/SQL package or procedure and access to mytable is
| granted through a ROLE??

No. But I would like to create this object as shown above for use in a PL/SQL procedure.

| Does mytable even exist???

Yes.

| (other variations of why you cannot access 'MYTABLE.FIRSTNAME')

Such as ?.

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

I am using: Oracle 9i Personnel edition on a W2K Pro box.

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

Thanks.
Chris Val

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.465 / Virus Database: 263 - Release Date: 26/03/2003
Received on Tue Apr 01 2003 - 08:17:56 CST

Original text of this message

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