I have created a for loop that loops until it hits 10 and outputs INSERT everytime it hits 6 or 8 Now I want to insert a null value in the results column every time it hits a 6 or 8. How might I do this?
declare var1 number := 0;
begin
loop exit when var1 > 10;
if var1 IN (6,8) THEN dbms_output.put_line(' INSERT'); ELSE
dbms_output.put_line(var1);
end if;
var1 := var1 + 1;
end loop;
dbms_output.put_line('Done');
end;
/
Table
SQL> describe messages
Name Null? Type
----------------------------------------- -------- ----------------------------
RESULTS VARCHAR2(60)
1 Answer