PL/SQL output type question
Q. In the PL/SQL block below, how many rows will be inserted in the messages table?
v_start_sales NUMBER := 2;
v_end_sales NUMBER := 100;
FOR i IN v_start_sales..v_end_sales LOOP
INSERT INTO messages(msgid)
END;- Published on 08 Jul 15
The output will be 99 because the loop will start with 2 as v_start_sales NUMBER is declared as 2. The loop will go on until it reaches 100 as the v_end_sales NUMBER is declared as 100. So the loop will start with 2 and go on till 100. Its total comes to 99.