{"id":1498,"date":"2017-11-19T11:21:03","date_gmt":"2017-11-19T04:21:03","guid":{"rendered":"https:\/\/oracletutorial.com\/?page_id=1498"},"modified":"2025-05-23T19:26:23","modified_gmt":"2025-05-24T02:26:23","slug":"what-is-plsql","status":"publish","type":"page","link":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/what-is-plsql\/","title":{"rendered":"What is PL\/SQL"},"content":{"rendered":"\r\n<p><strong>Summary<\/strong>: This tutorial teaches you about the PL\/SQL program language and its architecture.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id='introduction-to-plsql'>Introduction to PL\/SQL <a href=\"#introduction-to-plsql\" class=\"anchor\" id=\"introduction-to-plsql\" title=\"Anchor for Introduction to PL\/SQL\">#<\/a><\/h2>\r\n\r\n\r\n\r\n<p>PL\/SQL stands for <strong>Procedural Language\/Structured Query Language<\/strong>. PL\/SQL is an extension to the SQL language, specifically designed for the Oracle Database.<\/p>\r\n\r\n\r\n\r\n<p>While <a href=\"https:\/\/www.sqltutorial.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">SQL<\/a> is excellent for interacting with data in a relational database management system (RDBMS), it is not designed to make complex programs.<\/p>\r\n\r\n\r\n\r\n<p><span style=\"box-sizing: border-box; margin: 0px; padding: 0px;\">SQL is\u00a0<strong>declarative<\/strong>, meaning you tell SQL what data you want, and SQL will figure out how to get the data.<\/span><\/p>\r\n\r\n\r\n\r\n<p>For example, when you write a <a href=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-select\/\">SELECT<\/a> statement, you tell the Oracle Database what data you want. You don&#8217;t instruct how\u00a0<span style=\"box-sizing: border-box; margin: 0px; padding: 0px;\">the Database should find that data, such as which\u00a0<a href=\"https:\/\/www.oracletutorial.com\/oracle-index\/\" target=\"_blank\" rel=\"noopener\">index<\/a>\u00a0to use, how to\u00a0<a href=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-joins\/\" target=\"_blank\" rel=\"noopener\">join tables<\/a>, or which blocks to read; the Oracle Database<\/span>\u00a0will figure it out.<\/p>\r\n\r\n\r\n\r\n<p>PL\/SQL is <strong>imperative<\/strong>, allowing you to define <em><strong>how <\/strong><\/em>to get data and how to manipulate it. Note that PL\/SQL also uses declarative parts of SQL, utilizing the best of both worlds.<\/p>\r\n\r\n\r\n\r\n<p>Here&#8217;s how you can find PL\/SQL helpful:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li><strong>Procedural constructs<\/strong>: PL\/SQL supports programming constructs like if-else, loops, and variables, allowing you to write complex logic.<\/li>\r\n\r\n\r\n\r\n<li><strong>Highly structured and Readable<\/strong>: PL\/SQL is a highly structured and readable language. Its constructs express the intent of the code clearly, and it is straightforward to learn.<\/li>\r\n\r\n\r\n\r\n<li><strong>Standard and Portable<\/strong>: PL\/SQL is a standard and portable language for Oracle Database development. If you develop a program that executes on an Oracle Database, you can quickly move it to another compatible Oracle Database with minimal changes.<\/li>\r\n\r\n\r\n\r\n<li><strong>Embedded language<\/strong>: PL\/SQL can only be executed within an Oracle Database. It was not designed to be used as a standalone language like <a href=\"https:\/\/www.zentut.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Java<\/a>, <a href=\"https:\/\/www.csharptutorial.net\/\">C#<\/a>, and C++. In other words, you cannot develop a PL\/SQL program that runs on a system that does not have an Oracle Database.<\/li>\r\n\r\n\r\n\r\n<li><strong>High-performance &amp; integrated<\/strong>: PL\/SQL offers specific constructs, such as the FORALL statement, to improve database performance by reducing the number of round trips between the database and the application.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id='plsql-architecture'>PL\/SQL architecture <a href=\"#plsql-architecture\" class=\"anchor\" id=\"plsql-architecture\" title=\"Anchor for PL\/SQL architecture\">#<\/a><\/h2>\r\n\r\n\r\n\r\n<p>The following picture illustrates the PL\/SQL architecture:<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"757\" height=\"352\" class=\"wp-image-1500\" title=\"PL\/SQL Architecture - Introduction to PL\/SQL\" src=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/11\/plsql-architecture.png\" alt=\"PL\/SQL Architecture\" srcset=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/11\/plsql-architecture.png 757w, https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/11\/plsql-architecture-300x139.png 300w\" sizes=\"auto, (max-width: 757px) 100vw, 757px\" \/><\/figure>\r\n\r\n\r\n\r\n<p>How it works:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>The PL\/SQL engine compiles PL\/SQL code into bytecode and executes the executable code. It can only be installed in an Oracle Database server or an application development tool like Oracle Forms.<\/li>\r\n\r\n\r\n\r\n<li>Once you submit a <a href=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-anonymous-block\/\">PL\/SQL block<\/a> to the Oracle Database server, the PL\/SQL engine collaborates with the SQL engine to compile and execute the code.<\/li>\r\n\r\n\r\n\r\n<li>PL\/SQL engine runs the procedural elements while the SQL engine processes the SQL statements.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>Now, you should have a basic understanding of PL\/SQL programming language and its architecture. Let&#8217;s create the first working <a href=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-anonymous-block\/\">PL\/SQL anonymous block<\/a>.<\/p>\r\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"1498\"\n\t\t\t\tdata-post-url=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/what-is-plsql\/\"\n\t\t\t\tdata-post-title=\"What is PL\/SQL\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"1498\"\n\t\t\t\tdata-post-url=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/what-is-plsql\/\"\n\t\t\t\tdata-post-title=\"What is PL\/SQL\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial introduces you to PL\/SQL programming language and explains you the PL\/SQL architecture.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1418,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1498","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is PL\/SQL<\/title>\n<meta name=\"description\" content=\"This tutorial introduces you to PL\/SQL programming language and explains the PL\/SQL architecture.\" \/>\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.oracletutorial.com\/plsql-tutorial\/what-is-plsql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is PL\/SQL\" \/>\n<meta property=\"og:description\" content=\"This tutorial introduces you to PL\/SQL programming language and explains the PL\/SQL architecture.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/what-is-plsql\/\" \/>\n<meta property=\"og:site_name\" content=\"Oracle Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-24T02:26:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/11\/plsql-architecture.png\" \/>\n\t<meta property=\"og:image:width\" content=\"757\" \/>\n\t<meta property=\"og:image:height\" content=\"352\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\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.oracletutorial.com\\\/plsql-tutorial\\\/what-is-plsql\\\/\",\"url\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/what-is-plsql\\\/\",\"name\":\"What is PL\\\/SQL\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/what-is-plsql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/what-is-plsql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.oracletutorial.com\\\/wp-content\\\/uploads\\\/2017\\\/11\\\/plsql-architecture.png\",\"datePublished\":\"2017-11-19T04:21:03+00:00\",\"dateModified\":\"2025-05-24T02:26:23+00:00\",\"description\":\"This tutorial introduces you to PL\\\/SQL programming language and explains the PL\\\/SQL architecture.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/what-is-plsql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/what-is-plsql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/what-is-plsql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.oracletutorial.com\\\/wp-content\\\/uploads\\\/2017\\\/11\\\/plsql-architecture.png\",\"contentUrl\":\"https:\\\/\\\/www.oracletutorial.com\\\/wp-content\\\/uploads\\\/2017\\\/11\\\/plsql-architecture.png\",\"width\":757,\"height\":352,\"caption\":\"pl\\\/sql architecture\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/what-is-plsql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.oracletutorial.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PL\\\/SQL Tutorial\",\"item\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"What is PL\\\/SQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/#website\",\"url\":\"https:\\\/\\\/www.oracletutorial.com\\\/\",\"name\":\"Oracle Tutorial\",\"description\":\"Oracle Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.oracletutorial.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is PL\/SQL","description":"This tutorial introduces you to PL\/SQL programming language and explains the PL\/SQL architecture.","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.oracletutorial.com\/plsql-tutorial\/what-is-plsql\/","og_locale":"en_US","og_type":"article","og_title":"What is PL\/SQL","og_description":"This tutorial introduces you to PL\/SQL programming language and explains the PL\/SQL architecture.","og_url":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/what-is-plsql\/","og_site_name":"Oracle Tutorial","article_modified_time":"2025-05-24T02:26:23+00:00","og_image":[{"width":757,"height":352,"url":"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/11\/plsql-architecture.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/what-is-plsql\/","url":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/what-is-plsql\/","name":"What is PL\/SQL","isPartOf":{"@id":"https:\/\/www.oracletutorial.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/what-is-plsql\/#primaryimage"},"image":{"@id":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/what-is-plsql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/11\/plsql-architecture.png","datePublished":"2017-11-19T04:21:03+00:00","dateModified":"2025-05-24T02:26:23+00:00","description":"This tutorial introduces you to PL\/SQL programming language and explains the PL\/SQL architecture.","breadcrumb":{"@id":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/what-is-plsql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.oracletutorial.com\/plsql-tutorial\/what-is-plsql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/what-is-plsql\/#primaryimage","url":"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/11\/plsql-architecture.png","contentUrl":"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/11\/plsql-architecture.png","width":757,"height":352,"caption":"pl\/sql architecture"},{"@type":"BreadcrumbList","@id":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/what-is-plsql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.oracletutorial.com\/"},{"@type":"ListItem","position":2,"name":"PL\/SQL Tutorial","item":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/"},{"@type":"ListItem","position":3,"name":"What is PL\/SQL"}]},{"@type":"WebSite","@id":"https:\/\/www.oracletutorial.com\/#website","url":"https:\/\/www.oracletutorial.com\/","name":"Oracle Tutorial","description":"Oracle Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.oracletutorial.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/pages\/1498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/comments?post=1498"}],"version-history":[{"count":0,"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/pages\/1498\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/pages\/1418"}],"wp:attachment":[{"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/media?parent=1498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}