📄 database.c
字号:
/* Result Sets Interface */
#ifndef SQL_CRSR
# define SQL_CRSR
struct sql_cursor
{
unsigned int curocn;
void *ptr1;
void *ptr2;
unsigned long magic;
};
typedef struct sql_cursor sql_cursor;
typedef struct sql_cursor SQL_CURSOR;
#endif /* SQL_CRSR */
/* Thread Safety */
typedef void * sql_context;
typedef void * SQL_CONTEXT;
/* Object support */
struct sqltvn
{
unsigned char *tvnvsn;
unsigned short tvnvsnl;
unsigned char *tvnnm;
unsigned short tvnnml;
unsigned char *tvnsnm;
unsigned short tvnsnml;
};
typedef struct sqltvn sqltvn;
struct sqladts
{
unsigned int adtvsn;
unsigned short adtmode;
unsigned short adtnum;
sqltvn adttvn[1];
};
typedef struct sqladts sqladts;
static struct sqladts sqladt = {
1,1,0,
};
/* Binding to PL/SQL Records */
struct sqltdss
{
unsigned int tdsvsn;
unsigned short tdsnum;
unsigned char *tdsval[1];
};
typedef struct sqltdss sqltdss;
static struct sqltdss sqltds =
{
1,
0,
};
/* File name & Package Name */
struct sqlcxp
{
unsigned short fillen;
char filnam[12];
};
static struct sqlcxp sqlfpn =
{
11,
"Database.pc"
};
static unsigned long sqlctx = 141331;
static struct sqlexd {
unsigned int sqlvsn;
unsigned int arrsiz;
unsigned int iters;
unsigned int offset;
unsigned short selerr;
unsigned short sqlety;
unsigned int occurs;
short *cud;
unsigned char *sqlest;
char *stmt;
sqladts *sqladtp;
sqltdss *sqltdsp;
void **sqphsv;
unsigned int *sqphsl;
int *sqphss;
void **sqpind;
int *sqpins;
unsigned int *sqparm;
unsigned int **sqparc;
unsigned short *sqpadto;
unsigned short *sqptdso;
void *sqhstv[4];
unsigned int sqhstl[4];
int sqhsts[4];
void *sqindv[4];
int sqinds[4];
unsigned int sqharm[4];
unsigned int *sqharc[4];
unsigned short sqadto[4];
unsigned short sqtdso[4];
} sqlstm = {10,4};
/* SQLLIB Prototypes */
extern sqlcxt (/*_ void **, unsigned long *,
struct sqlexd *, struct sqlcxp * _*/);
extern sqlcx2t(/*_ void **, unsigned long *,
struct sqlexd *, struct sqlcxp * _*/);
extern sqlbuft(/*_ void **, char * _*/);
extern sqlgs2t(/*_ void **, char * _*/);
extern sqlorat(/*_ void **, unsigned long *, void * _*/);
/* Forms Interface */
static int IAPSUCC = 0;
static int IAPFAIL = 1403;
static int IAPFTL = 535;
extern void sqliem(/*_ char *, int * _*/);
typedef struct { unsigned short len; unsigned char arr[1]; } VARCHAR;
typedef struct { unsigned short len; unsigned char arr[1]; } varchar;
/* CUD (Compilation Unit Data) Array */
static short sqlcud0[] =
{10,4130,0,0,0,
5,0,0,1,0,0,27,17,0,0,4,4,0,1,0,1,97,0,0,1,97,0,0,1,10,0,0,1,10,0,0,
36,0,0,2,0,0,32,24,0,0,0,0,0,1,0,
51,0,0,3,86,0,4,43,0,0,4,1,0,1,0,2,5,0,0,2,5,0,0,2,5,0,0,1,5,0,0,
82,0,0,4,86,0,4,51,0,0,4,1,0,1,0,2,5,0,0,2,5,0,0,2,5,0,0,1,5,0,0,
113,0,0,5,70,0,4,68,0,0,1,0,0,1,0,2,5,0,0,
132,0,0,6,70,0,4,76,0,0,1,0,0,1,0,2,5,0,0,
};
/* EXEC SQL include "g_chrvar.h";
*/
typedef char Char_2[2];
typedef char Char_3[3];
typedef char Char_4[4];
typedef char Char_5[5];
typedef char Char_6[6];
typedef char Char_7[7];
typedef char Char_8[8];
typedef char Char_9[9];
typedef char Char_10[10];
typedef char Char_11[11];
typedef char Char_12[12];
typedef char Char_13[13];
typedef char Char_14[14];
typedef char Char_15[15];
typedef char Char_16[16];
typedef char Char_17[17];
typedef char Char_18[18];
typedef char Char_19[19];
typedef char Char_20[20];
typedef char Char_21[21];
typedef char Char_22[22];
typedef char Char_25[25];
typedef char Char_26[26];
typedef char Char_31[31];
typedef char Char_41[41];
typedef char Char_50[50];
typedef char Char_51[51];
typedef char Char_61[61];
typedef char Char_81[81];
typedef char Char_101[101];
typedef char Char_100[100];
typedef char Char_161[161];
typedef char Char_1024[1024];
typedef char Char_4096[4096];
typedef char Char_5001[5001];
/* EXEC SQL BEGIN DECLARE SECTION; */
/* EXEC SQL TYPE Char_2 IS STRING(2); */
/* EXEC SQL TYPE Char_3 IS STRING(3); */
/* EXEC SQL TYPE Char_4 IS STRING(4); */
/* EXEC SQL TYPE Char_5 IS STRING(5); */
/* EXEC SQL TYPE Char_6 IS STRING(6); */
/* EXEC SQL TYPE Char_7 IS STRING(7); */
/* EXEC SQL TYPE Char_8 IS STRING(8); */
/* EXEC SQL TYPE Char_9 IS STRING(9); */
/* EXEC SQL TYPE Char_10 IS STRING(10); */
/* EXEC SQL TYPE Char_11 IS STRING(11); */
/* EXEC SQL TYPE Char_12 IS STRING(12); */
/* EXEC SQL TYPE Char_13 IS STRING(13); */
/* EXEC SQL TYPE Char_14 IS STRING(14); */
/* EXEC SQL TYPE Char_15 IS STRING(15); */
/* EXEC SQL TYPE Char_16 IS STRING(16); */
/* EXEC SQL TYPE Char_17 IS STRING(17); */
/* EXEC SQL TYPE Char_18 IS STRING(18); */
/* EXEC SQL TYPE Char_19 IS STRING(19); */
/* EXEC SQL TYPE Char_20 IS STRING(20); */
/* EXEC SQL TYPE Char_21 IS STRING(21); */
/* EXEC SQL TYPE Char_22 IS STRING(22); */
/* EXEC SQL TYPE Char_25 IS STRING(25); */
/* EXEC SQL TYPE Char_26 IS STRING(26); */
/* EXEC SQL TYPE Char_31 IS STRING(31); */
/* EXEC SQL TYPE Char_41 IS STRING(41); */
/* EXEC SQL TYPE Char_50 IS STRING(50); */
/* EXEC SQL TYPE Char_51 IS STRING(51); */
/* EXEC SQL TYPE Char_61 IS STRING(61); */
/* EXEC SQL TYPE Char_81 IS STRING(81); */
/* EXEC SQL TYPE Char_101 IS STRING(101); */
/* EXEC SQL TYPE Char_100 IS STRING(100); */
/* EXEC SQL TYPE Char_161 IS STRING(161); */
/* EXEC SQL TYPE Char_1024 IS STRING(1024); */
/* EXEC SQL TYPE Char_4096 IS STRING(4096); */
/* EXEC SQL TYPE Char_5001 IS STRING(5001); */
/* EXEC SQL END DECLARE SECTION; */
/* EXEC SQL WHENEVER NOTFOUND CONTINUE; */
/* EXEC SQL WHENEVER SQLERROR CONTINUE; */
/* EXEC SQL INCLUDE SQLCA;
*/
/*
* $Header: sqlca.h,v 1.3 1994/12/12 19:27:27 jbasu Exp $ sqlca.h
*/
/* Copyright (c) 1985,1986, 1998 by Oracle Corporation. */
/*
NAME
SQLCA : SQL Communications Area.
FUNCTION
Contains no code. Oracle fills in the SQLCA with status info
during the execution of a SQL stmt.
NOTES
**************************************************************
*** ***
*** This file is SOSD. Porters must change the data types ***
*** appropriately on their platform. See notes/pcport.doc ***
*** for more information. ***
*** ***
**************************************************************
If the symbol SQLCA_STORAGE_CLASS is defined, then the SQLCA
will be defined to have this storage class. For example:
#define SQLCA_STORAGE_CLASS extern
will define the SQLCA as an extern.
If the symbol SQLCA_INIT is defined, then the SQLCA will be
statically initialized. Although this is not necessary in order
to use the SQLCA, it is a good pgming practice not to have
unitialized variables. However, some C compilers/OS's don't
allow automatic variables to be init'd in this manner. Therefore,
if you are INCLUDE'ing the SQLCA in a place where it would be
an automatic AND your C compiler/OS doesn't allow this style
of initialization, then SQLCA_INIT should be left undefined --
all others can define SQLCA_INIT if they wish.
If the symbol SQLCA_NONE is defined, then the SQLCA variable will
not be defined at all. The symbol SQLCA_NONE should not be defined
in source modules that have embedded SQL. However, source modules
that have no embedded SQL, but need to manipulate a sqlca struct
passed in as a parameter, can set the SQLCA_NONE symbol to avoid
creation of an extraneous sqlca variable.
MODIFIED
lvbcheng 07/31/98 - long to int
jbasu 12/12/94 - Bug 217878: note this is an SOSD file
losborne 08/11/92 - No sqlca var if SQLCA_NONE macro set
Clare 12/06/84 - Ch SQLCA to not be an extern.
Clare 10/21/85 - Add initialization.
Bradbury 01/05/86 - Only initialize when SQLCA_INIT set
Clare 06/12/86 - Add SQLCA_STORAGE_CLASS option.
*/
#ifndef SQLCA
#define SQLCA 1
struct sqlca
{
/* ub1 */ char sqlcaid[8];
/* b4 */ int sqlabc;
/* b4 */ int sqlcode;
struct
{
/* ub2 */ unsigned short sqlerrml;
/* ub1 */ char sqlerrmc[70];
} sqlerrm;
/* ub1 */ char sqlerrp[8];
/* b4 */ int sqlerrd[6];
/* ub1 */ char sqlwarn[8];
/* ub1 */ char sqlext[8];
};
#ifndef SQLCA_NONE
#ifdef SQLCA_STORAGE_CLASS
SQLCA_STORAGE_CLASS struct sqlca sqlca
#else
struct sqlca sqlca
#endif
#ifdef SQLCA_INIT
= {
{'S', 'Q', 'L', 'C', 'A', ' ', ' ', ' '},
sizeof(struct sqlca),
0,
{ 0, {0}},
{'N', 'O', 'T', ' ', 'S', 'E', 'T', ' '},
{0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -