Professional Documents
Culture Documents
Asstgnoent No S.: Itt. Oplisol Bodk - Bo Inolengnk Alk Bupesof Cusets
Asstgnoent No S.: Itt. Oplisol Bodk - Bo Inolengnk Alk Bupesof Cusets
Tte
itt. OPLisoL bodk.bo inolengnk alk bupesof cusets
Theoy
TntToduckte Eo_UTsOT
A.CMSOI 1S a tempany wOTh anta CTaked in the susten
menoy when SQl tatenent is Ex.ecuke A CGOY Captains intor
na~ioo on.a5elect.stalnent and he ToUs.o.t dalg alltsed
hu 1tAcosox Con bold onc or mave oulsbut:.can praCSS only
one Moa.E aHme. Ihe set ot rouS he cusors holds is.called
thegcHue Set. y SoL Cutso is ead.only.no.n s(alloble and
0sentive
Apes of CTSOTS
Ihest 0Kt to types 6fcitOKS in PLSQL
Inplicit (usoYS
Ihcse axc Crealrd by default ehen DnL Stalenents k c
LNSERT,UR09TE and DELETE Siakemers 0e ecbtdht4.aunt
alsa.created when aSELECT 5takement Bhatrektms just
Onexotw is execubtd
Eplidt CUSOiS
Ibeu.must be created uhen gou a texecuing a SELECT
Stakesnentthak Teums moe bhal oneTow Cuen Bhotugh Ehe
sa1 Stoxes nuktple Tcods, 0ny Ohe xecoid can bepiocessed
dta ktmeuhich is Caled as comenttow Even Ehotah EhC
Cment Tow position
moVes to the pextTo bath
enp lidt CuTSOTs haue Hhe same fondtionali Eyinpliut
Ehe wy Ehty ast accesed. but
Uhn uou eecube
00L stakesnen uuke DELEIE, TNss
UPDATE 1S|ECT Stalements Impliüt stairnents
ptecess Bhese Statements Onace psauides aat ckalta
LuSO to check Ehe 5takus of the DnL tuatnibubs i
aseY attai bulks ore 0Aabl
Operaionshu
pat decoc a
wln ysQL cUGO1, ua must
ohen UwOIKing when the cuTsOY
handles bo bandle the siuaton
AMT FOUND
tine ou call the
any Tow-becaLe_each
nd couldot tnd
aNond
nex Totu
stotementhe curser attenps to sad Bhe
FETCH dataand.a
inthe Toult Set.itwill pot be oble to get the condlHon.
handles S Used to randle this
Condttien G 1a15ed. The
No
Query
ll
insert into 0_Rol values (1, 'Pratik', 20) , (2, 'Suraj',21), (3, "Ambar',21)
mysql
attected (0.04 sec)
OK, 3 ows
ery
Duplicates: 0 Warnings: 0
Records: 3
vsql>
select
*
from 0 Roll;
T
1 Pratik| 20
2 Suraj 21
3I Ambar 21
in s e t (0.00 sec)
3 rows
mvsql> insert
into N_Roll values (4, 'Abhi',20) , (5, ,
mysql>
select
*
from N Roll;
--+
Abhi 20
5 Yogesh 21
6 Jeet 19
-= T
in s e t (0.00 sec)
3 rows
mysql> delimiter //
CursorProc3 0
create procedure
mysql>
begin 0;
declare rol int default
nme
varchar (20) ;
declare
default 0;
declare ag i n t
declare roll int default 0
(20) ;
varchar
d e c l a r e nmel
d e f a u l t 0;
d e c l a r e agl i n t
False;
d e c l a r e done
int d e f a u l t
0; from 0_Roll;
int default RollNo, Name, Age
declare Not_dup select
distinct
from N_Roll;
tcursor
cursor for
distinct RollNo, Name, Age
declare
cursor for s e l e c t done=True;
declare
scursor
FOUND SET
HANDLER FOR NOT
CONTINUE
DECLARE
open scursor ;
end/
Query OK, 0 rOws affected (0.00 sec)
+ ----4--------4
IRollNo | Name IAge
+- +--------+-----+
I Pratik | 20 1
21 Suraj 21
Ambar 21
Abhi 201
51 Yogesh 1 21 1
61 Jeet 19
--