Home » RDBMS Server » Server Administration » Oracle object Problem Urgent....................
Oracle object Problem Urgent.................... [message #51511] Mon, 27 May 2002 22:33 Go to next message
Everest
Messages: 17
Registered: November 2001
Junior Member
Hi,
I am having the problem in Oracle Object... I would like to describe my problem in detail...

I created an object like following:

create type mytype_ty as object
(fname varchar2(25),
lname varchar2(25)
);
/

And i created a table like:

create table testobj
(
name mytype_ty,
phone number
);

Insert into testobj values (mytype_ty('Roshan','Maharjan'), 977141173);

Commit;

Now I am trying to select the data from the table where I used abstract datatype.....

SELECT NAME.FNAME FROM TESTOBJ;

The oracle displays the message "ora-00904: Invalid Column"

May I get the right solution for it...

Thank you for your time.......

Yours,
Roshan
Re: Oracle object Problem Urgent.................... [message #51512 is a reply to message #51511] Mon, 27 May 2002 23:24 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
You need to reference the table name with an alias in the select statement.

SQL> ed
Wrote file afiedt.buf

1* select e.name.fname from testobj e
SQL> /

NAME.FNAME
-------------------------
Roshan

SQL> select e.name.lname from testobj e;

NAME.LNAME
-------------------------
Maharjan
Previous Topic: Instalation problem
Next Topic: Temp segment
Goto Forum:
  


Current Time: Mon Sep 16 18:21:04 CDT 2024