Humble Beginnings, Steady Improvement

In the time that Oracle has been working to make Java available as an alternative to PL/SQL in the database, it has also made steady, fundamental improvements to the PL/SQL language itself. It has added a great variety of supplied (or built-in) packages that extend the PL/SQL language in numerous ways and directions. It has introduced object-oriented capabilities, implemented a variety of array-like data structures, and in general improved the breadth and depth of the language.

As powerful as SQL is, it simply does not offer the flexibility and power that developers need to create full-blown applications. Oracle's PL/SQL language ensures that we can stay entirely within the operating-system-independent Oracle environment and still write highly efficient applications that meet our users' requirements.

PL/SQL has come a long way from its humble beginnings. With Version 1.0, it was not uncommon for a developer to have to tell his or her manager, "You can't do that with PL/SQL." Today, that statement has moved from fact to excuse. If you are ever confronted with a requirement and find yourself saying, "There's no way to do that," don't repeat it to your manager. Instead, dig deeper into the language, or explore the range of built-in PL/SQL packages offered by Oracle. There is a very good chance that PL/SQL will today allow you to do pretty much whatever you need to do.

In the next section, we take a look at some examples of PL/SQL programs that will familiarize you with the basics of PL/SQL programming.

1.3 So This Is PL/SQL

If you are completely new to programming or to working with PL/SQL (or even SQL, for that matter), learning PL/SQL may seem an intimidating prospect. If this is the case, don't fret! We are confident that you will find it easier than you think. There are two reasons for our optimism:

· Computer languages in general are not that hard to learn, at least compared to a second or third "human language." The reason? It's simply that computers are not particularly smart (they "think"—perform operations—rapidly, but not at all creatively). We must rely on a very rigid syntax in order to tell a computer what we want it to do. So the resulting language is also rigid (no exceptions!) and therefore easier for us to pick up.

· PL/SQL truly is an easy language as compared to other programming languages. It relies on a highly structured "block" design with different sections, all identified with explicit, self-documenting keywords.

Let's take a look at a few examples that demonstrate some of the key elements of both PL/SQL structure and functionality.