Chapter 5. PL/SQLIf you know ADA, Oracle PL/SQL will seem very familiar. If you don't, don't be put off by the comparison with ADA. First of all, PL/SQL is a much smaller language than ADA, and you'll quickly get used to the language features that may make it look strange at first. What sets PL/SQL apart from other languages, however, is that it is well integrated with Oracle and SQL. In fact, you can generally include SQL statements directly in PL/SQL code. These SQL statements can include PL/SQL variables for either input or output. One important limitation, however, is that SELECT statements returning multiple rows need to be handled differently as we will see later. The basic unit of programming in PL/SQL, corresponding to a method in Java, is the block. There are three types of blocks:
Also in this chapter we will see Java stored procedures. By providing a call specification that maps a Java method's parameters and return type to PL/SQL, we can implement database functions and procedures in Java. |