📄 sql.h
字号:
typedef ubyte1 SQLTNBV; /* number of bind variables */typedef ubyte2 SQLTNCU; /* number of cursors */typedef ubyte1 SQLTNML; /* number length */typedef ubyte1p SQLTNMP; /* number pointer */typedef ubyte2 SQLTNPG; /* number of pages */typedef ubyte4 SQLTLNPG; /* number of pages */typedef ubyte1 SQLTNSI; /* number of select items */typedef ubyte1 SQLTPCX; /* preserve context flag */typedef ubyte1 SQLTPDL; /* program data length */typedef ubyte1 SQLTPDT; /* program data type */typedef ubyte4 SQLTPGN; /* page number */typedef ubyte2 SQLTPNM; /* process number */typedef ubyte1 SQLTPRE; /* precision */typedef ubyte2 SQLTPTY; /* set/get parameter type */typedef ubyte1 SQLTRBF; /* roll back flag */typedef byte2 SQLTRCD; /* return codes */typedef ubyte1 SQLTRCF; /* recovery flag */typedef ubyte2 SQLTRFM; /* rollforward mode */typedef byte4 SQLTROW; /* number of rows */typedef ubyte1 SQLTSCA; /* scale */typedef ubyte1 SQLTSLC; /* select list column */typedef ubyte2 SQLTSTC; /* statistics counter */typedef ubyte2 SQLTSVH; /* server handle */typedef ubyte2 SQLTSVN; /* server number */typedef byte2 SQLTTIV; /* wait timeout value */typedef byte2 SQLTWNC; /* whence */typedef ubyte2 SQLTWSI; /* work size */typedef ubyte2 SQLTBIR; /* bulk insert error row number */typedef ubyte1p SQLTDIS; /* Describe info indicator */typedef byte4 SQLTXER; /* extended error # */typedef ubyte4 SQLTPID; /* client process id */typedef ubyte4 SQLTMOD; /* mode flag */typedef ubyte4 SQLTCON; /* connection handle *//* defines for isolation level string */#define SQLILRR "RR" /* Repeatable Read isolation */#define SQLILCS "CS" /* Cursor Stability isolation */#define SQLILRO "RO" /* Read-Only isolation */#define SQLILRL "RL" /* Release Locks isolation *//* defines for isolation level flags*/#define SQLFIRR 0x01 /* Repeatable Read isolation flag */#define SQLFICS 0x02 /* Cursor Stability isolation flag */#define SQLFIRO 0x04 /* Read-Only isolation flag */#define SQLFIRL 0x08 /* Release Locks isolation flag *//* defines for SQLROF rollforward mode parameter */#define SQLMEOL 1 /* rollforward to end of log */#define SQLMEOB 2 /* rollforward to end of backup */#define SQLMTIM 3 /* rollforward to specified time *//* defines for when to collect Describe information */#define SQLDELY 0 /* get Describe info after sqlcom */#define SQLDDLD 1 /* get Describe info after sqlexe */#define SQLDNVR 2 /* never get any Describe info *//* defines for SQLETX() and SQLTEM(): error text type parameters */#define SQLXMSG 1 /* retrieve error message text */#define SQLXREA 2 /* retrieve error message reason */#define SQLXREM 4 /* retrieve error message remedy *//* defines for extended directory open function */#define SQLANRM 0x00 /* normal - no restrictions */#define SQLARDO 0x01 /* read only */#define SQLAHDN 0x02 /* hidden file */#define SQLASYS 0x04 /* system file */#define SQLAVOL 0x08 /* volume label */#define SQLADIR 0x10 /* directory */#define SQLAARC 0x20 /* archive bit */#define SQLAFDL 0x100 /* files and directories */#define SQLAFIL 0x200 /* files only *//* defines for state of cursor */#define SQLCIDL 0 /* idle cursor */#define SQLCECM 1 /* executing compile */#define SQLCCCM 2 /* completed compile */#define SQLCEXE 3 /* executing command */#define SQLCCXE 4 /* completed command */#define SQLCEFT 5 /* executing fetch */#define SQLCCFT 6 /* completed fetch *//* SYSTEM DEFINED TYPEDEF'S -- FOR SYSTEM USE ONLY */typedef ubyte2 SQLTMSL; /* message length */typedef byte1 far* SQLTMSP; /* message pointer *//*DESCRIPTION This structure is used to receive system information from the backend. Structure elements must be arranged so that the structure layout is the same in packed or padded compilation modes. For now, this means longs in the front, ints in the middle, and chars at the end of the structure.*/struct sysdefx { SQLTPGN syslpt; /* log page threshold */ SQLTPGN syslpm; /* log page maximum */ ubyte4 syshep; /* heap size */ SQLTNPG sysncp; /* number of cache pages */ SQLTTIV systiv; /* wait timeout value in seconds */ ubyte1 sysiso[3]; /* isolation level */ ubyte1 sysjou; /* journal */ ubyte1 syslog; /* log */ ubyte1 sysrec; /* recovery */ ubyte1 systyp; /* system type */ };typedef struct sysdefx sysdef;typedef struct sysdefx SQLTSYS;#define SYSSIZ sizeof(sysdef)/*DESCRIPTION: This structure is used as a parameter to the SQLGDI function. After a a compile, all relevant information for a given Select column can be obtained in this structure. Note: Please note that, originally, gdichb was the first element of the gdidefx structure. It has been moved further down because a column heading can be greater than 31 bytes. A bug was reported complaining that the column heading was not being returned correctly since the maximum length of a column heading is 46. This can now be returned since the size of the buffer (gdichb) has been changed to 47. Also, the length field (gdichl) has also been moved down to go with the column heading buffer (gdichb). The original gdichb and gdichl fields have been renamed to gdifl1 and gdifl2.*/struct gdidefx { ubyte1 gdifl1[31]; /* filler reserved for future use */ ubyte1 gdifl2; /* filler reserved for future use */ ubyte1 gdilbb[31]; /* label buffer */ SQLTLBL gdilbl; /* label info length */ SQLTSLC gdicol; /* select column number */ SQLTDDT gdiddt; /* database data type */ SQLTDEDL gdiddl; /* database extended data length */ SQLTDDT gdiedt; /* external data type */ SQLTDEDL gdiedl; /* external extended data length */ SQLTPRE gdipre; /* decimal precision */ SQLTSCA gdisca; /* decimal scale */ byte2 gdinul; /* null indicator */ ubyte1 gdichb[47]; /* column heading buffer */ SQLTCHL gdichl; /* column heading length */ byte1 gdifil[2]; /* for future use */ };typedef struct gdidefx gdidef;typedef struct gdidefx SQLTGDI;typedef struct gdidefx* SQLTPGD;#define GDISIZ sizeof(gdidef)/*DESCRIPTION This structure is used when passing binary data to and from external functions. Since binary data can contains nulls as part of the data we cannot look for a string terminator. Hence this structure is used to provide a pointer to the binary data and the length of the data.*/struct binaryx { long binary_len; char* binary_ptr; };#ifndef _INC_FSTREAMtypedef struct binaryx binary;#endiftypedef struct binaryx BINARY;typedef struct binaryx *lpbinary;typedef struct binaryx *LPBINARY;#define BINARYSIZ sizeof(BINARY)#define BINARY_GET_LENGTH(x) (x.binary_len)#define BINARY_GET_BUFFER(x) (x.binary_ptr)#define BINARY_SET_LENGTH(x,y) (x.binary_len=y)#define BINARY_SET_BUFFER(x,y) (x.binary_ptr=y)/* The following datatypes are analogous to the SqlWindows datatypes NUMBER and DATETIME. They are used to pass the Sqlbase internal number and datatime datatypes to external functions*/struct datetimex { char datetime_len; char datetime_value[12]; };typedef struct datetimex datetime;#define DATETIMESIZ sizeof(datetime)#define DATETIME_IS_NULL(x) (x.datetime_len == 0)#define DATETIME_SET_NULL(x) (x.datetime_len = 0)struct numberx { char number_len; char number_value[12]; };typedef struct numberx number;#define NUMBERSIZ sizeof(number)#define NUMBER_IS_NULL(x) (x.number_len == 0)#define NUMBER_SET_NULL(x) (x.number_len = 0)/* system types */#define SYSTSGL 1 /* single user */#define SYSTMUL 2 /* multi-user */#define SYSTDB2 3 /* DB2 */#define SYSTDMO 4 /* demo */#define SYSTGWY 5 /* SQLNetwork Gateway */#define SYSTRTR 6 /* SQLNetwork Router */#define SYSTSHAS 7 /* SQLNetwork SQLHost App Services *//*------------------------------------------------------------------------- SQL API calling convention: For 32-bit systems, the calling convention used depends on the target platform: - For NetWare and Windows/NT, the __stdcall calling convention is used. If __stdcall is not supported by your compiler, then you will need to define it to be something equivalent to __stdcall. ------------------------------------------------------------------------- */# define SQLTAPI byte2 SBSTDCALL /* Use __stdcall */#ifndef SQL_PROTO#ifndef NLINT_ARGS /* argument checking enabled *//* SQL FUNCTION PROTOTYPES */SQLTAPI sqlarf(SQLTCUR cur , SQLTFNP fnp , SQLTFNL fnl , SQLTCHO cho );SQLTAPI sqlbbr(SQLTCUR cur , SQLTXER PTR errnum , SQLTDAP errbuf , SQLTDAL PTR buflen , SQLTBIR PTR errrow , SQLTRBF PTR rbf , SQLTBIR errseq );SQLTAPI sqlbdb(SQLTSVH shandle , SQLTDAP dbname , SQLTDAL dbnamel , SQLTFNP bkpdir , SQLTFNL bkpdirl , SQLTBOO local , SQLTBOO over );SQLTAPI sqlbef(SQLTCUR cur );SQLTAPI sqlber(SQLTCUR cur , SQLTRCD PTR rcd , SQLTBIR PTR errrow , SQLTRBF PTR rbf , SQLTBIR errseq );SQLTAPI sqlbkp(SQLTCUR cur , SQLTBOO defalt , SQLTBOO overwrt , SQLTFNP bkfname , SQLTFNL bkfnlen );SQLTAPI sqlbld(SQLTCUR cur , SQLTBNP bnp , SQLTBNL bnl );SQLTAPI sqlblf(SQLTSVH shandle , SQLTDAP dbname , SQLTDAL dbnamel , SQLTFNP bkpdir , SQLTFNL bkpdirl , SQLTBOO local , SQLTBOO over );SQLTAPI sqlblk(SQLTCUR cur , SQLTFLG blkflg );SQLTAPI sqlbln(SQLTCUR cur , SQLTBNN bnn );SQLTAPI sqlbna(SQLTCUR cur , SQLTBNP bnp , SQLTBNL bnl , SQLTDAP dap , SQLTDAL dal , SQLTSCA sca , SQLTPDT pdt , SQLTNUL nli );SQLTAPI sqlbnd(SQLTCUR cur , SQLTBNP bnp , SQLTBNL bnl , SQLTDAP dap , SQLTDAL dal , SQLTSCA sca , SQLTPDT pdt );SQLTAPI sqlbnn(SQLTCUR cur , SQLTBNN bnn , SQLTDAP dap , SQLTDAL dal , SQLTSCA sca , SQLTPDT pdt );SQLTAPI sqlbnu(SQLTCUR cur , SQLTBNN bnn , SQLTDAP dap , SQLTDAL dal , SQLTSCA sca , SQLTPDT pdt , SQLTNUL nli );SQLTAPI sqlbss(SQLTSVH shandle , SQLTDAP dbname , SQLTDAL dbnamel , SQLTFNP bkpdir , SQLTFNL bkpdirl , SQLTBOO local , SQLTBOO over );SQLTAPI sqlcan(SQLTCUR cur );SQLTAPI sqlcbv(SQLTCUR cur );SQLTAPI sqlcch(SQLTCON PTR hConp , SQLTDAP dbnamp , SQLTDAL dbnaml , SQLTMOD fType );SQLTAPI sqlcdr(SQLTSVH shandle, SQLTCUR cur );SQLTAPI sqlcex(SQLTCUR cur , SQLTDAP dap , SQLTDAL dal );SQLTAPI sqlclf(SQLTSVH cur , SQLTDAP logfile , SQLTFMD startflag);SQLTAPI sqlcmt(SQLTCUR cur );SQLTAPI sqlcnc(SQLTCUR PTR curp , SQLTDAP dbnamp , SQLTDAL dbnaml );SQLTAPI sqlcnr(SQLTCUR PTR curp , SQLTDAP dbnamp , SQLTDAL dbnaml );SQLTAPI sqlcom(SQLTCUR cur , SQLTDAP cmdp , SQLTDAL cmdl );SQLTAPI sqlcon(SQLTCUR PTR curp , SQLTDAP dbnamp , SQLTDAL dbnaml , SQLTWSI cursiz , SQLTNPG pages , SQLTRCF recovr , SQLTDAL outsize , SQLTDAL insize );SQLTAPI sqlcpy(SQLTCUR fcur , SQLTDAP selp , SQLTDAL sell , SQLTCUR tcur , SQLTDAP isrtp , SQLTDAL isrtl );SQLTAPI sqlcre(SQLTSVH shandle , SQLTDAP dbnamp , SQLTDAL dbnaml );SQLTAPI sqlcrf(SQLTSVH shandle , SQLTDAP dbname , SQLTDAL dbnamel );SQLTAPI sqlcrs(SQLTCUR cur , SQLTDAP rsp , SQLTDAL rsl );SQLTAPI sqlcsv(SQLTSVH PTR shandlep, SQLTDAP serverid, SQLTDAP password);SQLTAPI sqlcty(SQLTCUR cur , SQLTCTY PTR cty );SQLTAPI sqldbn(SQLTDAP serverid, SQLTDAP buffer , SQLTDAL length );SQLTAPI sqldch(SQLTCON hCon );SQLTAPI sqlded(SQLTSVH shandle , SQLTDAP dbnamp , SQLTDAL dbnaml );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -