Home » SQL & PL/SQL » SQL & PL/SQL » Compliation errors and Please Help with Nested Table merged (many)
icon4.gif  Compliation errors and Please Help with Nested Table merged (many) [message #413299] Wed, 15 July 2009 03:33 Go to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
i keeep gettin this error when i enter this code
Create type Patient_Type as object
(PtNo number(6),
Name Varchar2(50),
Address Varchar2(50),
Next of Kin Varchar2(50),
DentistNo DentistType );


warning type created with compliation errors.

and the same for this one too

Create type DentistType as object
(EmpNo Number(6),
DentistNo Number(6),
Name Varchar2(50),
appointmentNo Number(3)
Patient PatientType );
Re: Compliation errors [message #413301 is a reply to message #413299] Wed, 15 July 2009 03:37 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Type "show err" to, well, show the errors.

Although I'm not sure this sort of "circular" reference is possible.
Compliation errors [message #413302 is a reply to message #413299] Wed, 15 July 2009 03:40 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
Create type DentistType as object
(EmpNo Number(6),
DentistNo Number(6),
Name Varchar2(50),
appointmentNo Number(3)
Patient PatientType );

warning type create with complication errors
Re: Compliation errors [message #413303 is a reply to message #413301] Wed, 15 July 2009 03:42 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
PLS-00103: Encountered the symbol "OF" when expecting one of the following: <an identifier> <a double-quoted delimited-identif ier> LONG_ double ref char time timestamp interval date binary national character nchar
Re: Compliation errors [message #413304 is a reply to message #413302] Wed, 15 July 2009 03:42 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Have a look in USER_ERRORS and tell us what the actual error was.
Re: Compliation errors [message #413305 is a reply to message #413302] Wed, 15 July 2009 03:43 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
PLS-00103: Encountered the symbol "OF" when expecting one of the following: <an identifier> <a double-quoted delimited-identif ier> LONG_ double ref char time timestamp interval date binary national character nchar
Re: Compliation errors [message #413306 is a reply to message #413303] Wed, 15 July 2009 03:44 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Your two types appear to be interdepent, which I don't think is allowed.

Can you cut and paste an SQL session showing this error happening?
Re: Compliation errors [message #413308 is a reply to message #413306] Wed, 15 July 2009 03:45 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
how do i get that?
Re: Compliation errors [message #413311 is a reply to message #413303] Wed, 15 July 2009 03:48 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Actualy, the 'OF' error is easy - you've got
Next of Kin Varchar2(50),
with spaces instead of underscores.

You still can't have interdependent types like this though.
Re: Compliation errors [message #413312 is a reply to message #413308] Wed, 15 July 2009 03:49 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
It's easy - you run SQL*Plus, execute the command, highlight the text, copy it and paste it back here:

SQL> Create type Patient_Type as object
  2  (PtNo number(6),
  3  Name Varchar2(50),
  4  Address Varchar2(50),
  5  Next of Kin Varchar2(50),
  6  DentistNo DentistType );
  7  /
Create type Patient_Type as object
*
ERROR at line 1:
ORA-06545: PL/SQL: compilation error - compilation aborted
ORA-06550: line 5, column 6:
PLS-00103: Encountered the symbol "OF" when expecting one of the following:
<an identifier> <a double-quoted delimited-identifier> LONG_
double ref char time timestamp interval date binary national
character nchar
ORA-06550: line 0, column 0:
PLS-00565: PATIENT_TYPE must be completed as a potential REF target (object type)
Re: Compliation errors [message #413313 is a reply to message #413311] Wed, 15 July 2009 03:50 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
Workspace

Enter SQL, PL/SQL and SQL*Plus statements.
Create type PatientType as object
(PtNo number(6),
Name Varchar2(50),
Address Varchar2(50),
Next of Kin Varchar2(50),
DentistNo DentistType );




Warning: Type created with compilation errors.
Re: Compliation errors [message #413314 is a reply to message #413313] Wed, 15 July 2009 03:53 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
That's why I said to do it in SQL*Plus.
However, if you'll read my earlier replies, you'll see what the error is.
Re: Compliation errors [message #413315 is a reply to message #413305] Wed, 15 July 2009 03:55 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
First
Next of Kin

should be
NextofKin

If you formatted your mail and posted as requested in OraFAQ Forum Guide (please read and follow it), we (and you) immediately saw it.

Regards
Michel
Re: Compliation errors [message #413316 is a reply to message #413315] Wed, 15 July 2009 03:57 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
The error still appears

Create type PatientType as object
(PtNo number(6),
Name Varchar2(50),
Address Varchar2(50),
NextofKin Varchar2(50),
DentistNo DentistType );
Re: Compliation errors [message #413317 is a reply to message #413316] Wed, 15 July 2009 03:59 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
No, a completely different error appears
SQL> Create type Patient_Type as object
  2  (PtNo number(6),
  3  Name Varchar2(50),
  4  Address Varchar2(50),
  5  Next_of_Kin Varchar2(50),
  6  DentistNo DentistType );
  7  /

Warning: Type created with compilation errors.

SQL> show errors
Errors for TYPE PATIENT_TYPE:

LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0      PL/SQL: Compilation unit analysis terminated
6/11     PLS-00905: object DEV.DENTISTTYPE is invalid


I'll say it again, because you've obviously got issues when it comes to reading replies: You cannot have two types each of which has the other as a column in it.
Re: Compliation errors [message #413323 is a reply to message #413317] Wed, 15 July 2009 04:17 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
Create type DentistType as object
(EmpNo Number(6),
DentistNo Number(6),
Name Varchar2(50),
appointmentNo Number(3),
PatientNo Number(6);

compliation error

also would this still be a abstract data type
Re: Compliation errors [message #413326 is a reply to message #413323] Wed, 15 July 2009 04:25 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
PLS-00103: Encountered the symbol ";" when expecting one of the f ollowing: := ) , not null default external character The symb ol ")" was substituted for ";" to continue.
Re: Compliation errors (merged) [message #413327 is a reply to message #413299] Wed, 15 July 2009 04:27 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
Create type DentistType as object
(EmpNo Number(6),
DentistNo Number(6),
Name Varchar2(50),
appointmentNo Number(3),
PatientNo Number(6);




PLS-00103: Encountered the symbol ";" when expecting one of the f ollowing: := ) , not null default external character The symb ol ")" was substituted for ";" to continue.
Re: Compliation errors [message #413328 is a reply to message #413326] Wed, 15 July 2009 04:29 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Can't you even spot that missing closing ")", even when Oracle tells you exactly in which row an column it is?
Re: Compliation errors (merged) [message #413330 is a reply to message #413299] Wed, 15 July 2009 04:33 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
sorry i resolved that before i was meant to ask how can i make the two tables a abstract data type
Re: Compliation errors (merged) [message #413336 is a reply to message #413327] Wed, 15 July 2009 04:46 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel
Please Help with Nested Table [message #413707 is a reply to message #413299] Fri, 17 July 2009 04:07 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
I am trying to create a Nested table i have created this code but keep getting the same errors

CREATE TYPE Job_Type AS OBJECT (
JobNo Numbe(6),
Job desc Varchar2(50),
end_date date,
Final Salary Number(6,2) );
/
CREATE TYPE Dentist_Tab IS TABLE OF Dentist_t;
/
CREATE TABLE NewOTDentist (
EmpNo Number(6),
DentistNo Number(6),
Name Varchar2(50)
NESTED TABLE JobType STORE AS Job_type;

CREATE TYPE Job_Type AS OBJECT (
*
ERROR at line 1:
ORA-00955: name is already used by an existing object
Warning: Type created with compilation errors.
NESTED TABLE JobType STORE AS Job_type
*
ERROR at line 5:
ORA-00907: missing right parenthesis
Re: Please Help with Nested Table [message #413710 is a reply to message #413707] Fri, 17 July 2009 04:28 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
[Note to moderators - please merge multiple topics, rather than deleting them - I'd replied to the one that got deleted]

1) Use Create or Replace instead of Create
2) Missing close bracket on Create Table
Re: Please Help with Nested Table [message #413711 is a reply to message #413710] Fri, 17 July 2009 04:52 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
[@JRowbottom: I apologize; it must have been me. I will take care in the future.]

Perhaps it would be good to post the entire SQL*Plus session, because posted "script" is full of syntax errors, such as "numbe" datatype, "job desc" column name, "dentist_t" doesn't exist, ....
Re: Please Help with Nested Table [message #413715 is a reply to message #413707] Fri, 17 July 2009 05:05 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
Create table NewOTDentist2
(EmpNo number(6),
DentistNo number(6),
Name Varchar2(50),
AppointmentNo number(3),
PatientNo number(6),
Job_type JobNestedtable)
nested table Job_Type store as JobNestedtable_tab;

Ive got this code to work for the nested table but im not sure what table to call to insert into NewOTDentist2 to display the information about Dentist and then about Job any suggestions?
Re: Please Help with Nested Table [message #413717 is a reply to message #413707] Fri, 17 July 2009 05:07 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
Select NewOTDentist2
From JobNestedtable_tab;

Insert Into Job_Type
(EmpNo, DentistNo, Name, AppointmentNo, PatientNo, JobType )
VALUES
('11', '11', 'John Murray', '1', '1', JobType('1', 'Toothfilling', '01,06,2009', '3,000') );

*****************************************************
From JobNestedtable_tab
*
ERROR at line 2:
ORA-22812: cannot reference nested table column's storage table
Insert Into Job_Type
*
ERROR at line 1:
ORA-04044: procedure, function, package, or type is not allowed here

**** Any idea what this means****
Re: Please Help with Nested Table [message #413720 is a reply to message #413707] Fri, 17 July 2009 05:51 Go to previous messageGo to next message
cookiemonster
Messages: 12422
Registered: September 2008
Location: Rainy Manchester
Senior Member
Insert Into Job_Type
(EmpNo, DentistNo, Name, AppointmentNo, PatientNo, JobType ) 


That should be NewOTDentist2.
Re: Please Help with Nested Table [message #413721 is a reply to message #413707] Fri, 17 July 2009 05:52 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Same topic as the previous one from you which ended with
Michel Cadot wrote on Wed, 15 July 2009 11:46
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel


I see you are unable or unwilling to follow the guidelines.
Re: Compliation errors and Please Help with Nested Table merged (many) [message #413760 is a reply to message #413299] Fri, 17 July 2009 10:15 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
Does Anyone know how to delete the entire iSql plus
All table and objects the entire lot please.
Re: Compliation errors and Please Help with Nested Table merged (many) [message #413763 is a reply to message #413760] Fri, 17 July 2009 10:22 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What does this have with the current question?

Regards
Michel
Re: Compliation errors and Please Help with Nested Table merged (many) [message #413765 is a reply to message #413763] Fri, 17 July 2009 10:24 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
What do you mean?
Re: Compliation errors and Please Help with Nested Table merged (many) [message #413770 is a reply to message #413765] Fri, 17 July 2009 10:38 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What is the relation between your question at the top of this topic and your last post?

Regards
Michel
Re: Compliation errors and Please Help with Nested Table merged (many) [message #413831 is a reply to message #413760] Fri, 17 July 2009 14:57 Go to previous message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
victor43 wrote on Fri, 17 July 2009 17:15
Does Anyone know how to delete the entire iSql plus
All table and objects the entire lot please.

If I understood what you mean, DROP USER might be the simplest way in your case. Or it may not ./fa/3314/0/
Previous Topic: group by date range
Next Topic: Database Trigger Error
Goto Forum:
  


Current Time: Sat Dec 10 16:22:41 CST 2016

Total time taken to generate the page: 0.10812 seconds