Home » SQL & PL/SQL » SQL & PL/SQL » "Error" , "Block" merged silly topic titles
"Error" , "Block" merged silly topic titles [message #248600] Fri, 29 June 2007 13:07 Go to next message
qasim845
Messages: 95
Registered: March 2007
Location: Philadelphia
Member

Is anybody can help me out with this block. after executing this block i am getting this error.
ERROR at line 13:
ORA-06550: line 13, column 4:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
if

------------------------------------------------
declare
v_cnt number;
begin
select count(*) from stg_test_tab a where exists ( select * from stg_gsd_tab b where
a.user_id=b.user_id and a.osuser_id=b.osuser_id);

if v_cnt > 0
then
DBMS_OUTPUT.PUT_LINE('login successfully');
else
DBMS_OUTPUT.PUT_LINE('not login successfully');
endif;
end;
-------------------------------------------------------------
Re: Block [message #248601 is a reply to message #248600] Fri, 29 June 2007 13:12 Go to previous messageGo to next message
joy_division
Messages: 4641
Registered: February 2005
Location: East Coast USA
Senior Member
end if not endif
Re: Block [message #248605 is a reply to message #248601] Fri, 29 June 2007 13:16 Go to previous messageGo to next message
qasim845
Messages: 95
Registered: March 2007
Location: Philadelphia
Member

thanks joy
Error [message #248617 is a reply to message #248600] Fri, 29 June 2007 14:36 Go to previous messageGo to next message
qasim845
Messages: 95
Registered: March 2007
Location: Philadelphia
Member

Is there anybody help me out from this error please. It raise the error what i am looking for but also giving me an extra error.

declare
v_cnt number;
begin
select count(*) into v_cnt from stg_test_tab a where exists ( select * from stg_gsd_tab b where
a.user_id=b.user_id and a.osuser_id=b.osuser_id);
if v_cnt = 0
then
insert into stg_gsd_tab (osuser_id,user_id) values (12324,123123);
else
RAISE_APPLICATION_ERROR(-20000, 'A completed order cannot be inserted');
end if;
end;

-------------------------------
declare
*
ERROR at line 1:
ORA-20000: A completed order cannot be inserted
ORA-06512: at line 10
--------------------------------------------------------


thanks in advance

Re: Error [message #248620 is a reply to message #248617] Fri, 29 June 2007 14:53 Go to previous messageGo to next message
Michel Cadot
Messages: 64131
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
lease read and follow How to format your posts and How to get a quick answer to your question: TIPS AND TRICKS
Break your lines to max 80-100 characters when you format.
Please always post your Oracle version (4 decimals).

Then, this is the normal error stack that PL/SQL send.
There is nothing to do.
No, you cannot workaround this.
Yes, you have to handle yourself the message as you want.

Regards
Michel
Re: Error [message #248628 is a reply to message #248617] Fri, 29 June 2007 15:49 Go to previous messageGo to next message
qasim845
Messages: 95
Registered: March 2007
Location: Philadelphia
Member

is there anyway can i hide this error.

thanks in advance
Re: Error [message #248632 is a reply to message #248628] Fri, 29 June 2007 15:57 Go to previous messageGo to next message
Michel Cadot
Messages: 64131
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I already answered this question in my previous post.
Quote:
No, you cannot workaround this.


Regards
Michel

[Updated on: Fri, 29 June 2007 15:59]

Report message to a moderator

Re: Block [message #248795 is a reply to message #248605] Mon, 02 July 2007 00:56 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Missing into clause in the select
Previous Topic: Raising exceptions
Next Topic: nested cursor by table_name as parameter
Goto Forum:
  


Current Time: Wed Dec 07 12:34:33 CST 2016

Total time taken to generate the page: 0.10466 seconds