Home » SQL & PL/SQL » SQL & PL/SQL » ORA-00902: invalid datatype
ORA-00902: invalid datatype [message #224617] Wed, 14 March 2007 15:21 Go to next message
sireeshraju
Messages: 32
Registered: October 2005
Member

CREATE TYPE dept_typ AS OBJECT
( mgr Person_typ,
emps Person_nt);
CREATE TABLE dept OF dept_typ; 
ORA-00902: invalid datatype
Re: ORA-00902: invalid datatype [message #224621 is a reply to message #224617] Wed, 14 March 2007 15:30 Go to previous messageGo to next message
joy_division
Messages: 4641
Registered: February 2005
Location: East Coast USA
Senior Member
That is not the proper syntax for create table. You use a TYPE in table definitions like you would use any other datatype such as DATE or VARCHAR2.

[Updated on: Wed, 14 March 2007 15:31]

Report message to a moderator

Re: ORA-00902: invalid datatype [message #224626 is a reply to message #224617] Wed, 14 March 2007 15:54 Go to previous messageGo to next message
sireeshraju
Messages: 32
Registered: October 2005
Member

Hi Joy,

This one i copied directly from Oracle Corporation Pl/sql Material.This is the way it has been given in there.They are creating a table based on an object.I think this can be done.Correct me if I am wrong?
Re: ORA-00902: invalid datatype [message #224632 is a reply to message #224626] Wed, 14 March 2007 19:43 Go to previous messageGo to next message
jdufour
Messages: 4
Registered: March 2007
Junior Member
Have you created types for person_typ and person_nt?
Re: ORA-00902: invalid datatype [message #224785 is a reply to message #224626] Thu, 15 March 2007 08:12 Go to previous messageGo to next message
joy_division
Messages: 4641
Registered: February 2005
Location: East Coast USA
Senior Member
sireeshraju wrote on Wed, 14 March 2007 16:54
Hi Joy,

This one i copied directly from Oracle Corporation Pl/sql Material.This is the way it has been given in there.They are creating a table based on an object.I think this can be done.Correct me if I am wrong?


Sorry, Sireeshraju, my mistake, the create table command is correct, but there must be something wrong with the creation of your TYPEs beforehand.
Re: ORA-00902: invalid datatype [message #225062 is a reply to message #224617] Fri, 16 March 2007 18:51 Go to previous messageGo to next message
srinivasocp
Messages: 91
Registered: December 2005
Location: INDIA
Member
CREATE TYPE Person AS OBJECT (
first_name VARCHAR2(15),
last_name VARCHAR2(15),
birthday DATE,
home_address Address,
phone_number VARCHAR2(15))
/
CREATE TABLE persons OF Person;

Even this is givng the error ORA-00902: invalid datatype.
I can't understand why?Can someone help me.
Re: ORA-00902: invalid datatype [message #225065 is a reply to message #224617] Fri, 16 March 2007 19:05 Go to previous messageGo to next message
BlackSwan
Messages: 25041
Registered: January 2009
Location: SoCal
Senior Member
>home_address Address,
HUH? might "address" not be a valid data type?
Re: ORA-00902: invalid datatype [message #225066 is a reply to message #224617] Fri, 16 March 2007 19:10 Go to previous messageGo to next message
srinivasocp
Messages: 91
Registered: December 2005
Location: INDIA
Member
Apologise for my post...Address which i used is not a valid type.
I corrected it ..Thanks
Re: ORA-00902: invalid datatype [message #225067 is a reply to message #224617] Fri, 16 March 2007 19:16 Go to previous messageGo to next message
BlackSwan
Messages: 25041
Registered: January 2009
Location: SoCal
Senior Member
If you can not debug simple SYNTAX errors (repeatedly), maybe you should go into a different field where you do not have to pay so much attention to details.

IMO, Object Oriented programming should NEVER, EVER be brought into an RDBMS by a novice; if ever by an expert.
It is like trying to mix oil & water. It takes a lot of energy to make them play nice together.
Re: ORA-00902: invalid datatype [message #225206 is a reply to message #225067] Mon, 19 March 2007 02:39 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
@Anacedent - Is that level of personal attack really neccessary?
I know I've made equally simple mistakes in the past, and I'm pretty sure that the same goes for most of the regular poster here.
Re: ORA-00902: invalid datatype [message #225277 is a reply to message #224617] Mon, 19 March 2007 08:42 Go to previous messageGo to next message
seraphstream
Messages: 8
Registered: March 2007
Junior Member
A common reason for this error is that the user has COMPATIBILITY set to V6. This may be because they have it set in the script they are running, have it set in glogin.sql or login.sql or they are running SQL*PLus 3.0 (which only runs in V6 - or V5! - compatibility mode)

see


ORA-00902: invalid datatype


bye

Cool
Re: ORA-00902: invalid datatype [message #225309 is a reply to message #225277] Mon, 19 March 2007 11:47 Go to previous messageGo to next message
joy_division
Messages: 4641
Registered: February 2005
Location: East Coast USA
Senior Member
seraphstream wrote on Mon, 19 March 2007 09:42
A common reason for this error is that the user has COMPATIBILITY set to V6. This may be because they have it set in the script they are running, have it set in glogin.sql or login.sql or they are running SQL*PLus 3.0 (which only runs in V6 - or V5! - compatibility mode)



I am anxious to see the answer to this because I'll bet you can count on a single hand the number of sites that have compatibility set to V5 or V6. Didn't those versions get discontinued in the 1980's? I started on V5 in 1991, and at that time it was kind of outdated if I recall.
Re: ORA-00902: invalid datatype [message #225676 is a reply to message #225309] Tue, 20 March 2007 21:38 Go to previous message
sireeshraju
Messages: 32
Registered: October 2005
Member

HI anacedent
Quote:
If you can not debug simple SYNTAX errors (repeatedly), maybe you should go into a different field where you do not have to pay so much attention to details.

IMO, Object Oriented programming should NEVER, EVER be brought into an RDBMS by a novice; if ever by an expert.
It is like trying to mix oil & water. It takes a lot of energy to make them play nice together.


@anacedent -- Mind your words Mr.anacedent,It will definitely hurt others.IF you know the answer reply for that or else mind your work.I think moderator has to take some steps to avoid this kind of abuse from other users.Only moderator has the right to advice the members.

@moderator--Please take care that this kind of personal abuse on the level of technical ground will not happen in future.Guys like anacedent will definitely screw the whole purpose of this site.This site is to share knowledge for both novice and experts.

[Updated on: Tue, 20 March 2007 21:41]

Report message to a moderator

Previous Topic: NEW Keyword
Next Topic: how to find top 3 salary of emp table with out using order by clause
Goto Forum:
  


Current Time: Tue Dec 06 14:19:25 CST 2016

Total time taken to generate the page: 0.13561 seconds