P. 1
Pls Ql Questions

Pls Ql Questions

|Views: 0|Likes:
Published by parvathi12

More info:

Published by: parvathi12 on Jul 09, 2014
Copyright:Traditional Copyright: All rights reserved

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

07/09/2014

pdf

text

original

EXCEPTION

Q-1) WHAT IS THE DIFF BET ERROR AND EXCEPTION
A-Run-time error stops norm! pro"essin# n$ returns "ontro! to t%e opertin# s&stem'
Run-time errors rise (rom $esi#n (u!ts) "o$in# mist*es) %r$+re (i!ures) n$ mn& ot%er sour"es'
run-time error su"% s st"* o,er(!o+ or $i,ision -& .ero
Wit% P/0SQ/) me"%nism "!!e$ e1"eption %n$!in# !ets &ou 2-u!!etproo(2 &our pro#rm so t%t it "n "ontinue
opertin# in t%e presen"e o( errors'
Wit% e1"eptions) &ou "n %n$!e errors "on,enient!&
n$ -e"use o( e1"eption %n$!in# no nee$ to +ri#%t RET3RN n$ EXIT STATE4TNTS'

Q-5)WHAT DO 3 4EAN B6 TRAPPIN7 AN EXCEPTIONS AND HOW ARE NON SPECIFIED EXCEPTIONS
ARE TRAPPED
A-W%en n error o""urs) n e1"eption is rise$' T%t is) norm! e1e"ution stops n$ "ontro! trns(ers to t%e e1"eption-
%n$!in# prt o( &our P/0SQ/ -!o"* or su-pro#rm' (ter n e1"eption is %n$!e$ it termintes t%e p!s8! "o$e n$
!e,es t%e -!o"*'
Intern! e1"eptions re rise$ imp!i"it!& 9utomti"!!&) -& t%e run-time s&stem'
3ser-$e(ine$ e1"eptions must -e rise$ e1p!i"it!& -& RAISE sttements) +%i"% "n !so rise pre$e(ine$ e1"eptions'
Q-:)WHAT DOES THE PROPA7ATIN7 4EAN;WHAT IS THE SEQ3ENCE FOR THE SA4E
+%en t%e -!o"* t%t rise$ t%e e1"eption %n$!es it) t%e -!o"* termintes s per t%e instru"tions in t%e %n$!er )t%en
t%e en$ sttement o( t%e -!o"* is en"ountere$ n$ "ontro! is #i,en -"* to t%e en"!osin# -!o"* (or e1e"ution'
W%en n e1"eption is rise$) i( P/0SQ/ "nnot (in$ %n$!er (or it in t%e "urrent
-!o"* or su-pro#rm) t%e e1"eption prop#tes' T%t is) t%e e1"eption repro$u"es
itse!( in su""essi,e en"!osin# -!o"*s unti! %n$!er is (oun$ or t%ere re no more
-!o"*s to ser"%'
Q-<)+%& $o +e use rise pp!i"tion errors
A-t%e pro"e$ure rise=pp!i"tion=error !ets &ou issue user-$e(ine$ error mess#es
rise=pp!i"tion=error9error=num-er) mess#e>) ?TR3E @ FA/SEAB)C
Q-D)+%t is t%e $i((eren"e in pre$e(ine$ n$ intern! e1"eptions;%o+ $o u %n$!e intern! e1"eptions9pre$e(ine$
e1"eption)
An intern! e1"eption is rise$ imp!i"it!& +%ene,er &our P/0SQ/ pro#rm ,io!tes n Or"!e ru!e or e1"ee$s s&stem-
$epen$ent !imit' Intern! e1"eption re8uires $e"!rein# t%e e1"eption )t%e& re rise$ utomti"!!&'
e# PRA74A EXCEPTION=INIT
(or pre$e(ine$ e1"eption no nee$ o( $e"!rtion -e"use t%ese re !re$& $e(ine$ +it%in t%e ser,er)inste$ o( u
in,o*in# n$ trppin# t%ese errors t%e& re $one utomti"!&'
e# NO=DATA=FO3ND

SE/ECT ST4T IN P/0SQ/
Q-1)WHAT DO 3 4EAN B6 E4BEDDED ST4T
A- E4BEDDED ST4T 4EANS Q3ERIES 43ST RET3RN ONE AND ON/6 ONE ROW THEREFOR IF Q3ER6
RET3RNS 4ORE THAN ONE ROW SEREER 7ENERATES AN ERROR
Q-5)WHAT IS THE DIFFERENCE BETWEEN NOR4A/ SE/ECT AND E4BEDED SE/ECT;
A- IN E4BEDED WE 3SE INTO C/A3SE'
Q-:) CAN 3 3SE THE SA4E NA4E FOR EARIAB/E AND CO/34N;
A- THIS CO3/D CREATE A4BI73IT6 IN THE WHERE C/A3SE'
Q-<) WHAT IS THE R3/E TOBE RE4E4BERED 3SIN7 INTO C/A3SE;
A-IT 43ST BE P/ACED BETWEEN SE/ECT AND FOR4 C/A3SE' IT IS 4ANDATOR6 C/A3SE'
C3RSOR
Q-1)WHAT IS DIFFERENCE BETWEEN I4P/ICIT AND EXP/ICIT C3RSOR;
A- I4P/ICIT C3RSOR FETCHES ON/6 ONE ROW AT A TI4E WHI/E EXP/ICIT C3RSOR CAN FETCH
43/TIP/E ROWS AT THE SA4E TI4E'
DIFFERENCE IS THAT A/THO37H I4P/ICIT C3RSOR CAN PERFOR4 A4N ARRA6 FETCH THE
EXISTANCE OF THE SECOND ROW RAISES THE EXCEPTION TOO=4AN6=ROWS'
EXP/ICIT C3RSORS CAN BE 3SED TO FETCH 43/TIP/E ROWS AND REEXEC3TE PARSED Q3ERIES IN
THE WORF AREA'
6O3 CAN NOT 3SE OPEN )FETCH AND C/OSE ST4TS WITH I4P/ICIT C3RSOR'
Q-5)AT WHICH STA7E OF C3RSOR F3NCTIONA/IT6 ISTHE ACTIEE RES3/TSET CREATED AND AT
WHAT STA7E IT CO4ES INTO EXISTANCE;
A- A C3RSOR CO4ES INTO EXISTANCE WHEN 3 OPEN IT AND NOT WHEN 3 DEC/ARE IT'
AFTER A C3RSOR IS OPENED )TH RET3NED SET IS THE RES3/T SET OR ACTIEE SET'
Q-:)THE ACTIEITIS THAT OCC3RE S AFTER OPENIN7 A C3RSORG-
1' 4E4OR6 IS A//OCATED
5'SQ/ ST4T PARSIN7
:'RET3RN ROWS 9ACTIEE SET) ARE IDENTIFIED'
<'RECORD IS POINTED TO THE FIRST ROW IN A RES3/TSET' IF NO RECORD PRESENT P/0SQ/ DOES NOT
RAISE AN EXCEPTION'
Q-<)WHAT HAPPENS WHEN THE C3RSOR IS C/OSED;
A-C/OSIN7 THE C3RSOR REA/EASES WORF AREA 3SED B6 THE C3RSOR AN THEREB6 FREES THE
S6STE4 RESO3RSES'
3 CAN REESTAB/ISH CONNECTION WITH THE ACTIEE SET ONCE THE C3RSOR IS C/OSED' B3T DO
NOT TR6 TO FETCH DATA FRO4 C/OSED C3RSOR THIS CA3SES INEA/I=C3RSOR EXCEPTION'
Q-D)WHAT HAPPENS IF 3 DO NOT C/OSE A C3RSOR;
A- IF 3 DO NOT C/OSE THE C3RSOR 4E4OR6 AREA IS NOT REA/EASED'
Q-H)WHAT IS THE EA/3E RET3RNED B6 THE ATTRIB3TE IROWCO3NT;
NO OF ROWS FETCHED

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->