/****************************************************************************/ // SQLUSR.H - 25 10 1990 /****************************************************************************/ /* */ /* Copyright (c) 1989-1993 Bernhard Strassl */ /* Institute for Applied Computer Science and Information Systems */ /* University of Vienna, Austria */ /* */ /* See file COPYRIGHT in this directory for details. If this file is */ /* missing please mail to bernhard@ani.univie.ac.at */ /****************************************************************************/ /* server-independend #defines and declarations needed by the user (all SQL Servers) */ #ifndef SQLUSR #define SQLUSR typedef int SqlHandle; typedef void (*CbErrorHandler )(char*, int); /* Program data types */ #define CB_PBUFFER 1 /* char* or void* buffer */ #define CB_PSTR 2 /* char* (\0 terminated) */ #define CB_PUCHAR 3 /* unsigned char */ #define CB_PCHAR 4 /* char */ #define CB_PUSHORT 5 /* unsigned short */ #define CB_PSHORT 6 /* short */ #define CB_PUINT 7 /* unsigned int */ #define CB_PINT 8 /* int */ #define CB_PULONG 9 /* unsigned long */ #define CB_PLONG 10 /* long */ #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 */ #define CB_ERR_NONE 0 /* no error condition */ #define CB_ERR_NOSVR 1 /* no database server active */ #define CB_ERR_UIDOVFL 2 /* UID buffer overflow */ #define CB_ERR_INBOVFL 3 /* SQL input buffer overflow */ #define CB_ERR_OUTBOVFL 4 /* SQL output buffer overflow */ #define CB_ERR_CRSBOVFL 5 /* cursor buffer overflow */ #define CB_ERR_SVRNO 6 /* invalid server number */ #define CB_ERR_DATABASE 7 /* invalid database name */ #define CB_ERR_USER 8 /* invalid user name */ #define CB_ERR_PASSWD 9 /* invalid password */ #define CB_ERR_DBOPEN 10 /* error opening database */ #define CB_ERR_VERSION 11 /* server / app version error */ #define CB_ERR_NODBA 12 /* dba privilege needed */ #define CB_ERR_NORSC 13 /* resource privilege needed */ #define CB_ERR_EOF 14 /* end of fetch */ #define CB_ERR_NOROW 15 /* no row found */ #define CB_ERR_NOROWC 16 /* no current row */ #define CB_ERR_UPDROW 17 /* row has been updated */ #define CB_ERR_UPDROWC 18 /* current row has been updated */ #define CB_ERR_NODATE 19 /* invalid date format (in SQL) */ #define CB_ERR_NONDATE 20 /* data is not a date */ #define CB_ERR_NONNUM 21 /* data is not numeric */ #define CB_ERR_RECNO 22 /* data is not a rowid */ #define CB_ERR_NOTBL 23 /* invalid table name (in SQL) */ #define CB_ERR_TBLEXIST 24 /* table existing error */ #define CB_ERR_TBLNCR 25 /* table not existing error */ #define CB_ERR_SYNNCR 26 /* synonym not existing */ #define CB_ERR_NULL 27 /* NULL values fetched */ #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