Professional Documents
Culture Documents
Packages 1
Packages 1
PL/SQL
10-1
Creating Packages
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 3
Creating Packages
Purpose
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 4
Creating Packages
Purpose
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 5
Creating Packages
What Are PL/SQL Packages?
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 6
Creating Packages
Components of a PL/SQL Package
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 7
Creating Packages
Components of a PL/SQL Package
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 8
Creating Packages
Components of a PL/SQL Package
Package
specification Variable_1
Procedure A declaration;
Variable_2
Procedure B definition…
Package Variable_3
body
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 9
Creating Packages
Syntax for Creating the Package
Specification
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 10
Creating Packages
Syntax for Creating the Package
Specification
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 11
Creating Packages
Syntax for Creating the Package
Specification
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 13
Creating Packages
Creating the Package Specification
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 14
Creating Packages
Example of Package Specification:
check_emp_pkg
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 15
Creating Packages
Package Specification: A Second Example
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 16
Creating Packages
Syntax for Creating the Package Body
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 17
Creating Packages
Syntax for Creating the Package Body
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 18
Creating Packages
Creating the Package Body
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 19
Creating Packages
Example of Package Body:
check_emp_pkg
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 20
Creating Packages
Changing the Package Body Code
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 21
Creating Packages
Recompiling the Package Body:
check_emp_pkg
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 22
Creating Packages
Describing a Package
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 23
Creating Packages
Reasons for Using Packages
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 25
Creating Packages
Summary
PLSQL S10L1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 26
Creating Packages