5.1. What Is PL/SQL?

PL/SQL is a programming language built directly into Oracle that extends the SQL. For those comfortable with Microsoft SQL Server, PL/SQL's analogue would be Transact-SQL (T-SQL). PL/SQL is based on the ADA language, originally developed by the U.S. Department of Defense. ADA was named after Ada Lovelace, assistant to Charles Babbage and daughter of Lord Byron, the English poet. PL/SQL first appeared with Oracle 6 in 1991, but with limited capabilities. You could not, for example, create stored procedures, and it was only useful for batching queries. This changed with Oracle 7, when users could begin to create their own procedures and functions and group these together in packages. PL/SQL is also used to implement triggers and types.

When developers need to do something that they can't do in PL/SQL, they can call out from their procedure or function to C functions, either in the form of external libraries or internal functions within the Oracle process itself (see Figure 5-1). Furthermore, PL/SQL can call out to Java methods using Aurora, the Java Virtual Machine that's built into Oracle.

Get The Oracle® Hacker's Handbook: Hacking and Defending Oracle now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.