Quote Originally Posted by stecal
declare
cursor inventory_cur is
select * from movie_table
for update;
begin
for stk_rec in inventory_cur loop
if stk_rec.stk_flag > 75 then
update movie_table
set stk_flag = whatever
where current of inventory_cur;
-- you can add in the else branch
end loop;
end;
/
Thanks alot but its still not compiling it correctly.

This is what i typed


DECLARE
CURSOR STK_CURSOR IS
SELECT * FROM MM_MOVIE
FOR UPDATE NOWAIT;
BEGIN
FOR STK_REC IN STK_CURSOR LOOP
IF STK_REC.STK_FLAG > 75 THEN
UPDATE MM_MOVIE
SET STK_FLAG = '*'
WHERE CURRENT OF STK_CURSOR;
ELSE SET STK_FLAG = 'NULL'
WHERE CURRENT OF STK_CURSOR;
END IF;
END LOOP;
END;
/

And these are the errors its telling me.



FOR UPDATE NOWAIT;
*

ERROR at line 4:
ORA-06550: line 11, column 10:
PL/SQL: ORA-00922: missing or invalid option
ORA-06550: line 11, column 6:
PL/SQL: SQL Statement ignored