{"id":22059,"date":"2013-05-13T10:28:02","date_gmt":"2013-05-13T04:58:02","guid":{"rendered":"http:\/\/vskills.in\/certification\/tutorial\/?p=22059"},"modified":"2024-04-12T14:16:42","modified_gmt":"2024-04-12T08:46:42","slug":"overloading-and-recursion","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/overloading-and-recursion\/","title":{"rendered":"Overloading and recursion"},"content":{"rendered":"<p><a class=\"vsc\" href=\"http:\/\/www.vskills.in\/certification\/Certified-PL-SQL-Developer\"><span class=\"vsc-cn\" style=\"text-align: center;\"><span style=\"color: red;\">Certify and Increase Opportunity.<\/span><br \/>\n<span style=\"color: green;\">Be <\/span><br \/>\nGovt. Certified PL SQL Developer<br \/>\n<\/span><\/a><\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Overloading<\/strong><\/span><\/p>\n<p>The terms overloading and overloaded may refer to:<\/p>\n<ul>\n<li>Constructor and function\/method overloading, in computer science, a type of polymorphism where different functions with the same name are invoked based on the data types of the parameters passed<\/li>\n<li>Operator overloading, a form of functional or method overloading where the action being overloaded is an operator, such as + or &#8211;<\/li>\n<\/ul>\n<p>The process of &#8220;overloading&#8221; originates in the world of object-oriented coding with the concept of polymorphism.\u00a0 It is the idea that the functionality of a PL\/SQL stored procedure of function can be changed based on the input datatype.<\/p>\n<p>Polymorphism was a spin off of the PL\/SQL concept called \u201coverloading\u201d\u00a0 Overloading a stored procedure or function refers to the ability of a programming method to perform more than one kind of operation depending upon the context in which the method is used.<\/p>\n<p>A very simple example of this is the use of the operator \u201c+\u201d, in working with characters it can be used for concatenation and if used with numerical values it would be used for addition.\u00a0 A programming example of overloading would look as follows.<\/p>\n<p>Concatenation example:<\/p>\n<p>First_Name = \u201cJohn\u201d<br \/>\nLast_Name = \u201cSmith\u201d<br \/>\nFull_Name = First_Name + Last_Name<\/p>\n<p>Numerical example<\/p>\n<p>Kounter = Kounter + 1<\/p>\n<p>Oracle member methods and overloading<br \/>\nOverloading is associated with the object-oriented idea of \u201cpolymorphism\u201d whereby a single procedure may be context-sensitive, depending on the input parameters and it is also used in the object-oriented Oracle with the idea of member methods.<\/p>\n<p>An example of this type of method would be an update method that updates a table attribute based on the value that is passed. If a date value is passed, the procedure will do the conversion to character, same with a number.<\/p>\n<p>The technique for overloading a method procedure or function is identical to the overloading of standard procedure or function.<\/p>\n<p>create type<br \/>\ntest3(<br \/>\ntype_passed varchar2(8),<br \/>\nmember procedure input_type(in_char char),<br \/>\nmember procedure input_type(in_varchar varchar2),<br \/>\nmember procedure input_type(in_date date),<br \/>\nmember procedure input_type(in_number number)<br \/>\n);<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Recursion<\/strong><\/span><\/p>\n<p>PL\/SQL does support recursion via function calls.\u00a0 Recursion is the act of a function calling itself, and a recursive call requires PL\/SQL to create local copies of its memory structures for each call.\u00a0 The Oracle docs notes:<\/p>\n<p>\u201cPL\/SQL does allow for recursive execution of function calls, however, so you can put it to use inside a SQL statement where recursion is needed.\u201d<\/p>\n<p><span style=\"text-decoration: underline;\">PL\/SQL Recursive cursors<\/span><br \/>\nA &#8220;cursor&#8221; is not a PL\/SQL programmer who cusses, but rather, PL\/SQL uses a cursor to keep a handle to each recursive call.\u00a0 In PL\/SQL, a recursive cursor (a pointer to a shared SQL area) is used to keep a pointer to each call of a recursive function in PL\/SQL.<\/p>\n<p><span style=\"text-decoration: underline;\">Recursive SQL<\/span><br \/>\nA \u201cRecursive SQL statement\u201d refers to additional &#8220;hidden&#8221; SQL that is issued for internal Oracle functions such as re-caching paged-out data from the dictionary cache, but we also see recursive SQL for these items, especially DDL:<\/p>\n<ul>\n<li>Parsing a new SQL statement (validate table &amp; column names, check security)<\/li>\n<li>Space management functions required to service DDL (create table)<\/li>\n<li>Trigger code<\/li>\n<li>SQL within PL\/SQL (functions and stored procedures)<\/li>\n<li>Referential integrity checks<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h6>-dba-oracle<\/h6>\n<div class=\"apply\">\n<h3>Apply for PL SQL Certification Now!!<\/h3>\n<p><a href=\"http:\/\/www.vskills.in\/certification\/Certified-PL-SQL-Developer\">http:\/\/www.vskills.in\/certification\/Certified-PL-SQL-Developer<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Certify and Increase Opportunity. Be Govt. Certified PL SQL Developer Overloading The terms overloading and overloaded may refer to: Constructor and function\/method overloading, in computer science, a type of polymorphism where different functions with the same name are invoked based on the data types of the parameters passed Operator overloading, a form of functional or&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[288],"tags":[],"class_list":["post-22059","page","type-page","status-publish","hentry","category-pl-sql"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Overloading and recursion tutorials<\/title>\n<meta name=\"description\" content=\"Overloading and recursion tutorials\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/overloading-and-recursion\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Overloading and recursion tutorials\" \/>\n<meta property=\"og:description\" content=\"Overloading and recursion tutorials\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/overloading-and-recursion\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-12T08:46:42+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/overloading-and-recursion\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/overloading-and-recursion\/\",\"name\":\"Overloading and recursion tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"datePublished\":\"2013-05-13T04:58:02+00:00\",\"dateModified\":\"2024-04-12T08:46:42+00:00\",\"description\":\"Overloading and recursion tutorials\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/overloading-and-recursion\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/overloading-and-recursion\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/overloading-and-recursion\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Overloading and recursion\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Overloading and recursion tutorials","description":"Overloading and recursion tutorials","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vskills.in\/certification\/tutorial\/overloading-and-recursion\/","og_locale":"en_US","og_type":"article","og_title":"Overloading and recursion tutorials","og_description":"Overloading and recursion tutorials","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/overloading-and-recursion\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-04-12T08:46:42+00:00","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/overloading-and-recursion\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/overloading-and-recursion\/","name":"Overloading and recursion tutorials","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"datePublished":"2013-05-13T04:58:02+00:00","dateModified":"2024-04-12T08:46:42+00:00","description":"Overloading and recursion tutorials","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/overloading-and-recursion\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/overloading-and-recursion\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/overloading-and-recursion\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Overloading and recursion"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/22059","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=22059"}],"version-history":[{"count":6,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/22059\/revisions"}],"predecessor-version":[{"id":51928,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/22059\/revisions\/51928"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=22059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=22059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=22059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}