Shreya
Shreya
SQL> conn
Enter user-name: system
Enter password:
Connected.
SQL> create table stud(stud_id number, stud_name varchar2(10), stud_department
varchar2(10));
create table stud(stud_id number, stud_name varchar2(10), stud_department
varchar2(10))
*
ERROR at line 1:
ORA-00955: name is already used by an existing object
Table created.
1 row created.
1 row created.
1 row created.
1 row created.
SQL> declare
2 CURSOR c2 IS select*from studentt
3 where stud_department='CO';
4 srec studentt%rowtype;
5 begin
6 open c2;
7 loop
8 fetch c2 into srec;
9 dbms_output.put_line(srec.stud_id ||''|| srec.stud_name ||''||
srec.stud_department);
10 exit when c2%notfound;
11 end loop;
12 close c2;
13 end;
14 /
SQL>