|Pro*COBOL Precompiler Programmer's Guide
This chapter introduces you to the Pro*COBOL Precompiler. You look at its role in developing application programs that manipulate Oracle data and find out what it allows your applications to do. The following questions are answered:
The Pro*COBOL Precompiler is a programming tool that allows you to embed SQL statements in a high-level host program. As Figure 1-1 shows, the precompiler accepts the host program as input, translates the embedded SQL statements into standard Oracle run-time library calls, and generates a source program that you can compile, link, and execute in the usual way.
Oracle Precompilers are available (but not on all systems) for the following high-level languages:
Pro*Pascal, Pro*ADA and Pro*PL/I will not be released with Oracle8. However, Oracle will continue to issue patch releases for Pro*FORTRAN as bugs are reported and corrected.
The Pro*COBOL Precompiler lets you pack the power and flexibility of SQL into your application programs. You can use SQL in popular high-level languages such as COBOL. A convenient, easy to use interface lets your application access Oracle directly.
Unlike many application development tools, Pro*COBOL lets you create highly customized applications. For example, you can create user interfaces that incorporate the latest windowing and mouse technology. You can also create applications that run in the background without the need for user interaction.
Furthermore, with Pro*COBOL you can fine-tune your applications. They allow close monitoring of resource usage, SQL statement execution, and various run-time indicators. With this information, you can adjust program parameters for maximum performance.
If you want to access and manipulate Oracle data, you need SQL. Whether you use SQL interactively or embedded in an application program depends on the job at hand. If the job requires the procedural processing power of COBOL, or must be done on a regular basis, use embedded SQL.
SQL has become the database language of choice because it is flexible, powerful, and easy to learn. Being non-procedural, it lets you specify what you want done without specifying how to do it. A few English-like statements make it easy to manipulate Oracle data one row or many rows at a time.
You can execute any SQL (not SQL*Plus) statement from an application program. For example, you can
Before embedding SQL statements in an application program, you can test them interactively using SQL*Plus or Server Manager. Usually, only minor changes are required to switch from interactive to embedded SQL.
An extension to SQL, PL/SQL is a transaction processing language that supports procedural constructs, variable declarations, and robust error handling. Within the same PL/SQL block, you can use SQL and all the PL/SQL extensions.
The main advantage of embedded PL/SQL is better performance. Unlike SQL, PL/SQL allows you to group SQL statements logically and send them to Oracle in a block rather than one by one. This reduces network traffic and processing overhead.
For more information about PL/SQL including how to embed it in an application program, see Chapter 5, "Using Embedded SQL".
As Figure 1-2 shows, Pro*COBOL offers many features and benefits that help you to develop effective, reliable applications.
For example, the Pro*COBOL Precompiler allows you to: