Chapter 11: Introducing PLSQL Programming


Overview

Oracle added a procedural programming language known as PL/SQL (Procedural Language/SQL) to the database. PL/SQL is built on top of SQL and enables you to write programs that contain SQL statements. PL/SQL is a third-generation language and contains the standard programming constructs you would expect from such a language, such as:

  • Block structure

  • Variables and types

  • Conditional logic

  • Loops

  • Cursors, which hold the results returned by a query

  • Procedures

  • Functions

  • Packages, which may be used to group procedures and functions together in one unit

You typically use PL/SQL to add business logic to the database. This centralized code may be called by any program that can access the database, including SQL*Plus, a C program, or a Java program.

Note  

For full details on how to access a database through Java, see my book Oracle9i JDBC Programming (Oracle Press, 2002).

In this chapter, you ll learn about PL/SQL programming. You ll also learn how to create triggers, which are blocks of code that are run when a certain event occurs in the database. Let s plunge in and examine block structure.




Oracle Database 10g SQL
Oracle Database 10g SQL (Osborne ORACLE Press Series)
ISBN: 0072229810
EAN: 2147483647
Year: 2004
Pages: 217

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net