Annemarie -
First, you can't use double-quotes when referencing string values.
Secondly, all executable statements must be terminated with a
semi-colon.
Finally, the update statement syntax is
Update table
Set ...
Where ...
That's about all I can see from a quick glance...
Hope this helps
Sandy
-----Original Message-----
From: McGowan Annamarie
[mailto:oracledba-ezmlmshield-x94207805.[Email address protected]
Sent: Thursday, October 27, 2005 2: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
NOTICE:
The information contained in this electronic mail transmission is intended by Monster Worldwide, Inc. or one of its subsidiaries or affiliated companies for the use of the named individual or entity to which it is addressed and may contain information that is privileged or otherwise confidential. It is not intended for transmission to, or receipt by, any individual or entity other than the named addressee (or a person authorized to deliver it to the named addressee) except as otherwise expressly permitted in this electronic mail transmission. If you have received this electronic transmission in error, please delete it without copying or forwarding it, and notify the sender of the error by reply email. (FE01)
Oracle LazyDBA home page