--Write a PL_SQL block to insert numbers into student table
Using For Loop
First You need to create table student.
sql> create table student(results number);
Example :-
Insert the numbers 1..10 excludining 5
BEGIN
FOR i in 1..10 LOOP
IF i = 5 THEN
null;
ELSE
INSERT INTO student(results)
VALUES (i);
END IF;
END LOOP;
COMMIT;
END;
To see the output Execute a PLSQL statement
to check that your PLSQL BLock Worked.
Select * from temp;
Using For Loop
First You need to create table student.
sql> create table student(results number);
Example :-
Insert the numbers 1..10 excludining 5
BEGIN
FOR i in 1..10 LOOP
IF i = 5 THEN
null;
ELSE
INSERT INTO student(results)
VALUES (i);
END IF;
END LOOP;
COMMIT;
END;
To see the output Execute a PLSQL statement
to check that your PLSQL BLock Worked.
Select * from temp;
0 comments:
Post a Comment