Home » SQL & PL/SQL » SQL & PL/SQL » PLS-00103: Encountered the symbol "ORDER" when expecting one ofthe following: ;
PLS-00103: Encountered the symbol "ORDER" when expecting one ofthe following: ; [message #191434] Wed, 06 September 2006 06:28 Go to next message
quest_nisha
Messages: 4
Registered: August 2006
Location: Bangalore
Junior Member
Hi,
I am working on 8.1.7.0.0...
I m trying to execute this procedure,
SQL> create or replace procedure yas as
2 begin
3 INSERT INTO TEMP_SEL_BTS (CELL_SEQ_NO, CELL_ID, BSC_NE_NE_ID)
4 SELECT cell_id
5 ,cell_seq_no
6 ,s.bsc_ne_ne_id
7 FROM BTS_KIT_TYPES k
8 ,CELL_SITES s
9 ,BASE_TRANSCEIVER_STATIONS b
10 ,CELLS c
11 WHERE c.alt_pla_pla_id = 0
12 AND c.alt_alt_plan_seq_num = 236356
13 AND C.CELL_NETWORK_TYPE <> 'UMTS'
14 AND b.alt_pla_pla_id = c.alt_pla_pla_id
15 AND b.alt_alt_plan_seq_num = c.alt_alt_plan_seq_num
16 AND b.csi_sit_csr = c.bts_csi_sit_csr
17 AND b.bts_seq_no = c.bts_bts_seq_no
18 AND s.alt_pla_pla_id = b.alt_pla_pla_id
19 AND s.alt_alt_plan_seq_num = b.alt_alt_plan_seq_num
20 AND s.sit_csr = b.csi_sit_csr
21 AND k.btsk_kit_name = b.btsk_kit_name
22 AND k.man_man_name = 'NOKIA'
23 AND EXISTS (SELECT 'X'
24 FROM CELLS cl
25 WHERE cl.alt_pla_pla_id = 0
26 AND cl.alt_alt_plan_seq_num = 0
27 AND cl.cell_seq_no = c.cell_seq_no)
28 ORDER BY c.bts_csi_sit_csr,c.cell_id;
29 end;
30 /

Warning: Procedure created with compilation errors.

Elapsed: 00:00:00.00
SQL> show errors
Errors for PROCEDURE YAS:

LINE/COL ERROR
-------- -----------------------------------------------------------------
28/8 PLS-00103: Encountered the symbol "ORDER" when expecting one of
the following:
; return returning and or group having intersect minus start
union where connect


its giving the error stated above...
when i run the query seperately it works fine.. but in a procedure it throws this error...
can u help plz......
Re: PLS-00103: Encountered the symbol "ORDER" when expecting one ofthe following: ; [message #191468 is a reply to message #191434] Wed, 06 September 2006 08:09 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
I seem to recall this in 8i. However, an ORDER BY clause really has no meaning in an INSERT statement anyway.
Re: PLS-00103: Encountered the symbol "ORDER" when expecting one ofthe following: ; [message #191485 is a reply to message #191468] Wed, 06 September 2006 09:35 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
That was my first reaction too, but on second thought it is not entirely true: it could be that you want to generate a sequence-number based on a certain ordering..
Re: PLS-00103: Encountered the symbol "ORDER" when expecting one ofthe following: ; [message #191495 is a reply to message #191485] Wed, 06 September 2006 12:04 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Good point Frank.
Re: PLS-00103: Encountered the symbol "ORDER" when expecting one ofthe following: ; [message #191527 is a reply to message #191495] Wed, 06 September 2006 22:43 Go to previous messageGo to next message
quest_nisha
Messages: 4
Registered: August 2006
Location: Bangalore
Junior Member
Ya i have to put the data in order... Any one knows why its happenning
Re: PLS-00103: Encountered the symbol "ORDER" when expecting one ofthe following: ; [message #191531 is a reply to message #191527] Thu, 07 September 2006 00:10 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

You can do ur things in this manner.

create or replace procedure yas as
2 begin
3 INSERT INTO TEMP_SEL_BTS (CELL_SEQ_NO, CELL_ID, BSC_NE_NE_ID)
4 SELECT cell_id, cell_seq_no,bsc_ne_ne_id from (SELECT cell_id
5 ,cell_seq_no
6 ,s.bsc_ne_ne_id
7 FROM BTS_KIT_TYPES k
8 ,CELL_SITES s
9 ,BASE_TRANSCEIVER_STATIONS b
10 ,CELLS c
11 WHERE c.alt_pla_pla_id = 0
12 AND c.alt_alt_plan_seq_num = 236356
13 AND C.CELL_NETWORK_TYPE <> 'UMTS'
14 AND b.alt_pla_pla_id = c.alt_pla_pla_id
15 AND b.alt_alt_plan_seq_num = c.alt_alt_plan_seq_num
16 AND b.csi_sit_csr = c.bts_csi_sit_csr
17 AND b.bts_seq_no = c.bts_bts_seq_no
18 AND s.alt_pla_pla_id = b.alt_pla_pla_id
19 AND s.alt_alt_plan_seq_num = b.alt_alt_plan_seq_num
20 AND s.sit_csr = b.csi_sit_csr
21 AND k.btsk_kit_name = b.btsk_kit_name
22 AND k.man_man_name = 'NOKIA'
23 AND EXISTS (SELECT 'X'
24 FROM CELLS cl
25 WHERE cl.alt_pla_pla_id = 0
26 AND cl.alt_alt_plan_seq_num = 0
27 AND cl.cell_seq_no = c.cell_seq_no)
28 ORDER BY c.bts_csi_sit_csr,c.cell_id);
29 end;
30 /
Re: PLS-00103: Encountered the symbol "ORDER" when expecting one ofthe following: ; [message #191550 is a reply to message #191531] Thu, 07 September 2006 01:57 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Besides the problem with the order by, you ARE aware of the fact that you switched the first two columns, aren't you?
Re: PLS-00103: Encountered the symbol "ORDER" when expecting one ofthe following: ; [message #191650 is a reply to message #191527] Thu, 07 September 2006 08:11 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
quest_nisha wrote on Wed, 06 September 2006 23:43

Ya i have to put the data in order... Any one knows why its happenning


I don't think you understand the concept of putting data in order in a table. There is no such thing as order in a relational database. Granted, as Frank said if you were inserting into a table and generating a sequence with that insert, then you would need to "select" the data in some defined order, but since you are doing a straight insert as select, it has no meaning.
Re: PLS-00103: Encountered the symbol "ORDER" when expecting one ofthe following: ; [message #191798 is a reply to message #191650] Fri, 08 September 2006 03:30 Go to previous messageGo to next message
quest_nisha
Messages: 4
Registered: August 2006
Location: Bangalore
Junior Member
I very well understand the concept sir.. but my application needed such a procedure.. anyways thank u
Re: PLS-00103: Encountered the symbol "ORDER" when expecting one ofthe following: ; [message #191884 is a reply to message #191798] Fri, 08 September 2006 08:12 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
I'm sorry, I'm still not buying it. With the statement you show, ORDER BY has no meaning. Please explain why you think it does.
Previous Topic: select and insert blob column using dblink
Next Topic: Procedure
Goto Forum:
  


Current Time: Sun May 18 00:26:48 CDT 2025