StevenFeuersteinwithBillPribylSIXTHEDITIONOraclePL/SQLProgrammingOraclePL/SQLProgramming,SixthEditionbyStevenFeuersteinwithBillPribylCopyright©2014StevenFeuerstein,BillPribyl.Allrightsreserved.PrintedintheUnitedStatesofAmerica.PublishedbyO’ReillyMedia,Inc.,1005GravensteinHighwayNorth,Sebastopol,CA95472.O’Reillybooksmaybepurchasedforeducational,business,orsalespromotionaluse.Onlineeditionsarealsoavailableformosttitles(http://my.safaribooksonline.com).Formoreinformation,contactourcorporate/institutionalsalesdepartment:800-998-9938orcorporate@oreilly.com.Editor:AnnSpencerProductionEditor:NicoleShelbyCopyeditor:RachelMonaghanProofreader:RachelHeadIndexer:EllenTroutmanCoverDesigner:RandyComerInteriorDesigner:DavidFutatoIllustrator:RebeccaDemarestSeptember1995:FirstEditionSeptember1997:SecondEditionSeptember2002:ThirdEditionAugust2005:FourthEditionSeptember2009:FifthEditionJanuary2014:SixthEditionRevisionHistoryfortheSixthEdition:2014-01-22:FirstreleaseSeehttp://oreilly.com/catalog/errata.csp?isbn=9781449324452forreleasedetails.NutshellHandbook,theNutshellHandbooklogo,andtheO’ReillylogoareregisteredtrademarksofO’ReillyMedia,Inc.OraclePL/SQLPrograming,theimageofants,andrelatedtradedressaretrademarksofO’ReillyMedia,Inc.Manyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarks.Wherethosedesignationsappearinthisbook,andO’ReillyMedia,Inc.,wasawareofatrade‐markclaim,thedesignationshavebeenprintedincapsorinitialcaps.Whileeveryprecautionhasbeentakeninthepreparationofthisbook,thepublisherandauthorsassumenoresponsibilityforerrorsoromissions,orfordamagesresultingfromtheuseoftheinformationcontainedherein.ISBN:978-1-449-32445-2[QG]Tomywife,VevaSilva,whoseintelligence,strength,beauty,andarthavegreatlyenrichedmylife.—StevenFeuersteinTomywife,Norma.Stillmeltingmyheartafteraquartercentury.—BillPribylTableofContentsPreface......................................................................xxvPartI.ProgramminginPL/SQL1.IntroductiontoPL...