IF Statement syntax [message #3994] |
Thu, 31 October 2002 15:00 |
trence
Messages: 4 Registered: October 2002
|
Junior Member |
|
|
Can someone verify my IF Statement syntax please. It looks ok to me, but it doesn't run as I expect it to. Specifically why it won't reset my pointer value = 1.
Thanks
CREATE OR REPLACE PROCEDURE TEST_STATEMENT
(v_IN in varchar2, v_OUT out varchar2)
IS
v_call_type varchar2(50);
v_dest_info varchar2(50);
BEGIN
IF V_CALL_TYPE = 'END'
THEN UPDATE ur_test_pointer
SET pointer = 1;
ELSE UPDATE ur_test_pointer
SET pointer = pointer + 1
where pointer = pointer
END IF;
|
|
|
Re: IF Statement syntax [message #3995 is a reply to message #3994] |
Thu, 31 October 2002 15:06 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
You are not initializing v_call_type to anything so it will always be null, so that first update will never fire. As far as the ELSE block, a WHERE clause of 'pointer = pointer' is superflous (every row would be updated with or without this condition).
|
|
|