Top Banner
Copyright © 2004, Oracle. .All rights reserved. PL/SQL
14

PL/SQL - Siti Mukaromah's Blog | Just another WordPress ... · PDF fileAfter completing this lesson you should be able to do ... Oracle Database 10g comes with over 350 built-in ...

Jan 31, 2018

Download

Documents

dangphuc
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: PL/SQL - Siti Mukaromah's Blog | Just another WordPress ... · PDF fileAfter completing this lesson you should be able to do ... Oracle Database 10g comes with over 350 built-in ...

Copyright © 2004, Oracle. .All rights reserved.

PL/SQL

Page 2: PL/SQL - Siti Mukaromah's Blog | Just another WordPress ... · PDF fileAfter completing this lesson you should be able to do ... Oracle Database 10g comes with over 350 built-in ...

Copyright © 2004, Oracle. All rights reserved.

Objectives

After completing this lesson you should be able to do the following:• Identify PL/SQL objects• Describe triggers and triggering events• Identify configuration options that affect PL/SQL

performance

Page 3: PL/SQL - Siti Mukaromah's Blog | Just another WordPress ... · PDF fileAfter completing this lesson you should be able to do ... Oracle Database 10g comes with over 350 built-in ...

Copyright © 2004, Oracle. All rights reserved.

PL/SQL

Procedural Language/Structured Query Language (PL/SQL) is a fourth generation (4GL) programming language. PL/SQL provides:• Procedural extensions to SQL• Portability across platforms and products• Support for object-oriented programming

Page 4: PL/SQL - Siti Mukaromah's Blog | Just another WordPress ... · PDF fileAfter completing this lesson you should be able to do ... Oracle Database 10g comes with over 350 built-in ...

Copyright © 2004, Oracle. All rights reserved.

Administering PL/SQL Objects

Database administrators should be able to:• Identify problem PL/SQL objects• Recommend appropriate use of PL/SQL• Load PL/SQL objects into the database• Assist PL/SQL developers in troubleshooting

Page 5: PL/SQL - Siti Mukaromah's Blog | Just another WordPress ... · PDF fileAfter completing this lesson you should be able to do ... Oracle Database 10g comes with over 350 built-in ...

Copyright © 2004, Oracle. All rights reserved.

PL/SQL Objects

There are many types of PL/SQL database objects:• Package• Package body• Type body• Procedure• Function• Trigger

Page 6: PL/SQL - Siti Mukaromah's Blog | Just another WordPress ... · PDF fileAfter completing this lesson you should be able to do ... Oracle Database 10g comes with over 350 built-in ...

Copyright © 2004, Oracle. All rights reserved.

Functions

Page 7: PL/SQL - Siti Mukaromah's Blog | Just another WordPress ... · PDF fileAfter completing this lesson you should be able to do ... Oracle Database 10g comes with over 350 built-in ...

Copyright © 2004, Oracle. All rights reserved.

Procedures

Procedures are used to perform a specific action. Procedures: • Transfer values in and out through an argument

list• Are called with the CALL command

Page 8: PL/SQL - Siti Mukaromah's Blog | Just another WordPress ... · PDF fileAfter completing this lesson you should be able to do ... Oracle Database 10g comes with over 350 built-in ...

Copyright © 2004, Oracle. All rights reserved.

Packages

Packages are collections of functions and procedures. Each package should consist of two objects:• Package specification• Package body

Page 9: PL/SQL - Siti Mukaromah's Blog | Just another WordPress ... · PDF fileAfter completing this lesson you should be able to do ... Oracle Database 10g comes with over 350 built-in ...

Copyright © 2004, Oracle. All rights reserved.

Package Body

Page 10: PL/SQL - Siti Mukaromah's Blog | Just another WordPress ... · PDF fileAfter completing this lesson you should be able to do ... Oracle Database 10g comes with over 350 built-in ...

Copyright © 2004, Oracle. All rights reserved.

Built-In Packages

Oracle Database 10g comes with over 350 built-in PL/SQL packages providing:• Administration and maintenance utilities• Extended functionality

Use the DESCRIBE command to view subprograms

SQL> DESCRIBE dbms_statsPROCEDURE ALTER_DATABASE_TAB_MONITORINGArgument Name Type In/Out Default?--------------- ------- ------ --------MONITORING BOOLEAN IN DEFAULTSYSOBJS BOOLEAN IN DEFAULT

...

Page 11: PL/SQL - Siti Mukaromah's Blog | Just another WordPress ... · PDF fileAfter completing this lesson you should be able to do ... Oracle Database 10g comes with over 350 built-in ...

Copyright © 2004, Oracle. All rights reserved.

Triggers

Page 12: PL/SQL - Siti Mukaromah's Blog | Just another WordPress ... · PDF fileAfter completing this lesson you should be able to do ... Oracle Database 10g comes with over 350 built-in ...

Copyright © 2004, Oracle. All rights reserved.

PL/SQL Configuration Options

There are several PL/SQL compiler settings that control PL/SQL performance. For fastest performance set:• PLSQL_CODE_TYPE=NATIVE• PLSQL_DEBUG=FALSE• PLSQL_OPTIMIZE_MODE=2• PLSQL_WARNING=DISABLE:ALL

Page 13: PL/SQL - Siti Mukaromah's Blog | Just another WordPress ... · PDF fileAfter completing this lesson you should be able to do ... Oracle Database 10g comes with over 350 built-in ...

Copyright © 2004, Oracle. All rights reserved.

Summary

In this lesson you should have learned how to:• Identify PL/SQL objects• Describe triggers and triggering events• Identify configuration options that affect PL/SQL

performance

Page 14: PL/SQL - Siti Mukaromah's Blog | Just another WordPress ... · PDF fileAfter completing this lesson you should be able to do ... Oracle Database 10g comes with over 350 built-in ...

Copyright © 2004, Oracle. All rights reserved.

Practice Overview

There is no practice exercise for this lesson. You will be managing and creating PL/SQL objects several times during the rest of this course.