You can use a PL/SQL block to display numbers from 1 to n in Oracle. Here's an example program:
<code class="language-sql">DECLAREn NUMBER := 10; -- Change this value to your desired n BEGIN FOR i IN 1..n LOOP DBMS_OUTPUT.PUT_LINE(i); END LOOP; END; /
</code>
This code declares a variable n, then uses a FOR loop to iterate from 1 to n, printing each number using DBMS_OUTPUT.PUT_LINE. Make sure to enable output in your SQL environment to see the results.
Copyright © 2026 eLLeNow.com All Rights Reserved.