没有合适的资源?快使用搜索试试~ 我知道了~
首页Pro*C/C++Precompiler Programmer’s Guide
The Pro*C/C++ Programmer's Guide is intended for programmers, systems analysts, project managers, and other Oracle users who perform, or are interested in learning about, the following tasks: ■Design and develop software applications in the Oracle environment. ■Convert existing software applications to run in an Oracle environment. ■Manage the development of software applications. To use this document, you need a working knowledge of applications programming in C and C++, and familiarity with the use of the Structured Query Language (SQL).
资源详情
资源评论
资源推荐
Pro*C/C++™ Precompiler
Programmer’s Guide
Release 8.0
December, 1997
Part No. A58233-01
Pro*C/C++™ Precompiler Programmer’s Guide
Part No. A58233-01
Release 8.0
Copyright © 1997, Oracle Corporation. All rights reserved.
Primary Author: Jack Melnick
Contributing Author: Paul Lane
Contributors: Julie Basu, Brian Becker, Beethoven Cheng, Michael Chiocca, Pierre Dufour, Nancy Ikeda,
Thomas Kurian, Shiao-Yen Lin, Jacqui Pons, Ajay Popat, Ekkehard Rohwedder, Pamela Rothman, Alan
Thiesen, 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.
iii
Contents
Send Us Your Comments................................................................................................................ xxv
Preface....................................................................................................................................................... xxvii
What This Guide Has to Offer....................................................................................................... xxviii
Who Should Read This Guide? ..................................................................................................... xxviii
How the Pro*C/C++ Guide Is Organized..................................................................................... xxviii
Conventions Used in This Guide................................................................................................... xxxi
Notation ........................................................................................................................................ xxxi
ANSI/ISO Compliance..................................................................................................................... xxxi
Requirements .............................................................................................................................. xxxii
Migrating an Application................................................................................................................ xxxii
Your Comments Are Welcome....................................................................................................... xxxii
1 Introduction
What Is an Oracle Precompiler?....................................................................................................... 1-2
Why Use the Oracle Pro*C/C++ Precompiler?.............................................................................. 1-3
Why Use SQL?..................................................................................................................................... 1-3
Why Use PL/SQL?............................................................................................................................... 1-4
What Does the Pro*C/C++ Precompiler Offer?............................................................................. 1-4
Does the Oracle Pro*C/C++ Precompiler Meet Industry Standards?....................................... 1-7
Requirements ................................................................................................................................ 1-7
Compliance.................................................................................................................................... 1-8
Certification................................................................................................................................... 1-8
FIPS Flagger................................................................................................................................... 1-9
iv
Migrating an Application from Earlier Releases.......................................................................... 1-9
Frequently Asked Questions............................................................................................................ 1-9
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-5
Embedded PL/SQL Blocks ......................................................................................................... 2-6
Host and Indicator Variables ...................................................................................................... 2-6
Oracle Datatypes........................................................................................................................... 2-7
Arrays............................................................................................................................................. 2-7
Datatype Equivalencing............................................................................................................... 2-7
Private SQL Areas, Cursors, and Active Sets ........................................................................... 2-7
Transactions................................................................................................................................... 2-8
Errors and Warnings.................................................................................................................... 2-8
Steps in Developing an Embedded SQL Application................................................................. 2-9
Sample Tables ................................................................................................................................... 2-11
Sample Data................................................................................................................................. 2-11
Sample Program: A Simple Query ................................................................................................ 2-12
3 Developing a Pro*C/C++ Application
Support for the C Preprocessor........................................................................................................ 3-2
How the Pro*C/C++ Preprocessor Works................................................................................ 3-2
Preprocessor Directives ............................................................................................................... 3-3
ORA_PROC Macro....................................................................................................................... 3-4
Specifying the Location of Header Files.................................................................................... 3-4
Some Preprocessor Examples ..................................................................................................... 3-5
SQL Statements Not Allowed in #include ................................................................................ 3-7
Including the SQLCA, ORACA, and SQLDA .......................................................................... 3-7
EXEC SQL INCLUDE and #include Summary........................................................................ 3-8
Defined Macros............................................................................................................................. 3-8
Migrating From Earlier Pro*C/C++ Releases................................................................................. 3-9
Character Strings........................................................................................................................... 3-9
Deprecated Precompiler Option................................................................................................. 3-9
v
Error Message Codes ................................................................................................................. 3-10
Include Files................................................................................................................................. 3-10
Output Files................................................................................................................................. 3-10
Indicator Variables ..................................................................................................................... 3-10
Programming Guidelines................................................................................................................ 3-11
C++ Support................................................................................................................................ 3-11
Comments.................................................................................................................................... 3-11
Constants ..................................................................................................................................... 3-11
Delimiters..................................................................................................................................... 3-12
File Length................................................................................................................................... 3-12
Function Prototyping................................................................................................................. 3-12
Host Variable Names................................................................................................................. 3-13
Line Continuation....................................................................................................................... 3-13
MAXLITERAL Default Value................................................................................................... 3-13
Operators ..................................................................................................................................... 3-14
Statement Labels......................................................................................................................... 3-14
Statement Terminator ................................................................................................................ 3-15
Precompile-time Evaluation of Numeric Constants .................................................................. 3-15
Using Numeric Constants in Pro*C/C++............................................................................... 3-16
Numeric Constant Rules and Examples.................................................................................. 3-16
Oracle Datatypes............................................................................................................................... 3-17
Internal Datatypes...................................................................................................................... 3-17
External Datatypes ..................................................................................................................... 3-18
Host Variables................................................................................................................................... 3-27
Declaring Host Variables........................................................................................................... 3-27
Referencing Host Variables....................................................................................................... 3-31
Indicator Variables........................................................................................................................... 3-32
Using the Keyword INDICATOR............................................................................................ 3-32
An Example................................................................................................................................. 3-33
Guidelines.................................................................................................................................... 3-34
Oracle Restrictions...................................................................................................................... 3-34
Host Structures.................................................................................................................................. 3-34
Host Structures and Arrays....................................................................................................... 3-36
PL/SQL Records......................................................................................................................... 3-36
Nested Structures and Unions.................................................................................................. 3-37
剩余719页未读,继续阅读
sihuotheonly
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
- MW全能培训汽轮机调节保安系统PPT教学课件.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论3