Home » SQL & PL/SQL » SQL & PL/SQL » PLS-00103 error (ms)
PLS-00103 error [message #394413] Thu, 26 March 2009 22:12 Go to next message
bananaman
Messages: 71
Registered: March 2009
Member
hi i'm trying to run the program written in my reference with the code below but i got an error that says: PLS-00103: Encountered the symbol "CREATE".

---==start of code==----
1 CREATE TYPE list_of_courses AS TABLE OF VARCHAR2(64);
2 CREATE TABLE department (
3 2 name VARCHAR2(20),
4 3 director VARCHAR2(20),
5 4 office VARCHAR2(20),
6 5 courses list_of_courses)
7* 6 NESTED TABLE courses STORE AS courses_tab;
SQL> /
---==end of code==----

Warning: Type created with compilation errors.

SQL> show errors
Errors for TYPE LIST_OF_COURSES:

LINE/COL ERROR
-------- ------------------------------------------
2/1 PLS-00103: Encountered the symbol "CREATE"


What wrong with this?
Re: PLS-00103 error [message #394414 is a reply to message #394413] Thu, 26 March 2009 22:16 Go to previous messageGo to next message
BlackSwan
Messages: 25042
Registered: January 2009
Location: SoCal
Senior Member
>What wrong with this?
2/1 PLS-00103: Encountered the symbol "CREATE"

Did you read & follow the bouncing RED ball advice as stated in URL below?
http://www.orafaq.com/forum/f/1/136107/
Did you read & follow Posting Guidelines as contained in URL below?
http://www.orafaq.com/forum/t/88153/0/

I suggest you construct the code one valid SQL statement at a time.

Re: PLS-00103 error [message #394429 is a reply to message #394413] Fri, 27 March 2009 01:16 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8635
Registered: November 2002
Location: California, USA
Senior Member
When you create a type, it requires a semicolon and a slash at the end, before any other code. When you create a table, you just need either a semicolon or a slash at the end.

CREATE TYPE ...;
/

CREATE TABLE ...
/
Re: PLS-00103 error [message #394430 is a reply to message #394413] Fri, 27 March 2009 01:18 Go to previous messageGo to next message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
First of all you don't copy and paste blindly.
Check that your code contains line numbers in front of each line.
Remove those numbers and create objects separetely as

SQL>CREATE TYPE list_of_courses AS TABLE OF VARCHAR2(64);
  2  /

Type created.

Elapsed: 00:00:00.06
SQL>CREATE TABLE department (
  2  name VARCHAR2(20),
  3  director VARCHAR2(20),
  4  office VARCHAR2(20),
  5  courses list_of_courses)
  6  NESTED TABLE courses STORE AS courses_tab;

Table created.


regards,
Delna
Re: PLS-00103 error [message #394431 is a reply to message #394429] Fri, 27 March 2009 01:21 Go to previous messageGo to next message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
Oooooooooooops Barbara mam,

I got second just because of 2 seconds.....

regards,
Delna
Re: PLS-00103 error [message #394719 is a reply to message #394413] Sun, 29 March 2009 21:58 Go to previous message
bananaman
Messages: 71
Registered: March 2009
Member
thanks.. Smile
Previous Topic: Find rows of data with some matching fields
Next Topic: Date Format change
Goto Forum:
  


Current Time: Wed Dec 07 05:09:09 CST 2016

Total time taken to generate the page: 0.18407 seconds