You are on page 1of 9

Nama' Shridoop Shrihi Chavan

Roll No A-50 No.

PRN 1920000 639 Date

TSE- -Prohlom Solving

Dis cuss_ Oracle SeCuona ith_examph


0 0raclo Sequncos aeanncdopendent objec
i0 hedaBabase Thayaa ro Cdida type.
Orace scquonce3 hau a name can be
_used anyhuo avalue expeced
G Oracle sequeneseneatea numeri valua2 - .

that can haassighed to any column in-


anytable
KTha tabla attibuk to hithyo assignad
aluabased ona sequence can be
edted aad mo.dikied.
An oracleSequonceCan be_crected _and
deloiedany time
Ths basi syntax to creaie _d SEqLLaNce
io Drcicle
CREATE SEaENCEname CsIARI NIIH n?
CINCAEMENT BY CCALHE/ NOLALHE)
whoa-
namesthaSequena name-
indegezvalue thatlan be pasihue/negahve
S1ARI WIIH spedfies tha inltialscquenca value.
Detaultvaluea i)-
INCRE MENI B1 dateamines e valus by ubich
tha sequenca ntremened (positie Jnegabue)
KIT College Of Engineering, Kolhapur.
(An Autonomous Institute)
No. 2
Date

IHE CAHEor NOCAHE ckiu se indicakes _uhethe2


Oracle wil preallacade Sequenca numbez3 in
memoy LOracle allocae 90 Valuasby default)
eg_CREATE SERUEICE_cus coDESEG START
20010 NoCACHE-
o check Sequeniesyau a n usR (AMmand
SELECT _ FRomUSER SEauENLES
spacial paeuda-calumns must be_used
ubile usingSequanO3
NEXTVAL retiveinext availablo Lalue rum
the sequgnco
LURRVAL rehis tha uzzant valle otE
the Sequen.

Eacbb äme you use NEXTVAL,tha se uana


Aintremen-ted
Onco as.equencovalho used (Hhugh NEXILAU,
ican'h wed again
gNou_cundop a Sequancofram a dutabose
using DRaP SEQUENLE Comman

KIT College Of Engineering, Kolhapur.


(An Autonomous Institute)
No.:
Date

Tlluahueiggezwith ib Syntox it iggon


on studnt tadauith ccthi budeg Lsid nane
dapt Dane tut, uedi resut); Aiten thoUPDATC
OD
Credits Lomplaes, tha gger isautamat
tired tho upDATE Stedemant liaside tha
iggen coada) skk the Iesult to F fr studhots
tha cuno holozs the 5Lredits.

0A mga s pacadual 301 cacla tha


i s Cutamahitally inakec hy tha eDANS
upan the occueence ot a gien docda
manipulaion eet
Sytax-
CREAIE OR BEPLACE TRI GAER mggez name
CRERRAEIEAJ CDELELE/ISEAL/ YeDATE OF column ncum
ON uble.name
CEOA EALH Rak)
CDECLARE_
CKaiablaname deda type C= iaihal valual
8ETN
PLUsoLnstuchon3
END

KIT College Of Engineering, Kolhapur.


(An Autonomous Institute)
No.
Date

6idxompla [austbon)
CRe DIE OR REPLALE 1RIGhCR_{0I_SIUDENIS
AfIEA UPDAIE Of credits ON Student
BPGTA
uPDATE pRoDULI
_SETesult_f

JHCAE CedisKS
PND

KIT College Of Engineering, Kolhapur.


(An Autonomous Institute)
No.:

Date

03wha a usar? Explain follaing-tezma


wLd (ursor
a Cursor Pracessing Camm.and
b. Cursar Atibudes

0 ifyou wanot to use Sa stakmant tho


ehurns mare hao one alue insida
aur PLIsacwde you nead o ase (ursur
4 urso a Specialconstauct used ina
prDcaduual Sa to haldthe data raus
rehungd bs _a_SQL_Quy-
A cursor Ceserued aga ot memay
inwhich tha output of the quy is
sored, like anarey bolding coalumnsancl
OLS

Tmplicit tuasrs_ae automatically creaed


Lshen SaL returns only one value
Explicit sur halds thaoutput of an saL
statement that ma4 ehunta/mae rais
ACursor prauessingCommanda
i Exeudes tho SaL Cornmand papukdes tha
Cursor wih data, opening tho tuisor fur pmasiog
KIT College Of Engineering, Kolhapur.
(An Autonomous Institute)
No. 5
Date

i Betune using usa2, yaunod fo open ii


CUSarname

ELCH
iAHeaOPEN EETCU A used o etove data-
han tha ursor copy itto tha PLUSaL_
VaLiabl turpruco ssin
Sutax fECH CurMr name TO vaziabla4-
LUatbla
hn Tho Ars ime Hou etch_a mw um tha
CUSOr, tha Ast of dadta fram he_uLsor
iS capied to tho PLLSaL vaiables and so on.
cLOSE
Close Hhe cuor tu pmossing-

B Cursoc Athibutes
Ras Cour
Rehuna tha no. oP ros fetched so faa 1f
the usor no openi rehuansad en
1f po fEIt4 has heaodone but unsaa
Openid _retung O.

KIT College Of Engineering, Kolhapur.


(An Autonomous Institute)
No.

Dale

foUND
RehutnsIRUE if the. lastETH chunad a-
OL fALSE if ol
1ehuenM emr if CuSor is noB OPLN.
Contains_NUL if m f¬TCH bas cdone

aNo£ouND-
- Rehuns TRUE iEthe last fCTCH_clido
rehun_any OL AFALSEiEit did
rehuzng_emr if cuRAdr isnot OPEN
Contais NuLl no_ F£TCHhas done

1SoPEN
IRUEit urSUr isOpen
FALSE Lsora clased

Explain-Syrtx otSaL fuactiond ite


Lie a
SaL fu0.chian fur produck cAuot whee
Quantity00 Hand 1P 0OH)aJess jhan
minimumn quanthy lP MTN).
Pradud table[ P_LaDE P DESCRIP, P_auH
PMEA, PRrCE)

KIT College Of Engineering, Kolhapur.


(An Autonomous Institute)
No.
Date:

shuedfunchion basIallyDame gnup _


pmudutal saLStzdemen-s hat rehung
value
6Syntax
REATEfUNCTIOn funchion nama aroument
1N data-iym -
RTUR dadaeAype
PLsaL- statements_

RETURN (value or expression)


fND
stoed functiang_can be iaskedoaly fzm
witbin stured p.acaclunesor igg.e22 &can:tL
bo inaked fum sal stedem.ants
6 examplaquestian)
CAEAIE fUNCILGN RoDUcr cauNI L cadE IN INTEaER-

P_PRICEin ikgu)-
KIT College Of Engineering, Kolhapur,
(An Autonomous Institute)
No.

Dato

RETURNinlegen13)
BCaTA
uatz Ran counifAi

RfruRN PRoD auNT),

KIT College Of Engineering, Kolhapur.


(An Autonomous Institute)

You might also like