没有合适的资源?快使用搜索试试~ 我知道了~
Pro C/C++ Precompiler Programmer's Guide
5星 · 超过95%的资源 需积分: 10 21 下载量 184 浏览量
2011-01-24
01:54:15
上传
评论
收藏 6.95MB PDF 举报
温馨提示
试读
1000页
Pro*C/C++ Precompiler Programmer's Guide.pdf Oracle中的开发指南
资源推荐
资源详情
资源评论
Pro*C/C++ Precompiler
Programmer’s Guide
Release 9.2
March 2002
Part No. A97269-01
Pro*C/C++ Precompiler Programmer’s Guide, Release 9.2
Part No. A97269-01
Copyright © 1996, 2002 Oracle Corporation. All rights reserved.
Primary Authors: Syed Mujeeb Ahmed, Jack Melnick, Neelam Singh, Tim Smith
Contributing Authors: Ruth Baylis, Paul Lane
Contributors: Bill Bailey, Subhranshu Banerjee, Julie Basu, Brian Becker, Beethoven Cheng, Michael
Chiocca, Pierre Dufour, Nancy Ikeda, Alex Keh, Thomas Kurian, Shiao-Yen Lin, Vidya Nagaraj, Jacqui
Pons, Ajay Popat, Ekkehard Rohwedder, Pamela Rothman, Alan Thiesen, Gael Stevens
Graphic Designer: Valarie Moore
The Programs (which include both the software and documentation) contain proprietary information of
Oracle Corporation; they are provided under a license agreement containing restrictions on use and
disclosure and are also protected by copyright, patent and other intellectual and industrial property
laws. Reverse engineering, disassembly or decompilation of the Programs, except to the extent required
to obtain interoperability with other independently created software or as specified by law, 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. Except as may be expressly permitted in your license agreement for these
Programs, no part of these Programs may be reproduced or transmitted in any form or by any means,
electronic or mechanical, for any purpose, without the express written permission of Oracle Corporation.
If the Programs are delivered to the U.S. Government or anyone licensing or using the programs on
behalf of the U.S. Government, the following notice is applicable:
Restricted Rights Notice Programs delivered subject to the DOD FAR Supplement are "commercial
computer software" and use, duplication, and disclosure of the Programs, including documentation,
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 disclosure of the Programs shall be subject to the restrictions in FAR
52.227-19, Commercial Computer Software - Restricted Rights (June, 1987). Oracle Corporation, 500
Oracle Parkway, Redwood City, CA 94065.
The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently
dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup,
redundancy, and other measures to ensure the safe use of such applications if the Programs are used for
such purposes, and Oracle Corporation disclaims liability for any damages caused by such use of the
Programs.
Oracle is a registered trademark, and Oracle9i, Oracle Names, Oracle Store, PL/SQL, SQL*Plus,
SQL*Net, Oracle8, Oracle7, Oracle8i, Pro*C, and Pro*C/C++ are trademarks or registered trademarks of
Oracle Corporation. Other names may be trademarks of their respective owners.
iii
Contents
Send Us Your Comments ............................................................................................................... xxxi
Preface....................................................................................................................................................... xxxiii
Audience............................................................................................................................................ xxxiii
Organization..................................................................................................................................... xxxiv
Related Documentation ................................................................................................................. xxxvii
Conventions..................................................................................................................................... xxxviii
Documentation Accessibility .............................................................................................................. xli
What’s New in Pro*C/C++? .............................................................................................................. xliii
Oracle9i Release 2 (9.2) New Features in Pro*C/C++ Precompiler............................................ xliv
Oracle9i Release 1 (9.0.1) New Features in Pro*C/C++ Precompiler......................................... xliv
Oracle8i Release 8.1.5 New Features in Pro*C/C++ Precompiler................................................ xlv
Oracle8i Release 8.1.4 New Features in Pro*C/C++ Precompiler................................................ xlv
Oracle8i Release 8.1.3 New Features in Pro*C/C++ Precompiler................................................ xlv
1 Introduction
What is an Oracle Precompiler?....................................................................................................... 1-2
Why Use the Oracle Pro*C/C++ Precompiler................................................................................ 1-4
Why Use SQL....................................................................................................................................... 1-4
Why Use PL/SQL ................................................................................................................................ 1-5
Pro*C/C++ Precompiler Benefits..................................................................................................... 1-5
Frequently Asked Questions............................................................................................................ 1-8
What is a VARCHAR?................................................................................................................. 1-8
iv
Does Pro*C/C++ Generate Calls to the Oracle Call Interface?.............................................. 1-8
Why Not Code Using SQLLIB Calls and Not Use Pro*C/C++? ........................................... 1-8
Can I Call A PL/SQL Stored Procedure From a Pro*C/C++ Program?.............................. 1-9
Can I Write C++ Code, and Precompile It Using Pro*C/C++? ............................................ 1-9
Can I Use Bind Variables Anywhere in a SQL Statement?..................................................... 1-9
I Am Confused By Character Handling in Pro*C/C++.......................................................... 1-9
Is There Anything Special About Character Pointers?.......................................................... 1-10
Why Does SPOOL Not Work in Pro*C/C++?........................................................................ 1-10
Where Can I Find The On-line Versions of the Example Programs?.................................. 1-10
How Can I Compile and Link My Application?.................................................................... 1-10
Does Pro*C/C++ Now Support Using Structures As Host Variables?.............................. 1-11
Is It Possible to Have Recursive Functions In Pro*C/C++ If I Use Embedded SQL
In the Function?........................................................................................................................... 1-11
Can I Use Any Release of Pro*C/C++ with Any Version of the Oracle Server?............... 1-11
When My Application Runs Under Oracle9i, I Keep Getting an Ora-1405 Error
(Fetched Column Value Is NULL)............................................................................................ 1-11
Are All SQLLIB Functions Private? ......................................................................................... 1-11
How Does Oracle9i Support The New Object Types? .......................................................... 1-13
Compatibility, Upgrading and Migration............................................................................... 1-13
2 Precompiler Concepts
Key Concepts of Embedded SQL Programming ......................................................................... 2-2
Embedded SQL Statements ........................................................................................................ 2-2
Embedded SQL Syntax ................................................................................................................ 2-4
Static Versus Dynamic SQL Statements.................................................................................... 2-5
Embedded PL/SQL Blocks ........................................................................................................ 2-5
Host and Indicator Variables...................................................................................................... 2-5
Oracle Datatypes........................................................................................................................... 2-6
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-8
Guidelines for Programming............................................................................................................ 2-9
v
Comments ................................................................................................................................... 2-10
Constants ..................................................................................................................................... 2-10
Declare Section............................................................................................................................ 2-10
Delimiters..................................................................................................................................... 2-11
File Length................................................................................................................................... 2-11
Function Prototyping................................................................................................................. 2-12
Host Variable Names................................................................................................................. 2-13
Line Continuation....................................................................................................................... 2-13
Line Length.................................................................................................................................. 2-13
MAXLITERAL Default Value................................................................................................... 2-13
Operators ..................................................................................................................................... 2-14
Statement Terminator ................................................................................................................ 2-14
Conditional Precompilation ........................................................................................................... 2-15
Symbol Definition....................................................................................................................... 2-15
Example SELECT Statement..................................................................................................... 2-16
Precompile Separately ..................................................................................................................... 2-16
Guidelines.................................................................................................................................... 2-16
Compile and Link............................................................................................................................. 2-17
Example Tables.................................................................................................................................. 2-17
Example Data.............................................................................................................................. 2-18
Example Program: A Simple Query.............................................................................................. 2-19
3 Database Concepts
Connect to the Database.................................................................................................................... 3-2
Using the ALTER AUTHORIZATION Clause to Change Passwords ................................. 3-3
Connecting Using Oracle Net .................................................................................................... 3-4
Automatic Connects..................................................................................................................... 3-4
Advanced Connection Options........................................................................................................ 3-6
Some Preliminaries....................................................................................................................... 3-6
Concurrent Logons....................................................................................................................... 3-6
Default Databases and Connections.......................................................................................... 3-7
Explicit Connections..................................................................................................................... 3-8
Implicit Connections.................................................................................................................. 3-14
Definitions of Transactions Terms ................................................................................................ 3-15
How Transactions Guard Your Database..................................................................................... 3-16
剩余999页未读,继续阅读
资源评论
- cinderellaxw2012-05-18是oracle的官方文档,就是版本有点老! 下载都是11g2啦。呵呵 ~~ 不过很多东西都是传承下来的。差不多。!
御豪同学
- 粉丝: 14
- 资源: 107
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功