Sei sulla pagina 1di 4

ORACLE PL/SQL Problems

Which af the follnuring blocks will compile, and which will fail to compilef Why?
A.
DrcTARE

tresHate HrE;
laeLDace t{iEtBffi; EreIH NUt L;
E!{D;

b.

mfine
laetdate, DHIE ,= slrsdate; laaLlhEe IIIJMBER. := 50;
EffiITN

dhne-.outgnrt . trut-_line (LasEdatel ; dlmcs_ou@ut .put_line (LasE0atel ;


EIID;

Iilfhy doesnlt the foltouring cCIde ctrmpile?


SEHIfi

IF

syguHxE > qjDngIE ('01-lre,N-1999t, *f,FlmIi[-Y,YI]ri']

TfiEr..}

ry.fiE qurrm" FU'LLIHE


EHDIE; E[S];

1999 ellleaqf ! * } ;

srhy doesn't the folltrqring code cCImpilef,


EEIH

Il

STSIIFTm

> IlqjmTE {,01-IeN-L999n, fuD{{ofrl-ffirt

TIIEN

DHIEI-OUIPUI.FULIJIIE ( t 1999 AIreEdy! * ) ; ELSEIS SISEEIIE < LUEUIE ('01-*fem-1988*, 'ffi-Xffiil-ffiil]


E,IIEII

E!tr}
EIID;

ilmq$IXTtff.ffi-f,,I$ffi I'IJtry,$ilry IF;

tk

prsf;. rlI

]Why doesn't the foltonring cade crmpile? EffiIU IF' STSIBIE > II)-UATE (' 01-.7nN-1999*, rm-lrcfg-Yytr'
TIIES
)

I@0UIFOT. PIII_I*IIIE

1!lgg elreadlr!

Effi
TfiEN

'l

DESf,S_OUIPUI.HTLLII{E
ET{D

IF;

(,Living in the Fasr. ,} ;

ElE;

Rewrite the following IF staternent to get rid of unnecessary nested IFs: IF sal^ar!, < 10000
TIE!{

hryltrs := 2000; ELffi

IF salary < 20000


ITIEt{

horm6 := 1500;
E,sE

IF salery' < TMI boulrs :=


EISE

40000

1000; 500;

bonue
END
EBID

:=

IF;

II';

EHD

IF;

Sfhich of [he fnllonring narned excepti{xrs are deftned by PI"TSQIJ fl. TATH,_I([I. rcE[D b. rlerrrc m
C. NC-IIHEA.-ETXIIID d. pnrrsE-B:r-EERo

e.w

f. so*r4{gsr-sg. IIIPTKEY_III_INIEI h. smryorml i" rniursjruq_r,am

What do 1rou see orl your screen (a message clelivered via DtsMS_OUTPLff, or an unhandled exception, or perhaps nothing *t all) when you execute this block?
Uffit;EE

rqldrea

\rARCmR2 {5}

EffiIII my''dre& :=,J(JST[CE.,. EE;

Vhat do you see on your screen (a message delivered via DBMS_OUTPUT, or an unhandled exception, or perhaps nothirrg ar all) when you
execute this blnckf
DtrIARE

my-drem

VARCITARZ

ffiIII{
BffiIIH
Iry_..fhreanr UfCnefLOnf

(5) ;

:=, rrfUSf[{E' ;

HEHS UAH'E-EHROR

lmBT

mAS-.lCfnWf.PUt_LINE
E![D;

('Imer block,,l

UB{S-OGI9IIf"PIII-LI]IE
END;

rDroan defemed. . ., ] ;

i[ mean to be fln *nplic# cilrsor in a FUSQL prograrn? $fhich of the foUouring SQt staternents are implicit cursors?
Wrhat does, A. BEHtrI
UFDA5B preteremcee

SHf
IWERE

iee-ryflanror = nare = r$TBlIEti[r;

lCEffif,ATEl

b. rcr*ns CUflffiar@ohe-etrr rs
SELEEE

job, fre$rncqf

mffiE ttilE = rELtr.


C.
EtsCT,EfiE

ElqI

adolesqrrtJimrkload

ne*t-ke1'

ffi
SE

qfloye.

e*p1o1ee_id$ffpE;

Ef

euplolee_seq.NEelTfAL

nEI) rext-tcey
FROM

&.ral;
MIfBER;

d. mr'> ALTEff. TAEI,E es-cf,rlHrsarj"on tmDItr cptions e. ru. in&c III 1 U


ITCIP

change the following block so rhar ir rraps a NO_DATAJOUND e.xcep tion and displays a description s:f the currerlt rror:
IIECLANE

urlf
EEEIN

tr-arnor

ice_creau. f av_f laror$IypE ;

SqEqlP
EIFO

fqrr-flavor qg-flavor

FRnil ice_cream

t&otilPur"Fm_EJt{E (rI lorle , llrw_tls'iror


ET{D;

flHBE rutnp = UffiR;

ll '!,);

FLJT,

Vhat do you see on your $creen {a message delivered via DBMS_O1I[of an unhandled exception, or perhaps nothing at all) when you
rEr-drean 1trRCffiR2(101

execute this blockl mctIsE

:=

riIIlSEfCE,,-

Emq{
UEEE,AHE

reality
Bmns

\rAECI{AR2

{3} :='![IIrLIOtitS

SEAR\IE'

uy-drem := fPEACEI; m tml }THEN laLt'E-Bffi,


IHBI
DHffi*flIEFOI.PUF-LIIIIE
EHD;

I,Itmer blodct) ;

wry
mp;

TErlirlE_ryfrory:

EEN mm-.:mftff.Pm-_LIIIE ('Otrter bloclc, );

True or felse? a. Index-by tahles are capab'le informatinn.

tf

ha+dling only a single dimension of

b, Different rows tn an indeuc-by table can hold diffierent tfpes of inforulation. Row l, ftrr erample, uright contain another index-by table, while,rCIsr 2 contains a string. c. Index-by tables can be sttrred in the, daabase as columns in a tabfe,

Potrebbero piacerti anche