Annamarie-
Looks like the condition is missing from one of you Elsif's (third one).
Otherwise it looks ok.
-----Original Message-----
From: McGowan Annamarie
[mailto:oracledba-ezmlmshield-x94207805.[Email address protected]
Sent: Thursday, October 27, 2005 12:41 PM
To: LazyDBA Discussion
Subject: Procedure Help
I am very new to Oracle Proc's and having a problem with the "then"
statements when compiling.....can anyone help
CREATE OR REPLACE PROCEDURE proc_reserve_slot (i_hostname IN NVARCHAR,
i_slot_id IN ref_tms_slots.U_SLOT_ID%TYPE, i_slot_to_update IN
NUMBER,i_action IN VARCHAR, o_returncode OUT NUMBER:=0)
AS
BEGIN
If v_action = "reserve"
THEN
ELSIF (i_slot_to_update = 1)
THEN
update sip_patching where servername = i_hostname set
u_slot_id_1 = i_slot_id
ELSIF (i_slot_to_update = 2)
THEN
update server table where servername = i_hostname set
u_slot_id_2 = i_slot_id
ELSIF
THEN
update ref_tms_slots where i_slot_id = v_slot_id set
i_servers_assigned = (i_servers_assigned + 1)
ELSIF i_action = "release"
THEN
ELSIF i_slot_to_update = 1
THEN
update server table where servername = i_hostname and
u_slot_id_1 = i_slot_id set u_slot_id_1 = null
ELSIF v_slot_to_update = 2
THEN
update server table where servername = i_hostname and
u_slot_id_2 = i_slot_id set u_slot_id_2 = null
ELSE
update ref_tms_slots where u_slot_id = i_slot_id set
i_servers_assigned = (i_servers_assigned - 1)
END IF;
END;
/
Annamarie McGowan
FISC DC-MMK
603-791-7579
annamarie.[Email address protected]
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com To unsubscribe:
see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com By using this list you agree
to these terms:http://www.lazydba.com/legal.html
--
This message has been scanned for viruses and dangerous content by
MailScanner, and is believed to be clean.
Douglas County, Oregon
www.co.douglas.or.us
Oracle LazyDBA home page