Program to Generate Natural Numbers

GENERATE NATURAL NUMBERS ‘n’ USING DO WHILE

SQL> ED natural ‘N’ number sql

DECLARE

                N number := & n

                i number := 1;

      BEGIN

   While [i<=n]

   Loop

   DBMS_output.put_line (i);

 I := i+1

End loop;

End;



OUTPUT:

N=15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Related

Data Model & Classification of Data Models

DEFINITION: A data model is an abstraction of reality. The reality may be a business system or an engineering system. DATA MODEL: Data model is an abstraction of data about entities of a sy...

SQL Commands : DDL , DML & TCL Commands

SQL COMMANDS DDL Commands. DDL stands  for DATA DEFINITION LANGUAGE. The DDL commands are used to create the objects /tables of the database. We can also modify the table columns of the ...

Functions, Queries & Sub Queries

Oracle provides certain built-in function such as, 1)       Aggregate functions 2)   &n...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item