diff -rc --ignore-space-change old/Makefile new/Makefile *** old/Makefile Fri Jul 21 02:18:24 1995 --- new/Makefile Thu Jul 20 07:22:13 1995 *************** *** 0 **** --- 1,36 ---- + # + # Makefile for CommonBase++ classes + # + # server specific files must be linked to the + # default names (sqlsys.h, sqlsys.C, sqlsvr.C) + # + CC = gcc + + CCflags= -g -I. + + all:: libCB++.a + + sqlsys.o: sqlsys.C sqlsys.h + $(CC) -c $(CCflags) sqlsys.C + + sqlmisc.o: sqlmisc.C sqlmisc.h cbdefs.h + $(CC) -c $(CCflags) sqlmisc.C + + sqlsvr.o: sqlsvr.C sqlsvr.h sqlmisc.h cbdefs.h + $(CC) -c $(CCflags) sqlsvr.C + + mgrmisc.o: mgrmisc.C mgrmisc.h parser.h sqlmisc.h cbdefs.h + $(CC) -c $(CCflags) mgrmisc.C + + sqlmgr.o: sqlmgr.C sqlmgr.h mgrmisc.h parser.h sqlmisc.h cbdefs.h + $(CC) -c $(CCflags) sqlmgr.C + + + libCB++.a: sqlsys.o sqlmisc.o mgrmisc.o sqlsvr.o sqlmgr.o + ar ruv libCB++.a sqlsys.o sqlmisc.o mgrmisc.o sqlsvr.o sqlmgr.o + ranlib libCB++.a + + + clean: + rm -f libCB++.a *.o + diff -rc --ignore-space-change old/cbdefs.h new/cbdefs.h *** old/cbdefs.h Fri Jul 21 02:18:42 1995 --- new/cbdefs.h Fri Jul 21 02:18:53 1995 *************** *** 12,17 **** --- 12,23 ---- #define NULL 0L #endif + #if __GNUG__ >= 2 + #define BOOL_DEFINED + #define TRUE true + #define FALSE false + #endif + #ifndef BOOL_DEFINED typedef enum bool { TRUE = 1, FALSE = 0}; diff -rc --ignore-space-change old/mgrmisc.C new/mgrmisc.C *** old/mgrmisc.C Fri Jul 21 02:18:42 1995 --- new/mgrmisc.C Fri Jul 21 02:18:53 1995 *************** *** 17,23 **** #include extern "C" { ! int strcasecmp(char *, char *); } #ifndef SYS_SUBSTVAR --- 17,23 ---- #include extern "C" { ! int strcasecmp(const char *, const char *); } #ifndef SYS_SUBSTVAR *************** *** 31,36 **** --- 31,37 ---- outputs = new BindDescr; all = new BindDescr; tokndx = 0; + indP = FALSE; } char * *************** *** 80,86 **** if (tokbuf[0] == ':') { tmpType = getType(); tmpLength = getLength(); ! bi = new BindInfo(++(*curCounter), (void *) NULL, tmpType, tmpLength); curDescr->addInfo((SqlInfo *) bi); all->addInfo((SqlInfo *) bi); if (curDescr == inputs) { --- 81,91 ---- if (tokbuf[0] == ':') { tmpType = getType(); tmpLength = getLength(); ! bi = new BindInfo(++(*curCounter), (void *) NULL, ! tmpType, tmpLength, 0, indP); ! indP = FALSE; // reset to FALSE after BindInfo ! knows about it ! curDescr->addInfo((SqlInfo *) bi); all->addInfo((SqlInfo *) bi); if (curDescr == inputs) { *************** *** 101,107 **** } out << tokbuf << " "; } ! out.put(0); return (strcpy(new char[strlen(out.str()) + 1] /* outbuff */ , out.str())); } --- 106,112 ---- } out << tokbuf << " "; } ! out.put('\0'); return (strcpy(new char[strlen(out.str()) + 1] /* outbuff */ , out.str())); } *************** *** 112,124 **** for (int i = 1; isalpha(tokbuf[i]); i++); - switch (tokbuf[i]) { case '[': // length following... tokndx = i + 1; break; case ',': case ' ': case '\0': --- 117,134 ---- for (int i = 1; isalpha(tokbuf[i]); i++); switch (tokbuf[i]) { case '[': // length following... tokndx = i + 1; break; + case '?': // uses indicator variable... + + indP = TRUE; + tokndx = 0; + break; + case ',': case ' ': case '\0': *************** *** 156,167 **** for (int i = tokndx; isdigit(tokbuf[i]); i++); - chk = tokbuf[i + 1]; ! if (tokbuf[i] != ']' || !(chk == ',' || chk == ' ' || chk == '\0')) { cb_error("class SqlParser: syntax error in SQL statement"); return (0); } for (--i; i >= tokndx; i--) { len += ((tokbuf[i] - '0') * dec); dec *= 10; --- 166,178 ---- for (int i = tokndx; isdigit(tokbuf[i]); i++); chk = tokbuf[i + 1]; ! if (tokbuf[i] != ']' || !(chk == '?' || chk == ',' || chk == ' ' || chk == '\0')) { cb_error("class SqlParser: syntax error in SQL statement"); return (0); } + if (chk == '?') + indP = TRUE; for (--i; i >= tokndx; i--) { len += ((tokbuf[i] - '0') * dec); dec *= 10; *************** *** 194,199 **** --- 205,214 ---- pc[CB_PLONG] = P_PLONG; pc[CB_PFLOAT] = P_PFLOAT; pc[CB_PDOUBLE] = P_PDOUBLE; + + pc[CB_PDATE] = P_PDATE; + pc[CB_PROWID] = P_PROWID; + pc[CB_PRECNO] = P_PRECNO; pc[CB_PLSTRING] = P_PLSTRING; pc[CB_PLSTREAM] = P_PLSTREAM; diff -rc --ignore-space-change old/mgrmisc.h new/mgrmisc.h *** old/mgrmisc.h Fri Jul 21 02:18:42 1995 --- new/mgrmisc.h Fri Jul 21 02:18:53 1995 *************** *** 26,31 **** --- 26,32 ---- char tokbuf[CB_MAX_TOKENSIZE]; int tokndx; + bool indP; BindDescr *inputs; BindDescr *outputs; BindDescr *all; diff -rc --ignore-space-change old/parser.h new/parser.h *** old/parser.h Fri Jul 21 02:18:42 1995 --- new/parser.h Fri Jul 21 02:18:53 1995 *************** *** 19,24 **** --- 19,27 ---- #define P_PFLOAT "FLOAT" #define P_PDOUBLE "DOUBLE" + #define P_PDATE "DATE" + #define P_PROWID "ROWID" + #define P_PRECNO "RECNO" #define P_PLSTRING "LSTRING" #define P_PLSTREAM "LSTREAM" diff -rc --ignore-space-change old/servers/oracle/sqlsvr_o.C new/servers/oracle/sqlsvr_o.C *** old/servers/oracle/sqlsvr_o.C Fri Jul 21 02:18:43 1995 --- new/servers/oracle/sqlsvr_o.C Fri Jul 21 02:18:54 1995 *************** *** 200,213 **** (int) bi->length, (int) pdtype[bi->type], (int) bi->scale, ! (short *) 0, (char *) 0, -1, -1)) /* * { ostrstream vn; vn << ":" << bi->varIndex; * vn.put('\0'); if(ci->cstat = * obndrv(oracleCursors[ci->cndx], (char* )vn.str(), * (int ) -1, (char* ) bi->data, (int ) bi->length, * (int ) pdtype[bi->type], (int ) bi->scale, (short ! * *)0, (char *)0, -1, -1)) */ { --- 200,213 ---- (int) bi->length, (int) pdtype[bi->type], (int) bi->scale, ! (short *) bi->indicator, (char *) 0, -1, -1)) /* * { ostrstream vn; vn << ":" << bi->varIndex; * vn.put('\0'); if(ci->cstat = * obndrv(oracleCursors[ci->cndx], (char* )vn.str(), * (int ) -1, (char* ) bi->data, (int ) bi->length, * (int ) pdtype[bi->type], (int ) bi->scale, (short ! * *)bi->indicator, (char *)0, -1, -1)) */ { *************** *** 233,239 **** (int) bi->length, (int) pdtype[bi->type], (int) bi->scale, ! (short *) -1, (char *) -1, -1, -1, (short *) &(bi->retLength), (short *) &(bi->retCode))) { --- 233,239 ---- (int) bi->length, (int) pdtype[bi->type], (int) bi->scale, ! (short *) bi->indicator, (char *) -1, -1, -1, (short *) &(bi->retLength), (short *) &(bi->retCode))) { diff -rc --ignore-space-change old/servers/oracle/sqlsys_o.C new/servers/oracle/sqlsys_o.C *** old/servers/oracle/sqlsys_o.C Fri Jul 21 02:18:43 1995 --- new/servers/oracle/sqlsys_o.C Fri Jul 21 02:18:54 1995 *************** *** 46,51 **** --- 46,55 ---- pdlen[CB_PFLOAT] = sizeof(float); pdlen[CB_PDOUBLE] = sizeof(double); + pdlen[CB_PDATE] = 7; + pdlen[CB_PROWID] = 18; + pdlen[CB_PRECNO] = 16; + pdlen[CB_PLSTRING] = 0; pdlen[CB_PLSTREAM] = 0; *************** *** 59,65 **** pdtype[CB_PLONG] = ORA_PLONG; pdtype[CB_PFLOAT] = ORA_PFLOAT; pdtype[CB_PDOUBLE] = ORA_PDOUBLE; ! pdtype[CB_PLSTRING] = ORA_PLSTRING; pdtype[CB_PLSTREAM] = ORA_PLSTREAM; --- 63,71 ---- pdtype[CB_PLONG] = ORA_PLONG; pdtype[CB_PFLOAT] = ORA_PFLOAT; pdtype[CB_PDOUBLE] = ORA_PDOUBLE; ! pdtype[CB_PDATE] = ORA_PDATE; ! pdtype[CB_PROWID] = ORA_PROWID; ! pdtype[CB_PRECNO] = ORA_PRECNO; pdtype[CB_PLSTRING] = ORA_PLSTRING; pdtype[CB_PLSTREAM] = ORA_PLSTREAM; Only in new/servers/oracle: sqlsys_o.C~ diff -rc --ignore-space-change old/servers/oracle/sqlsys_o.h new/servers/oracle/sqlsys_o.h *** old/servers/oracle/sqlsys_o.h Fri Jul 21 02:18:43 1995 --- new/servers/oracle/sqlsys_o.h Fri Jul 21 02:18:54 1995 *************** *** 64,70 **** #define ORA_DEFOUTSZ 0 #define ORA_DEFCURSZ -1 ! #define ORA_MAX_SYSTYPES 15 /* all cb system types (SQLPDTM + 2) */ #define ORA_MAX_ERRTXTLEN 132/* max error text length */ #define ORA_MAX_COLNAMELEN 50 /* max column name length */ --- 64,70 ---- #define ORA_DEFOUTSZ 0 #define ORA_DEFCURSZ -1 ! #define ORA_MAX_SYSTYPES 17 /* all cb system types (SQLPDTM + 2) */ #define ORA_MAX_ERRTXTLEN 132/* max error text length */ #define ORA_MAX_COLNAMELEN 50 /* max column name length */ *************** *** 81,86 **** --- 81,91 ---- #define ORA_PFLOAT 4 /* float */ #define ORA_PDOUBLE 4 /* double */ + #define ORA_PROWID 1 /* 11 binary ROWID does not work -- why? */ + /* 18 ? bytes buffer */ + #define ORA_PRECNO 11 /* 13 or better 16 ? bytes buffer */ + #define ORA_PDATE 12 /* 7 or better 8 bytes buffer */ + #define ORA_PLSTRING 8 /* LONG string type */ #define ORA_PLSTREAM 8 /* LONG stream type */ *************** *** 88,93 **** extern int *pdtype; void init_sys_data(); - #endif --- 93,97 ---- Only in new/servers/oracle: sqlsys_o.h~ diff -rc --ignore-space-change old/sqlmgr.C new/sqlmgr.C *** old/sqlmgr.C Fri Jul 21 02:18:43 1995 --- new/sqlmgr.C Fri Jul 21 02:18:53 1995 *************** *** 17,25 **** #include #include #include ! ! SqlMgr::SqlMgr(char *uidstr) { if (!(uidstr && start(uidstr))) { curUID = NULL; --- 17,26 ---- #include #include #include + #include + #include ! SqlMgr::SqlMgr(const char *uidstr) { if (!(uidstr && start(uidstr))) { curUID = NULL; *************** *** 34,50 **** if (active == TRUE) svr->disconnect(allCursors->at(immHandle)); delete svr; } bool ! SqlMgr::start(char *uidstr) { ! curUID = uidstr; CursorInfo *ci; svr = new SqlSvr; active = FALSE; ! if ((ci = svr->connect(uidstr)) != (CursorInfo *) NULL) { immHandle = ci->cndx; active = TRUE; } else --- 35,55 ---- if (active == TRUE) svr->disconnect(allCursors->at(immHandle)); delete svr; + if (curUID != NULL) + free(curUID); } bool ! SqlMgr::start(const char *uidstr) { ! if (curUID != NULL) ! free(curUID); ! curUID = strdup(uidstr); CursorInfo *ci; svr = new SqlSvr; active = FALSE; ! if ((ci = svr->connect(curUID)) != (CursorInfo *) NULL) { immHandle = ci->cndx; active = TRUE; } else *************** *** 53,70 **** } SqlHandle ! SqlMgr::open(char *stmt,...) { SqlParser p; BindDescr *all; BindInfo *bi; CursorInfo *ci; ! char *sqlStmt; if (active == FALSE) return (0); ! sqlStmt = p.parse(stmt); all = p.getAll(); int i = 0; --- 58,76 ---- } SqlHandle ! SqlMgr::open(const char *stmt,...) { SqlParser p; BindDescr *all; BindInfo *bi; CursorInfo *ci; ! char *sqlStmt, *stmtb; if (active == FALSE) return (0); ! stmtb = strdup(stmt); ! sqlStmt = p.parse(stmtb); all = p.getAll(); int i = 0; *************** *** 73,78 **** --- 79,88 ---- while (bi = all->next(i)) { void *aPtr = va_arg(ap, void *); bi->setBuffer(aPtr); + if (bi->indpFollows()) { + short *iPtr = va_arg(ap, short *); + bi->setIndp(iPtr); + } } va_end(ap); *************** *** 83,96 **** --- 93,111 ---- if ((ci = svr->connect(curUID)) == (CursorInfo *) NULL) { cb_error("class SqlManager: connect failed"); + free(stmtb); return (0); } if (svr->compile(ci, sqlStmt) == FALSE) { cb_error("class SqlManager: compile failed"); + free(stmtb); return (0); } if (bind(ci, p.getInputs(), p.getOutputs()) == FALSE) cb_error("class SqlManager: operation may cause uncorrect results"); + + free(stmtb); + return (ci->cndx); } *************** *** 132,149 **** } bool ! SqlMgr::perform(char *stmt,...) { SqlParser p; BindDescr *all; BindInfo *bi; ! char *sqlStmt; CursorInfo *ci = allCursors->at(immHandle); if (active == FALSE) return (FALSE); ! sqlStmt = p.parse(stmt); all = p.getAll(); int i = 0; --- 147,166 ---- } bool ! SqlMgr::perform(const char *stmt,...) { SqlParser p; BindDescr *all; BindInfo *bi; ! char *sqlStmt, *stmtb; CursorInfo *ci = allCursors->at(immHandle); if (active == FALSE) return (FALSE); ! ! stmtb = strdup(stmt); ! sqlStmt = p.parse(stmtb); all = p.getAll(); int i = 0; *************** *** 152,157 **** --- 169,178 ---- while (bi = all->next(i)) { void *aPtr = va_arg(ap, void *); bi->setBuffer(aPtr); + if (bi->indpFollows()) { + short *iPtr = va_arg(ap, short *); + bi->setIndp(iPtr); + } } va_end(ap); *************** *** 162,189 **** if (svr->compile(ci, sqlStmt) == FALSE) { cb_error("class SqlManager: perform - compile failed"); return (FALSE); } if (bind(ci, p.getInputs(), p.getOutputs()) == FALSE) { cb_error("class SqlManager: operation may cause uncorrect results"); return (FALSE); } if (execute(immHandle) == FALSE) { cb_error("class SqlManager: perform - execute failed"); return (FALSE); } if (outdescrs[immHandle] != (BindDescr *) NULL) { delete outdescrs[immHandle]; outdescrs[immHandle] = (BindDescr *) NULL; return (fetch(immHandle)); } return (TRUE); } bool ! SqlMgr::changeUser(char *newUID) { ! curUID = newUID; if (suspend(TRUE) == TRUE) return (suspend(FALSE)); return (FALSE); --- 183,217 ---- if (svr->compile(ci, sqlStmt) == FALSE) { cb_error("class SqlManager: perform - compile failed"); + free(stmtb); return (FALSE); } if (bind(ci, p.getInputs(), p.getOutputs()) == FALSE) { cb_error("class SqlManager: operation may cause uncorrect results"); + free(stmtb); return (FALSE); } if (execute(immHandle) == FALSE) { cb_error("class SqlManager: perform - execute failed"); + free(stmtb); return (FALSE); } if (outdescrs[immHandle] != (BindDescr *) NULL) { delete outdescrs[immHandle]; outdescrs[immHandle] = (BindDescr *) NULL; + free(stmtb); return (fetch(immHandle)); } + free(stmtb); return (TRUE); } bool ! SqlMgr::changeUser(const char *newUID) { ! if (curUID != NULL) ! free(curUID); ! curUID = strdup(newUID); if (suspend(TRUE) == TRUE) return (suspend(FALSE)); return (FALSE); diff -rc --ignore-space-change old/sqlmgr.h new/sqlmgr.h *** old/sqlmgr.h Fri Jul 21 02:18:43 1995 --- new/sqlmgr.h Fri Jul 21 02:18:53 1995 *************** *** 35,47 **** bool active; public: ! SqlMgr(char *= NULL); // initialize (and start) ~SqlMgr(); // terminate ! bool start(char *); // start with given UID ! SqlHandle open(char *,...); // open SQL access (compile and bind) bool execute(SqlHandle); // execute statement --- 35,48 ---- bool active; public: ! SqlMgr(const char *= NULL); // initialize (and ! start) ~SqlMgr(); // terminate ! bool start(const char *); // start with given UID ! SqlHandle open(const char *,...); // open SQL access (compile and bind) bool execute(SqlHandle); // execute statement *************** *** 51,60 **** bool close(SqlHandle &); // end SQL access ! bool perform(char *,...); // perform one-shot SQL access ! bool changeUser(char *); // set UID for further connects bool suspend(bool); // disconnect all / reconnect --- 52,61 ---- bool close(SqlHandle &); // end SQL access ! bool perform(const char *,...); // perform one-shot SQL access ! bool changeUser(const char *); // set UID for further connects bool suspend(bool); // disconnect all / reconnect diff -rc --ignore-space-change old/sqlmisc.C new/sqlmisc.C *** old/sqlmisc.C Fri Jul 21 02:18:43 1995 --- new/sqlmisc.C Fri Jul 21 02:18:54 1995 *************** *** 75,85 **** } ! BindInfo::BindInfo(short i, void *d, short t, int l, int s) { varIndex = i; data = d; type = t; if (!(length = l)) { if (t > CB_MAX_SYSTYPES) cb_error("class BindInfo: invalid program data type"); --- 75,90 ---- } ! BindInfo::BindInfo(short i, void *d, short t, int l, int s, ! bool indP, short *ind) { varIndex = i; data = d; type = t; + if ((indicator = ind) == NULL) + indp_follows = indP; + else + indp_follows = FALSE; if (!(length = l)) { if (t > CB_MAX_SYSTYPES) cb_error("class BindInfo: invalid program data type"); *************** *** 101,113 **** } void ! BindInfo::setBuffer(void *aPtr) { data = aPtr; ! if (type == CB_PSTR || type == CB_PLSTRING) length = strlen((char *) data); } CursorInfo::CursorInfo() { --- 106,124 ---- } void ! BindInfo::setBuffer(void *aPtr, short *iPtr) { + indicator = iPtr; data = aPtr; ! if (length == 0 && (type == CB_PSTR || type == CB_PLSTRING)) length = strlen((char *) data); } + void + BindInfo::setIndp(short *iPtr) + { + indicator = iPtr; + } CursorInfo::CursorInfo() { diff -rc --ignore-space-change old/sqlmisc.h new/sqlmisc.h *** old/sqlmisc.h Fri Jul 21 02:18:43 1995 --- new/sqlmisc.h Fri Jul 21 02:18:54 1995 *************** *** 52,66 **** short retLength; short retCode; void *sysData; - BindInfo(short, void *, short, int = 0, int = 0); - void setBuffer(void *); public: short dataType() { ! return (type); } void *dataPtr() { ! return (data); } void dump() { --- 52,80 ---- short retLength; short retCode; void *sysData; + short *indicator; + bool indp_follows; + + BindInfo(short, void *, short, int = 0, int = 0, + bool = FALSE, short *= NULL); + void setBuffer(void *, short *= NULL); + void setIndp(short *); + void requireIndBuf() { + indp_follows = TRUE; + } public: short dataType() { ! return type; } void *dataPtr() { ! return data; ! } ! short *indPtr() { ! return indicator; ! } ! bool indpFollows() { ! return indp_follows; } void dump() { diff -rc --ignore-space-change old/sqlsvr.C new/sqlsvr.C *** old/sqlsvr.C Fri Jul 21 02:18:43 1995 --- new/sqlsvr.C Fri Jul 21 02:18:54 1995 *************** *** 200,213 **** (int) bi->length, (int) pdtype[bi->type], (int) bi->scale, ! (short *) 0, (char *) 0, -1, -1)) /* * { ostrstream vn; vn << ":" << bi->varIndex; * vn.put('\0'); if(ci->cstat = * obndrv(oracleCursors[ci->cndx], (char* )vn.str(), * (int ) -1, (char* ) bi->data, (int ) bi->length, * (int ) pdtype[bi->type], (int ) bi->scale, (short ! * *)0, (char *)0, -1, -1)) */ { --- 200,213 ---- (int) bi->length, (int) pdtype[bi->type], (int) bi->scale, ! (short *) bi->indicator, (char *) 0, -1, -1)) /* * { ostrstream vn; vn << ":" << bi->varIndex; * vn.put('\0'); if(ci->cstat = * obndrv(oracleCursors[ci->cndx], (char* )vn.str(), * (int ) -1, (char* ) bi->data, (int ) bi->length, * (int ) pdtype[bi->type], (int ) bi->scale, (short ! * *)bi->indicator, (char *)0, -1, -1)) */ { *************** *** 233,239 **** (int) bi->length, (int) pdtype[bi->type], (int) bi->scale, ! (short *) -1, (char *) -1, -1, -1, (short *) &(bi->retLength), (short *) &(bi->retCode))) { --- 233,239 ---- (int) bi->length, (int) pdtype[bi->type], (int) bi->scale, ! (short *) bi->indicator, (char *) -1, -1, -1, (short *) &(bi->retLength), (short *) &(bi->retCode))) { diff -rc --ignore-space-change old/sqlsys.C new/sqlsys.C *** old/sqlsys.C Fri Jul 21 02:18:43 1995 --- new/sqlsys.C Fri Jul 21 02:18:54 1995 *************** *** 46,51 **** --- 46,55 ---- pdlen[CB_PFLOAT] = sizeof(float); pdlen[CB_PDOUBLE] = sizeof(double); + pdlen[CB_PDATE] = 7; + pdlen[CB_PROWID] = 18; + pdlen[CB_PRECNO] = 16; + pdlen[CB_PLSTRING] = 0; pdlen[CB_PLSTREAM] = 0; *************** *** 59,65 **** pdtype[CB_PLONG] = ORA_PLONG; pdtype[CB_PFLOAT] = ORA_PFLOAT; pdtype[CB_PDOUBLE] = ORA_PDOUBLE; ! pdtype[CB_PLSTRING] = ORA_PLSTRING; pdtype[CB_PLSTREAM] = ORA_PLSTREAM; --- 63,71 ---- pdtype[CB_PLONG] = ORA_PLONG; pdtype[CB_PFLOAT] = ORA_PFLOAT; pdtype[CB_PDOUBLE] = ORA_PDOUBLE; ! pdtype[CB_PDATE] = ORA_PDATE; ! pdtype[CB_PROWID] = ORA_PROWID; ! pdtype[CB_PRECNO] = ORA_PRECNO; pdtype[CB_PLSTRING] = ORA_PLSTRING; pdtype[CB_PLSTREAM] = ORA_PLSTREAM; diff -rc --ignore-space-change old/sqlsys.h new/sqlsys.h *** old/sqlsys.h Fri Jul 21 02:18:43 1995 --- new/sqlsys.h Fri Jul 21 02:18:54 1995 *************** *** 64,70 **** #define ORA_DEFOUTSZ 0 #define ORA_DEFCURSZ -1 ! #define ORA_MAX_SYSTYPES 15 /* all cb system types (SQLPDTM + 2) */ #define ORA_MAX_ERRTXTLEN 132/* max error text length */ #define ORA_MAX_COLNAMELEN 50 /* max column name length */ --- 64,70 ---- #define ORA_DEFOUTSZ 0 #define ORA_DEFCURSZ -1 ! #define ORA_MAX_SYSTYPES 17 /* all cb system types (SQLPDTM + 2) */ #define ORA_MAX_ERRTXTLEN 132/* max error text length */ #define ORA_MAX_COLNAMELEN 50 /* max column name length */ *************** *** 81,86 **** --- 81,91 ---- #define ORA_PFLOAT 4 /* float */ #define ORA_PDOUBLE 4 /* double */ + #define ORA_PROWID 1 /* 11 binary ROWID does not work -- why? */ + /* 18 ? bytes buffer */ + #define ORA_PRECNO 11 /* 13 or better 16 ? bytes buffer */ + #define ORA_PDATE 12 /* 7 or better 8 bytes buffer */ + #define ORA_PLSTRING 8 /* LONG string type */ #define ORA_PLSTREAM 8 /* LONG stream type */ *************** *** 88,93 **** extern int *pdtype; void init_sys_data(); - #endif --- 93,97 ---- diff -rc --ignore-space-change old/sqlusr.h new/sqlusr.h *** old/sqlusr.h Fri Jul 21 02:18:43 1995 --- new/sqlusr.h Fri Jul 21 02:18:54 1995 *************** *** 42,53 **** #define CB_PFLOAT 11 /* float */ #define CB_PDOUBLE 12 /* double */ #define CB_PLSTRING 14 /* LONG string type */ #define CB_PLSTREAM 15 /* LONG stream type */ #define CB_PRECNO 16 /* record number */ ! #define _CB_MAX_PTYPES 16; /* * Program Error Codes --- 42,56 ---- #define CB_PFLOAT 11 /* float */ #define CB_PDOUBLE 12 /* double */ + #define CB_PDATE 13 /* date */ + #define CB_PLSTRING 14 /* LONG string type */ #define CB_PLSTREAM 15 /* LONG stream type */ #define CB_PRECNO 16 /* record number */ + #define CB_PROWID 17 /* or rowid which is synonym */ ! #define _CB_MAX_PTYPES 17; /* * Program Error Codes *************** *** 93,97 **** --- 96,110 ---- #define CB_ERR_UNKNOWN 999 /* vendor specific error */ #define _CB_MAX_ERRCOUNT 27 + + /* + * Indicator Evaluation Macros ORACLE-Specific! + * + */ + + #define I_NON_NULL ((short) 0) + #define I_NULL ((short)-1) + #define I_IS_TRUNCATED(i) ((i) > ((short)0) ? ((short)i) : I_NON_NULL) + #define I_IS_NULL(i) ((i) == I_NULL) #endif