Question: Modify your solution to question 4 above, replacing the IF statement with an EXIT....WHEN statement. Create a MESSAGES table and insert several rows into it.

Modify your solution to question 4 above, replacing the IF statement with an EXIT....WHEN statement.

Create a MESSAGES table and insert several rows into it.

To create the messages table.

DROP TABLE messages;

CREATE TABLE messages (results NUMBER(2));

Write a PL/SQL block to insert numbers into the MESSAGES table. Insert the numbers 1 through 10, excluding 6 and 8.

DECLARE

V_numbero number(2):=1;

Begin

Loop

If v_numbre number<>6 and v_numbre<>8 then

Insert into messages(results) values(v_numbre);

End if;

V_numbre:=v__numbre+1;

Exit when v_numbre>10;

End loop;

End;

Execute a SELECT statement to verify that your PL/SQL block worked

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!