{"id":1794,"date":"2017-12-25T22:32:45","date_gmt":"2017-12-25T15:32:45","guid":{"rendered":"https:\/\/oracletutorial.com\/?page_id=1794"},"modified":"2025-06-01T07:02:03","modified_gmt":"2025-06-01T14:02:03","slug":"plsql-package-body","status":"publish","type":"page","link":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-package-body\/","title":{"rendered":"PL\/SQL Package Body"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn how to create a PL\/SQL package body using the <code>CREATE PACKAGE BODY<\/code> statement.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introducing-to-the-plsql-package-body'>Introducing to the PL\/SQL package body <a href=\"#introducing-to-the-plsql-package-body\" class=\"anchor\" id=\"introducing-to-the-plsql-package-body\" title=\"Anchor for Introducing to the PL\/SQL package body\">#<\/a><\/h2>\n\n\n\n<p>A PL\/SQL package consists of two parts: <a href=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-package-specification\/\">package specification<\/a> and body.<\/p>\n\n\n\n<p>If the package specification has <a href=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-cursor\/\">cursors<\/a> or subprograms, then the package body is mandatory. Otherwise, it is optional. Both the package body and package specification must be in the same schema.<\/p>\n\n\n\n<p>Every cursor or subprogram declared in the package specification must have a corresponding definition in the package body.<\/p>\n\n\n\n<p>Besides the implementation of the cursors and subprograms in the package specification, a package body may have private items that are accessible only within itself.<\/p>\n\n\n\n<p>A package body can have an initialization part which consists of statements that initialize public <a href=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-variables\/\">variables<\/a> and do other one-time setup tasks. The initialization part only runs once at the first time the package is referenced. It can also include an exception handler.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='creating-a-package-body'>Creating a package body <a href=\"#creating-a-package-body\" class=\"anchor\" id=\"creating-a-package-body\" title=\"Anchor for Creating a package body\">#<\/a><\/h2>\n\n\n\n<p>To create a package body, you use the <code>CREATE PACKAGE BODY<\/code> as shown below:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> &#91;<span class=\"hljs-keyword\">OR<\/span> <span class=\"hljs-keyword\">REPLACE<\/span>] <span class=\"hljs-keyword\">PACKAGE<\/span> <span class=\"hljs-keyword\">BODY<\/span> &#91;schema_name.]&lt;package_name&gt; <span class=\"hljs-keyword\">IS<\/span> | <span class=\"hljs-keyword\">AS<\/span>\n    declarations\n    implementations;\n&#91;<span class=\"hljs-keyword\">BEGIN<\/span>\n<span class=\"hljs-keyword\">EXCEPTION<\/span>]\n<span class=\"hljs-keyword\">END<\/span> &#91;&lt;package_name&gt;];<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, specify the package name after the <code>CREATE PACKAGE BODY<\/code> keywords. The schema name is optional. By default, it is your schema.<\/li>\n\n\n\n<li>Second, the <code>OR REPLACE<\/code> option replaces the existing package body definition or do nothing if the package body does not exist.<\/li>\n\n\n\n<li>Third, between the <code>AS<\/code> and <code>END<\/code> keywords are the declarations of private items and the implementations of the public items declared in the package specification. Note that you can use either <code>IS<\/code> or <code>AS<\/code> keyword.<\/li>\n<\/ul>\n\n\n\n<p>The following example illustrates how to create the body of the <code>order_mgmt<\/code> package:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">\n<span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">OR<\/span> <span class=\"hljs-keyword\">REPLACE<\/span> <span class=\"hljs-keyword\">PACKAGE<\/span> <span class=\"hljs-keyword\">BODY<\/span> order_mgmt\n<span class=\"hljs-keyword\">AS<\/span>\n  <span class=\"hljs-comment\">-- get net value of a order<\/span>\n  <span class=\"hljs-keyword\">FUNCTION<\/span> get_net_value( p_order_id <span class=\"hljs-built_in\">NUMBER<\/span>) <span class=\"hljs-keyword\">RETURN<\/span> <span class=\"hljs-built_in\">NUMBER<\/span>\n  <span class=\"hljs-keyword\">IS<\/span>\n    ln_net_value <span class=\"hljs-built_in\">NUMBER<\/span>;\n  <span class=\"hljs-keyword\">BEGIN<\/span>\n    <span class=\"hljs-keyword\">SELECT<\/span>\n      <span class=\"hljs-keyword\">SUM<\/span>(unit_price * quantity)\n    <span class=\"hljs-keyword\">INTO<\/span>\n      ln_net_value\n    <span class=\"hljs-keyword\">FROM<\/span>\n      order_items\n    <span class=\"hljs-keyword\">WHERE<\/span>\n      order_id = p_order_id;\n\n    RETURN ln_net_value;\n\n  EXCEPTION\n  WHEN no_data_found THEN\n    DBMS_OUTPUT.PUT_LINE( SQLERRM );\n  <span class=\"hljs-keyword\">END<\/span> get_net_value;\n\n<span class=\"hljs-comment\">-- Get net value by customer<\/span>\n  FUNCTION get_net_value_by_customer(\n      p_customer_id NUMBER,\n      p_year        NUMBER)\n    RETURN NUMBER\n  IS\n    ln_net_value NUMBER;\n  <span class=\"hljs-keyword\">BEGIN<\/span>\n    <span class=\"hljs-keyword\">SELECT<\/span>\n      <span class=\"hljs-keyword\">SUM<\/span>(quantity * unit_price)\n    <span class=\"hljs-keyword\">INTO<\/span>\n      ln_net_value\n    <span class=\"hljs-keyword\">FROM<\/span>\n      order_items\n    <span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> orders <span class=\"hljs-keyword\">USING<\/span> (order_id)\n    <span class=\"hljs-keyword\">WHERE<\/span>\n      <span class=\"hljs-keyword\">extract<\/span>(<span class=\"hljs-keyword\">YEAR<\/span> <span class=\"hljs-keyword\">FROM<\/span> order_date) = p_year\n    <span class=\"hljs-keyword\">AND<\/span> customer_id                 = p_customer_id\n    <span class=\"hljs-keyword\">AND<\/span> <span class=\"hljs-keyword\">status<\/span>                      = gc_shipped_status;\n    RETURN ln_net_value;\n  EXCEPTION\n  WHEN no_data_found THEN\n    DBMS_OUTPUT.PUT_LINE( SQLERRM );\n  <span class=\"hljs-keyword\">END<\/span> get_net_value_by_customer;\n\n<span class=\"hljs-keyword\">END<\/span> order_mgmt;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This package body includes the implementations of the two functions declared in the package specification.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='compiling-a-package-body'>Compiling a package body <a href=\"#compiling-a-package-body\" class=\"anchor\" id=\"compiling-a-package-body\" title=\"Anchor for Compiling a package body\">#<\/a><\/h2>\n\n\n\n<p>The process of compiling a package body is the same as compiling a package specification.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='plsql-developer'>PL\/SQL Developer <a href=\"#plsql-developer\" class=\"anchor\" id=\"plsql-developer\" title=\"Anchor for PL\/SQL Developer\">#<\/a><\/h3>\n\n\n\n<p>From PL\/SQL Developer, you click the <strong>Run Script<\/strong> button to compile the package body.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"384\" height=\"255\" src=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/12\/PLSQL-Package-Body-Compile-using-SQL-Developer.png\" alt=\"PLSQL Package Body Compile using SQL Developer\" class=\"wp-image-1795\" title=\"PLSQL Package Body Compile using SQL Developer\" srcset=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/12\/PLSQL-Package-Body-Compile-using-SQL-Developer.png 384w, https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/12\/PLSQL-Package-Body-Compile-using-SQL-Developer-300x199.png 300w\" sizes=\"auto, (max-width: 384px) 100vw, 384px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id='sqlplus'>SQL*Plus <a href=\"#sqlplus\" class=\"anchor\" id=\"sqlplus\" title=\"Anchor for SQL*Plus\">#<\/a><\/h3>\n\n\n\n<p>If you use SQL*Plus for compiling and creating a package body, you type forward slash (\/) as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"802\" height=\"532\" src=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/12\/PLSQL-Package-Body-Compile-using-SQLPlus.png\" alt=\"PL\/SQL Package Body Compile using SQLPlus\" class=\"wp-image-1796\" title=\"PL\/SQL Package Body Compile using SQLPlus\" srcset=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/12\/PLSQL-Package-Body-Compile-using-SQLPlus.png 802w, https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/12\/PLSQL-Package-Body-Compile-using-SQLPlus-300x199.png 300w, https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/12\/PLSQL-Package-Body-Compile-using-SQLPlus-768x509.png 768w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id='compiling-a-package-body-from-a-file'>Compiling a package body from a file <a href=\"#compiling-a-package-body-from-a-file\" class=\"anchor\" id=\"compiling-a-package-body-from-a-file\" title=\"Anchor for Compiling a package body from a file\">#<\/a><\/h3>\n\n\n\n<p>If you manage package body using files, you can compile the package body using the following command:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">@path_to_packge_body_file<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In SQL Developer, you click the Run Script button to create a package body from a file.<\/p>\n\n\n\n<p>Similarly, you can use forward slash (\/) to compile and create a package body from a file as<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">SQL &gt; @path_to_package_body_file\n    2 \/\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='calling-functions-from-a-package'>Calling functions from a package <a href=\"#calling-functions-from-a-package\" class=\"anchor\" id=\"calling-functions-from-a-package\" title=\"Anchor for Calling functions from a package\">#<\/a><\/h3>\n\n\n\n<p>The following statement calls the <code>get_net_value_by_customer<\/code> function of the <code>order_mgmt<\/code> package:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n  order_mgmt.get_net_value_by_customer(<span class=\"hljs-number\">1<\/span>,<span class=\"hljs-number\">2017<\/span>) sales\n<span class=\"hljs-keyword\">FROM<\/span>\n  dual;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"79\" height=\"38\" src=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/12\/plsql-package-body-calling-function-example.png\" alt=\"PL\/SQL package body - calling function example\" class=\"wp-image-1797\" title=\"PL\/SQL package body - calling function example\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the <code>CREATE PACKAGE BODY<\/code> statement to create a package body.<\/li>\n<\/ul>\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=\"1794\"\n\t\t\t\tdata-post-url=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-package-body\/\"\n\t\t\t\tdata-post-title=\"PL\/SQL Package Body\"\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=\"1794\"\n\t\t\t\tdata-post-url=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-package-body\/\"\n\t\t\t\tdata-post-title=\"PL\/SQL Package Body\"\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 shows you step by step how to create a PL\/SQL package body using the CREATE PACKAGE BODY statement.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1418,"menu_order":31,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1794","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>PL\/SQL Package Body<\/title>\n<meta name=\"description\" content=\"This tutorial shows you step by step how to create a PL\/SQL package body using the CREATE PACKAGE BODY statement.\" \/>\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\/plsql-package-body\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PL\/SQL Package Body\" \/>\n<meta property=\"og:description\" content=\"This tutorial shows you step by step how to create a PL\/SQL package body using the CREATE PACKAGE BODY statement.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-package-body\/\" \/>\n<meta property=\"og:site_name\" content=\"Oracle Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-01T14:02:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/12\/PLSQL-Package-Body-Compile-using-SQL-Developer.png\" \/>\n\t<meta property=\"og:image:width\" content=\"384\" \/>\n\t<meta property=\"og:image:height\" content=\"255\" \/>\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\\\/plsql-package-body\\\/\",\"url\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/plsql-package-body\\\/\",\"name\":\"PL\\\/SQL Package Body\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/plsql-package-body\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/plsql-package-body\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.oracletutorial.com\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/PLSQL-Package-Body-Compile-using-SQL-Developer.png\",\"datePublished\":\"2017-12-25T15:32:45+00:00\",\"dateModified\":\"2025-06-01T14:02:03+00:00\",\"description\":\"This tutorial shows you step by step how to create a PL\\\/SQL package body using the CREATE PACKAGE BODY statement.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/plsql-package-body\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/plsql-package-body\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/plsql-package-body\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.oracletutorial.com\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/PLSQL-Package-Body-Compile-using-SQL-Developer.png\",\"contentUrl\":\"https:\\\/\\\/www.oracletutorial.com\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/PLSQL-Package-Body-Compile-using-SQL-Developer.png\",\"width\":384,\"height\":255,\"caption\":\"PLSQL Package Body Compile using SQL Developer\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/plsql-tutorial\\\/plsql-package-body\\\/#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\":\"PL\\\/SQL Package Body\"}]},{\"@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":"PL\/SQL Package Body","description":"This tutorial shows you step by step how to create a PL\/SQL package body using the CREATE PACKAGE BODY statement.","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\/plsql-package-body\/","og_locale":"en_US","og_type":"article","og_title":"PL\/SQL Package Body","og_description":"This tutorial shows you step by step how to create a PL\/SQL package body using the CREATE PACKAGE BODY statement.","og_url":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-package-body\/","og_site_name":"Oracle Tutorial","article_modified_time":"2025-06-01T14:02:03+00:00","og_image":[{"width":384,"height":255,"url":"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/12\/PLSQL-Package-Body-Compile-using-SQL-Developer.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\/plsql-package-body\/","url":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-package-body\/","name":"PL\/SQL Package Body","isPartOf":{"@id":"https:\/\/www.oracletutorial.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-package-body\/#primaryimage"},"image":{"@id":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-package-body\/#primaryimage"},"thumbnailUrl":"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/12\/PLSQL-Package-Body-Compile-using-SQL-Developer.png","datePublished":"2017-12-25T15:32:45+00:00","dateModified":"2025-06-01T14:02:03+00:00","description":"This tutorial shows you step by step how to create a PL\/SQL package body using the CREATE PACKAGE BODY statement.","breadcrumb":{"@id":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-package-body\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-package-body\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-package-body\/#primaryimage","url":"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/12\/PLSQL-Package-Body-Compile-using-SQL-Developer.png","contentUrl":"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/12\/PLSQL-Package-Body-Compile-using-SQL-Developer.png","width":384,"height":255,"caption":"PLSQL Package Body Compile using SQL Developer"},{"@type":"BreadcrumbList","@id":"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-package-body\/#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":"PL\/SQL Package Body"}]},{"@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\/1794","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=1794"}],"version-history":[{"count":0,"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/pages\/1794\/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=1794"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}