Write a PL/SQL block to print all odd numbers between 1 and 10 using a basic loop.

What will be an ideal response?


```
SQL> DECLARE
2 v_count NUMBER(2) := 1;
3 BEGIN
4 LOOP
5 DBMS_OUTPUT.PUT_LINE(v_count);
6 v_count := v_count + 2;
7 EXIT WHEN v_count > 10;
8 END LOOP;
9 END;
10 /
1
3
5
7
9

PL/SQL procedure successfully completed.
```

Computer Science & Information Technology

You might also like to view...

Suppose you want to program behavior that repeats as long as some condition does not occur. To do this, you could use a statement with the following format: ____.

A. doWHILE (true) B. while (!true) C. if (NOT condition) D. while (&& false)

Computer Science & Information Technology

A selected control will display how many sizing handles?

A. 1 B. 2 C. 4 D. 7

Computer Science & Information Technology

The touch screen on a mobile device is not responding to input.   Which of the following is the best step to take to resolve this issue?

A. Remove and replace the screen. B. Use the Settings app to recalibrate the touch screen. C. Perform a factory reset on the device. D. Close all unresponsive apps.

Computer Science & Information Technology

Which of the following are instructional codes that guide the execution of the system when information is passing through it?

A. access control lists B. user profiles C. configuration rules D. capability tables

Computer Science & Information Technology