Packages in PL/SQL | Oracle PL/SQL - Packages Tutorial Videos 2023 | Parnika Tutorials

Опубликовано: 20 Октябрь 2022
на канале: Parnika Tutorials
683
7

"Packages in PL/SQL | Oracle PL/SQL - Packages Tutorial Videos 2023

#plsqlpackages #oracleplsqlpackages #plsql #plsqlbasics #plsqlprocedures #plsqlcursor #plsqlfunctions #plsqltriggers #plsqlvssql #oracleplsql #PLSQLtutorialforbeginners #PLSQLtutorialinenglish #plsqlinterview #plsqlinenglish #parnikatutorials #plsql2023 #plsqlfullcourse2023 #plsqlfullcrashcourse2023 #plsqlcrashcourse #plsqlcourse2023

01:42 - package specification
03:08 - package body
03:54 - syntax for creating a packages
05:13 - create a package body
07:49 - package specification"

Packages are schema objects that groups logically related PL/SQL types, variables, and subprograms.

A package will have two mandatory parts −

Package specification
Package body or definition

Package Specification

The specification is the interface to the package. It just DECLARES the types, variables, constants, exceptions, cursors, and subprograms that can be referenced from outside the package. In other words, it contains all information about the content of the package, but excludes the code for the subprograms.

All objects placed in the specification are called public objects. Any subprogram not in the package specification but coded in the package body is called a private object.

CREATE PACKAGE cust_sal AS
PROCEDURE find_sal(c_id customers.id%type);
END cust_sal;
/

The package body has the codes for various methods declared in the package specification and other private declarations, which are hidden from the code outside the package.

The CREATE PACKAGE BODY Statement is used for creating the package body.

CREATE OR REPLACE PACKAGE BODY cust_sal AS

PROCEDURE find_sal(c_id customers.id%TYPE) IS
c_sal customers.salary%TYPE;
BEGIN
SELECT salary INTO c_sal
FROM customers
WHERE id = c_id;
dbms_output.put_line('Salary: '|| c_sal);
END find_sal;
END cust_sal;
/

Using the Package Elements

The package elements (variables, procedures or functions) are accessed with the following syntax −

package_name.element_name;


Social media Links:
Instagram:   / parnikatutorials  
Website: http://parnikatutorials.in/
Email id: [email protected]
To get the regular updates:
Telegram link: https://t.me/Parnikatutorials
Facebook: https://m.facebook.com/profile.php?id...
Linkedin:   / parnika-tutorials-a8a9831b2  
Pinterest:   / parnikatutorials0892  
Playlists:
Virtual Coffee with Jagadeesh:
   • VIRTUAL COFFEE WITH JAGADEESH  
Digital Logic Design:
   • Digital Logic Design  
Computer Organization and Architecture:
   • ABOUT PARNIKA TUTORIALS  
C Programming:
   • L 1: WHAT IS AN ALGORITHM AND CHARACT...  
Data Structures:
   • L 1: Uncover the Benefits of Linked L...  

Theory of Computation:
   • ABOUT PARNIKA TUTORIALS  

Compiler Design:
   • ABOUT PARNIKA TUTORIALS  
Operating Systems:    • PROCESS STATE DIAGRAM | LONG TERM, SH...  

Databases:    • ABOUT PARNIKA TUTORIALS  

Computer Networks:
   • ABOUT PARNIKA TUTORIALS  
For GATE PYQs and much more explore:
   / parnikatutorials