Theimportantthingtounderstandhereisthatretailpriceattheend, whenyou'relookingatthatview, thatisimpermanentdatathatisnotactuallyatthistimebeingstored, and a lotofpeoplecouldgetconfusedaboutthis.
I shouldprobablystopnowbeforeyougetevenmoreconfusedsothatlet's gooverthecomputerand I canshowyouhowthestoryfunctionswork.
Okay, soherewearemycomputerAgain.
Again.
I have a MacbookPro.
I amrunningvirtualboxwithinaninstance, onvirtualbox, I'm running a buttontodesktop 18.4 Lt s Andthen I usedsomethingcalledTaskCelltoinstalltheentirelampstackontothisLennoxdesktop.
Youknow, a lotofpeoplegooutthereandthey'llcreate a functiontoanemptytableorthey'llcreate a functionandthey'llscreweverythingupbecausetheydon't knowwhatdatatypesorwhatevertheirtableallowsfor.
Soagain, whenyourtimeoutanintegeranintegeris a datatypethatis a wholenumber 1 10 220 thatisaninteger A floatisbasicallywith a decimal 2200.11 11.52 pointfive, 6.252 pointoneThatis a float.
We'rethengoingtosaywhatvariablesandwhatdatatypesofvariableswe'regoingbegivingthisparticularfunction s o thefirstthingwe'regonnadothispartunderscoreprice.
InnerHey, don't youunderstandif I hadnotmodifiedtheDLemitterwhen I didthatsemicolonthat I hitenterliterallymysequeltrytoprocessthathalf, andthenitjustgetsuglyonTheworstpartisitdoesn't alwaysnecessarilycompletelyfailout.
Sometimesitdoespartofit, whichisevenworse.
So, yeah, justjustduetodeliver, uh, okay, nowwe'regonnadoiswe'regonnasetthevalueofthevariableretailprice.
Butwhatif I wanttomakeiteveneveneasierstillandsimplybeabletocall a storedprocedureandyouhavethesequelstatementruntogivemetheresultssothat I don't evenhavetotypeinallofthiscrapallthetime?
Sotodothatagain, wecoulddo a storeprocedurelikewedidbefore.
It's already a limiter.
Dollarsign, Dollarsign.
Howdoyoucontrol L?
A Clearthescreen.
Andsonowwecando a create, so d'oh, createpros.
See, Jer?
Right.
Umandthenwhat?
We'regoingtocreatetheprocedurewe'regoingtocall a price.
That's a list, Uh, openparentheses, closedparentheses.
Andthenyoucancreate a storedprocedurebasedoffofthatstoredfunction, andthenyoucangofromthere.
So, like, withthis 1.25 I couldmodifythisinthefutureso I coulddeletetheprocedurepricelistandthenrecreateitandhavethisvaluebe 1.10 or I couldhavetheonenot 50 orhaving 1.55.
Sowe'regoingtodoaretheshow, uh, function, uh, thatISSlooks a lotlikethestoreprocedurewhere d B equalssinglequotationmarkclass, thebeclosesinglequotationmarkAndthenwe'regoingtoseeMichaelagain.
ItisshockinghowbadSomany I T professionalsareat a verybasicmath, verybasicmathoroh, theycoulddoafterdirectorysotheycoulddoactivedirectory, thatcanoebackupskives.
Theycouldbeamazingwithtechnologyandjustbe a horriblewithmathoftheexactsametimeis a problemthatyou'regoingtorunintowiththestorefunctionsisagain.
Youcanhave a functionthatprocessesperfectlyandgivesyou a garbageansweronthat, somethingthatyoureallydohavetobecarefulaboutagain, especiallyasyoustartbuildingoutyourdatabasesystem.
Becausewhat's gonnahappenisinthebeginningyouhave a coupleoftables.
Andmaybeinthebeginning, ifyou're a littlebitoff, it's a littlebitwonky.
You're a littlebitoff, andwhatreallymattersfaras a businessconcernwon't reallymatter.
Butthen, ifyoustarttyingthoseresultsanddootherfunctions, andthosewerealso a littlebitoffandthenthoseresultsaretiedintootherfunctions, allof a suddenyoucangofrombeinglike 1% off, wherethebusinessisn't evengonnanoticethatthere's a problemtobemassivelyoff, andespeciallyifyouhavetohavethingslikecorporateauditorscomeinwhenthelast.
Ifyouthinkaboutsales, anythingaboutotherwaysthatyoucancomputethingsitcouldbe, thiscouldbe a veryusefultoolforyouandsomethingthatgetsoverlookedby a lotofpeoplethatarenewtomysequeldatabases.
So, asalways, I enjoydoingthisvideoforcingoutthenextone.
Apparently, thetypeofcontentyoujustsawisnotwhatSusan W.
WantsforthefutureofYouTube.
ThismeansthatrecommendationsbyYouTubetothischannelhavedroppedmassively, andviewsarebecoming a comicallysmall I hatetoask.
I usedtosay I wouldneverask, butifyoucouldsubscribelikecommonandmostimportantly, sharethevideosthatyouappreciate, thatmayhelpslowthedeathofthischannel.