Step 1:- Create table
CREATE TABLE TEST
(
ID INTEGER,
NAME VARCHAR2(50)
);
Step
2:- Insert records into table
INSERT INTO TEST VALUES('1','Ram');
INSERT INTO TEST VALUES('2','Shyam');
INSERT INTO TEST VALUES('3','Ghanshyam');
Step
3:- Select records from table
SELECT * FROM "TEST" t
ID
|
NAME
|
1
|
Ram
|
2
|
Shyam
|
3
|
Ghanshyam
|
Step
4:- Iterate over the rows in a table
BEGIN
FOR i IN (select * from TEST) LOOP
DBMS_OUTPUT.PUT_LINE('ID- ' || i.ID
|| '
Name- ' ||
i.NAME);
END LOOP;
END;
No comments:
Post a Comment