|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
Oracle CGNDB ProC Development Environment Original source
Http://www.oradb.net/proc/proc_003.htm
As a forum for issues that many people asked PRO * C
PRO * C Programming note out why
1. Environmental variables
Ø Required for the operation of the distribution system following
ORACLE_SID=ORA8
NLS_LANG=American_America.zhs16cgb231280
ORA_NLS33=/home/oracle/ocommon/nls/admin/data
ORACLE_TERM=vt100
SHLIB_PATH=/home/oracle/lib
LD_LIBRARY_PATH=/home/oracle/lib:/usr/lib :.
ORACLE_HOME=/home/oracle
ORACLE_OWNER=oracle
NLS_DATE_FORMAT= 'YYYY/MM/DD'
Ø Oracle Shared Library : SHLIB_PATH $ORACLE_HOME/lib
Note : Oracle Shared Library installed automatically establish, if necessary reconstruction of this reservoir, Oracle users can order about the implementation status
Cd $ORACLE_HOME/rdbms/lib
Make-f ins_rdbms.mk client_sharedlib
Ø : There were two ways to set up the date format
(1). Through to the start of the SQL installed alter session set NLS_DATE_FORMAT
(2). NLS_DATE_FORMAT INIT.ORA parameters can be set up set up the default date format
Ø Pre-compiler option : the establishment PROCFLAGS= 'mode=ansi, def_sqlcode=true, parse=full, lines=true'
Ø Sqlca.h documents : the first, oraca.h, sqlda.h
2. Transplant attention :
Ø For char-data processing :
Informix used quotation marks, including string, and. . . Oracle string single quotation marks' up, double quotation marks as "will be a mistake (in Proc were not being given the compiler, run-time error)
If inserted in the definition of the length of a long string over the field, Informix will automatically cut out superfluous characters, and would be being given in Oracle
Oracel string type to be used in the following form to use
Char name[41];
EXEC SQL VAR name IS STRING (41);
Ø First document :
Because Oracle does not use EXEC SQL DEFINE-definition, the use of these things, there is change with constant and variable.
3. Relevant orders
Checking with the order form : Ø oerr oerr Charles err_num
Ø Identifying marker at the reservoir - related documents : symfind symname
4. Procedure pre-compiler installed
Pre-compiler option methods of default values range shows
Oracle 安 Mode=string code consistency, iso, Oracle
Allow the use of SQLCODE Def_sqlcode=boolean No yes, no, true and false
Designated pre-compiler source document Iname=string *none* *none*
Specified paper trails Include=string OR include= first pre-compiler (string, :) () *none*
Designated system header file, the path Sys_include=stringOR Sys_include= (string, :) () *none*
Pre-compiler macro definition define=string
After the pre-compiler code-type Code=string Kr_c ansi_c, cpp, kr_c
And specified string array, the corresponding string types Char_map=string Charz charz, varchar2, charf, string
Designated database linking the string (username/password [@dbname]) Userid=string *none* *none*
C compiler supports the designated characters Comp_charset=string Multi_byte multi_byte, single_byte
Database compatibility mode (Oracle) Dbms=string Native v6, v6_char, v7, native, v8
Things related parameters Duration=string Transaction session, transaction (with object in cache中 time)
Error Handling Errors=boolean Yes yes, no, true and false (whether or not to send the wrong message to the terminal)
Information Processing Standards Fips=string None none, sql89, sql2, yes, no
Cursor control Hold_cursor=boolean No yes, no, true and false (cursor control holding of cursors in the cache)
The vernier control Vernier cache中 release Release_cursor=boolean No. yes, no, true and false (cursor control release of cursors from the cache)
Allow a NULL fetch without indicator variable Unsafe_null=boolean No yes, no, true and false
Whether the code into Bank (#line) Lines=boolean No yes, no, true and false
Installed string length Maxliteral=number 1024 10-1024
Vernier can be the greatest number of open cache Maxopencursors=number 10 *none*
Nls_char language support, nls_local
Whether or not to use ORACA Oraca=boolean No yes, no, true and false
Analysis non-SQL CODE Parse=string Full control whether full, partial, none
Control of flagging errors Select_error=boolean select Yes yes, no, true and false
SQL pre-compiler code on the mode Sqlcheck=string Syntax (grammar) none, syntax, semantics (semantics), full, limited (limited)
Support multithreading Threads=boolean No yes, no, true and false
No structure Varchar=boolean allowed varchar yes, no, true and false
5. Data Types
Oracle ProC primitive data types Ø
C Datatype or Pseudotype Description
Char single character
Char[n] n-character array (string)
Int Integer
Short small integer
Long large integer
Float floating-point number (usually single precision)
Double floating-point number (always double precision)
VARCHAR[n] variable-length string
Oracle Internal Type ß a Ø Type C (ProC External Type)
Oracle Internal Type C Type (External Type)
VARCHAR2 (Y) (Note 1) char
CHAR (X) (Note 1) char[n]VARCHAR[n]IntShortLongFloatDouble
NUMBER int
NUMBER (P, S) (Note 2) ShortLongFloatDoubleCharChar[n]VARCHAR[n]
DATE Char[n]VARCHAR[n]
LONG Char[n]VARCHAR[n]
RAW (X) (Note 1) Unsigned char[n]VARCHAR[n]
LONG RAW Unsigned char[n]VARCHAR[n]
Unsigned char[n]VARCHAR[n] ROWID
Unsigned char[n]VARCHAR[n] MLSLABEL
Notes :
1. X ranges from 1 to 255. 1 is the default value. Y ranges from 1 to 4000.
2. P ranges from 2 to 38. S ranges from -84 to 127.
Ø Informix Data Type ß ß a a ESQL/C Data Type C Type
SQL Data Type ESQL/C Predefined Type C Language Data Type
BYTE loc_t
CHAR (n) CHARACTER (n) + 1] Fixchar array[n] orString array[n+1] or char * char array[n
DATE Date long int
DATETIME Datetime or dtime_t
DECIMAL (m, n) DECNUMERICMONEY (m, n) Decimal or dec_t
Double FLOATDOUBLE PRECISION
INTEGERINT 4-byte integer
INTERVAL Interval or intrvl_t
MULTISET (e) Collection
NCHAR (n) + 1] Fixchar array[n] orString array[n+1] or char * char array[n
NVARCHAR (m) Varchar[m+1] orString array[m+1] char array[m+1]
SERIAL 4-byte integer
SMALLFLOATREAL Float
SMALLINT 2-byte integer
TEXT loc_t
VARCHAR (m, x) char array[m+1] Varchar[m+1] orString array[m+1]
BLOB ifx_lo_t
BOOLEAN Boolean
CLOB ifx_lo_t
INT8 int8 8-byte integer or ifx_int8_t
LIST (e) Collection
LVARCHAR Lvarchar Char
Opaque data type Lvarchar, fixed binary, binary orvar
ROW (. . . ) Row
SERIAL8 int8 8-byte integer or ifx_int8_t
SET (e) Collection
Ø Informix ß a internal Type C Type (External type Informixß a Oracle) ß Type a Oracle Intal
Informix Internal Type C Type (External Type) Oracle Internal Type
Char (x) Char (x) Char (x), varchar2 (x)
Long Integer NUMBER (9)
Smallint Short Int NUMBER (6)
Decimal Int Float, double NUMBER
Float Float NUMBER (18,4)
Serial Long NUMBER (11)
Date Char (11) a DATE DATE (/ NUMBER (10))
Money
DateTime Char (20) DATE
Interval
Varchar (1. . 255) Char (x) Char (x)
Text
Byte
Brief : Oracle CGNDB completely electronic files (which can be from the station technet.oracle.com.cn)
Precompiler Pro C and C + + Programmer 's Guide
Page 354:Transaction
Page 362:Commit work in Fetch
Page 218 : you can not FORUPDATE FETCH from a cursor after a COMMIT. If you try to do this, Oracle returns a 1002 error code.
Page 357:When MODE=ORACLE, explicit cursors not referenced in a CURRENT OF clause remain open across ROLLBACKs.
Page 601:when MODE=ANSI, you must CLOSE reOPENing a cursor before it.
Page 356:Rolling back to a savepoint erases any savepoints marked after that savepoint. The savepoint to which you roll back. however, is not erased. For example, if you mark five savepoints, then roll back to the third, only the fourth and fifth are erased.
If you give two savepoints the same name, the earlier savepoint is erased. A COMMIT or ROLLBACK statement erases all savepoints.
Page 356 : sqlca.sqlerrd[ 2]
Page 436 : sqlca.sqlerrd[ 2]
For INSERT, UPDATE, Base DELETE, and SELECT INTO statements, sqlca.sqlerrd[2] records the number of rows processed. For FETCH statements. it records the cumulative sum of rows processed. (testing) |
Oracle CGNDB ProC Development Environment Gcc you tried? |
Oracle CGNDB ProC Development Environment No
This is the finding from the Internet
Inside are the original source
If you are found to be unsuccessful, then what can be put down in writing
And write your results |
Oracle CGNDB ProC Development Environment If we use Windows pro*c another visit to the Oracle server, how to install the Windows environment variables |
Oracle CGNDB ProC Development Environment If Oracle clients in the deployment of a good network, can directly access the Oracle server. And direct its operations. |
| |