
Pro*COBOL® Precompiler Programmer’s Guide Release 8.0 December, 1997 Part No. A58232-01 Pro*COBOL® Precompiler Programmer’s Guide Part No. A58232-01 Release 8.0 © Copyright 1997, Oracle Corporation. All rights reserved. Primary Author: Jack Melnick Contributors: Michael Chiocca, Maura Joglekar, Thomas Kurian, Shiao-yen Lin, Diana Lorentz, Lee Osborne, Jacqui Pons, Ajay Popat, Pamela Rothman, Gael Turk Graphic Designer: Valarie Moore The programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inher- ently dangerous applications. It shall be licensee's responsibility to take all appropriate fail-safe, back up, redundancy and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and Oracle disclaims liability for any damages caused by such use of the Pro- grams. This Program contains proprietary information of Oracle Corporation; it is provided under a license agreement containing restrictions on use and disclosure and is also protected by copyright patent and other intellectual property law. Reverse engineering of the software is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. Oracle Corporation does not warrant that this document is error free. If this Program is delivered to a U.S. Government Agency of the Department of Defense, then it is deliv- ered with Restricted Rights and the following legend is applicable: Restricted Rights Legend Programs delivered subject to the DOD FAR Supplement are 'commercial computer software' and use, duplication and disclosure of the Programs shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement. Otherwise, Programs delivered subject to the Federal Acquisition Regulations are 'restricted computer software' and use, duplication and disclo- sure of the Programs shall be subject to the restrictions in FAR 52..227-14, Rights in Data -- General, including Alternate III (June 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065. Oracle, Pro*COBOL, SQL*Forms, SQL*Net, and SQL*Plus are registered trademarks of Oracle Corpora- tion, Redwood City, California. Net8, Oracle Call Interface, Oracle7, Oracle7 Server, Oracle8, Oracle8 Server, Oracle Forms, PL/SQL, Pro*C, Pro*C/C++, and Trusted Oracle are trademarks of Oracle Corporation, Redwood City, California. VMS is a registered trademark of Digital Equipment Corporation. All other products or company names are used for identification purposes only, and may be trademarks of their respective owners. Contents Send Us Your Comments ................................................................................................................. xxi Preface..................................................................................................................................................... xxiii What This Manual Has to Offer ..................................................................................................... xxiv Who Should Read This Manual?.................................................................................................... xxiv How This Manual Is Organized ...................................................................................................... xxv Conventions Used in This Manual ............................................................................................... xxvii Notation ....................................................................................................................................... xxvii Syntax Description .................................................................................................................... xxviii Sample Programs ............................................................................................................................. xxviii Does the Pro*COBOL Precompiler Meet Industry Standards?................................................ xxix Requirements ............................................................................................................................... xxix Compliance.................................................................................................................................... xxx FIPS Flagger................................................................................................................................... xxx FIPS Option .................................................................................................................................. xxxi Certification .................................................................................................................................. xxxi MIA/SPIRIT ................................................................................................................................. xxxi Your Comments Are Welcome......................................................................................................... xxxi 1 Introduction What Is Pro*COBOL?......................................................................................................................... 1-2 Language Alternatives................................................................................................................. 1-3 Why Use the Pro*COBOL Precompiler? ........................................................................................ 1-3 Why Use SQL?..................................................................................................................................... 1-3 Why Use PL/SQL?............................................................................................................................... 1-4 iii What Does Pro*COBOL Offer?........................................................................................................ 1-4 2 Learning the Basics Key Concepts of Embedded SQL Programming .......................................................................... 2-2 Embedded SQL Statements......................................................................................................... 2-2 Embedded SQL Syntax ................................................................................................................ 2-5 Static versus Dynamic SQL Statements..................................................................................... 2-6 Embedded PL/SQL Blocks ......................................................................................................... 2-6 Host and Indicator Variables ...................................................................................................... 2-6 Oracle Datatypes........................................................................................................................... 2-7 Tables.............................................................................................................................................. 2-7 Datatype Equivalencing............................................................................................................... 2-8 Private SQL Areas, Cursors, and Active Sets ........................................................................... 2-8 Transactions................................................................................................................................... 2-8 Errors and Warnings .................................................................................................................... 2-9 Steps in Developing an Embedded SQL Application............................................................... 2-10 The Format of SQL Statements ...................................................................................................... 2-12 INCLUDE Statements ...................................................................................................................... 2-12 The SQLCA ........................................................................................................................................ 2-13 Oracle8 Datatypes ............................................................................................................................. 2-14 Declaring and Referencing Host Variables.................................................................................. 2-14 VARCHAR Variables ................................................................................................................. 2-14 Host Variable Guidelines........................................................................................................... 2-15 Declaring and Referencing Indicator Variables.......................................................................... 2-15 Sample Tables.................................................................................................................................... 2-15 Sample Data................................................................................................................................. 2-16 A Program Example 1: Simple Query ........................................................................................... 2-17 3 Writing a Pro*COBOL Program Programming Guidelines.................................................................................................................. 3-2 Abbreviations ................................................................................................................................ 3-2 Case-insensitivity.........................................................................................................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages554 Page
-
File Size-