Home » SQL & PL/SQL » SQL & PL/SQL » if then elseif block failing
if then elseif block failing [message #35765] Fri, 12 October 2001 15:46 Go to next message
Rahul
Messages: 94
Registered: December 1998
Member
I have a stored procedure in which i am trying to do something like this:

if row_count > 1 then
error:= 1;
elseif (row_count = 0) then
insert into main values (testcase_name,
testrun_date,
id_client_os,
id_server_os,
id_product_names,
id_product_version,
id_product_build,
id_major_group,
id_minor_group,
id_result,
id_Priority,
id_test_types,
id_test_configurations,
id_qa_eng,
id_browsers,
to_number(bugid),
id_client_mc_name,
id_server_mc_name,
"");
else
update main set result = id_result, testcase_run_date = testrun_date
where testcase_name = tescase_name
and client_os = id_client_os
and server_os = id_server_os
and product_name = id_product_name
and product_version = id_product_version
and product_build = id_product_build
and major_group = id_major_group
and minor_group = id_minor_group
and priority = id_Priority
and test_type = id_test_type
and test_configuration = id_test_configuration
and qa_eng = id_qa_eng
and browser = id_browser
and client_mc_name = id_client_mc_name
and browser = id_browser
and client_mc_name = id_client_mc_name
and server_nc_name = id_server_mc_name;
end if;

but whenever i try to compile the sp sqlplus gives me the follwoing error:

LINE/COL ERROR
-------- -----------------------------------------------------------------
78/28 PLS-00103: Encountered the symbol "THEN" when expecting one of
the following:
:= . ( % ;

118/5 PLS-00103: Encountered the symbol "INSERT_RESULT" when expecting
one of the following:

line no 78 is : elseif (row_count = 0) then line
I am unable to find anything wrong with my if then else statement use.
thanx
rahul

----------------------------------------------------------------------
Re: if then elseif block failing [message #35767 is a reply to message #35765] Fri, 12 October 2001 16:14 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
The "elseif" should be "elsif".

----------------------------------------------------------------------
Previous Topic: Re: SOS!!!help, How I can query string in a LONG datatype?
Next Topic: F1!!! F1!!! F1!!!!!
Goto Forum:
  


Current Time: Sat May 25 02:38:44 CDT 2024