F Pro*COBOL for Windows
Sample Programs
Oracle provides sample programs to demonstrate the use of Pro*COBOL with Oracle database features. See "Sample Files" for a listing of these programs.
This section describes how to use the basic precompiling, compiling, and linking commands to build the sample programs. This section also describes the preparations required for running the Pro*COBOL sample programs.
Building the Demonstration Table
To run the Pro*COBOL sample programs, you must have a database account with the username and the password . If this account does not exist on your database, create one before running the sample programs.
The scott account must contain the emp and dept tables. If the account does not contain these tables, use the demobld.sql script to create them.
To run the demobld.sql script:
Start SQL*Plus.
Connect to the database as username scott with password .
Run the demobld.sql script. For example:
SQL> @ORACLE_BASE\ORACLE_HOME\sqlplus\demo\demobld.sql
Building the Sample Programs
Pro*COBOL supplies the makeit.bat file which is listed in the next section, for building a MERANT Micro Focus COBOL sample file:
For release 9.2.0, the batch files are located in .
To build the sample programs:
Run the batch files with any sample file. Do not include the file extension. For example:
C:\ORACLE\ORA90\PRECOMP\DEMO\PROCOB2> makeit sample1Ensure that all paths and file names reflect the configuration of your system, if you encounter errors when building a sample program.
The commands to run the sample programs assume that the following are the current working directory:
ORACLE_BASE\ORACLE_HOME \precomp\demo\procob2 directory for release 9.2.0You may need to modify the sample link script to reflect the configuration of your system. See "Compiling and Linking Pro*COBOL Applications" for more information.
The makeit.bat for release 9.2.0 contains the following:
procob iname=%1.pco ireclen=132 cobol %1 /anim /litlink makesyn "COMP-5" = "COMP"; cbllink %1 /M%1 ORACLE_BASE\ORACLE_HOME\precomp\lib\orasql11.libSample Files
The Pro*COBOL sample files listed in Table F-1 are located in the (release 9.2.0) directory. The SQL scripts are located in the directory.
Table F-1 Pro*COBOL Sample Programs
Sample Program | Description |
---|---|
Simple query | |
Cursor operations | |
Host tables | |
Datatype equivalence | |
Dynamic SQL Method 1 | |
Dynamic SQL Method 2 | |
Dynamic SQL Method 3 | |
Stored procedure call | |
Stored procedure call | |
Dynamic SQL Method 4 | |
Cursor variable operations | |
Cursor variable operations | |
Dynamic SQL Method 4 using ANSI dynamic SQL | |
Nested program | |
Simple query and insert | |
Host table x (release 8.1.6 and on) | |
LOB datatypes (release 8.1.6 and on) | |
LOB datatypes (release 8.1.6 and on) |
-