Unit MSSQLLib

Classes

Functions

abort_xact -
build_xact_string -
close_commit -
commit_xact -
dbbind -
dbcancel -
dbcanquery -
dbclose -
dbcmd -
dbcollen -
dbcolname -
dbcurrow -
dbcursor -
dbcursorbind -
dbcursorclose -
dbcursorcolinfo -
dbcursorfetch -
dbcursorfetchex -
dbcursorinfo -
dbcursorinfoex -
dbcursoropen - Lock given row, if only inside a transaction

Transparent/Explicit Cursor functions
dbdata -
dbdatlen -
dbdead -
dberrhandle - Setzen der Meldung- und Fehlercallbacks.
dbexit -
dbfreelogin -
dbinit - Library-Funktionen
dblogin -
dbmsghandle -
dbnextrow -
dbnumcols -
dbopen -
dbresults -
dbretdata -
dbrpcexec -
dbrpcinit -
dbrpcparam -
dbrpcsend -
dbsetlname -
dbsetlogintime -
dbsettime -
dbsqlexec -
dbsqlok -
dbtabcount -
dbtabname -
dbuse -
open_commit - Two-Phase-Commit Funktionen

Two-Phase-Commit Funktionen
remove_xact -
scan_xact -
start_xact -
stat_xact -

Types

DBINT
LPBYTE
LPDBINT
LPINT
PDBCURSOR
PDBCursorInfo
PDBErrHandler
PDBINTArray
PDBMsgHandler
PDBPROCESS
PLOGINREC
RETCODE
TCursorWalk
TDBCursorInfo
TDBErrHandler
TDBINTArray
TDBMsgHandler

Constants

BINARYBIND
BUF_FULL
CHARBIND
CRS_DELETE
CRS_INSERT
CRS_LOCKCC
CRS_REFRESH
CRS_UPDATE
CUR_DYNAMIC
CUR_FORWARD
CUR_KEYSET
CUR_LOCKCC
CUR_OPTCC
CUR_OPTCCVAL
CUR_READONLY
DATETIMEBIND
DBFAIL
DBNOERR
DBRPCRETURN
DBSETAPP
DBSETHOST
DBSETID
DBSETLANG
DBSETPWD
DBSETUSER
DBSUCCEED
EXCOMM
EXCONSISTENCY
EXCONVERSION
EXFATAL
EXINFO
EXNONFATAL
EXPROGRAM
EXRESOURCE
EXSERVER
EXTIME
EXUSER
FTC_ENDOFKEYSET
FTC_ENDOFRESULTS
FTC_MISSING
FTC_SUCCEED
INTBIND
INT_CANCEL
INT_CONTINUE
INT_EXIT
MORE_ROWS
NO_MORE_RESULTS
NO_MORE_ROWS
NTBSTRINGBIND
REG_ROW
SMALLBIND
SQLBINARY
SQLCHAR
SQLDATETIME
SQLDATETIMN
SQLFLT8
SQLFLTN
SQLIMAGE
SQLINT1
SQLINT2
SQLINT4
SQLINTN
SQLMONEYN
SQLTEXT
SQLVARBINARY
SQLVARCHAR
STRINGBIND
TINYBIND
VARYBINBIND
VARYCHARBIND

Variables


Functions


function abort_xact(dbproc : PDBPROCESS; CommID : DBINT) : RETCODE;


procedure build_xact_string(XActName : PChar; ServiceName : PCHAR; CommID : DBINT; Result : PChar);


procedure close_commit(dbproc : PDBPROCESS);


function commit_xact(dbproc : PDBPROCESS; CommID : DBINT) : RETCODE;


function dbbind(proc : PDBPROCESS; Column, VarType, VarLen : Integer; VarAddr : Pointer) : Integer;


function dbcancel(proc: PDBPROCESS) : RETCODE;


function dbcanquery(proc: PDBPROCESS) : RETCODE;


procedure dbclose(proc: PDBPROCESS);


function dbcmd(proc: PDBPROCESS; cmd: PChar): Integer;


function dbcollen(proc : PDBPROCESS; Column : Integer) : Integer;


function dbcolname(proc : PDBPROCESS; Column : Integer) : PChar;


function dbcurrow(proc: PDBPROCESS) : DBINT;


function dbcursor(hCursor : PDBCURSOR; OPType : Integer; Row : Integer; Table : LPCSTR; Values : LPCSTR) : RETCODE;


function dbcursorbind(hCursor : PDBCursor; Col : Integer; VarType : Integer; VarLen : Integer; POutLen : LPDBINT; PVarAddr : PCHAR) : RETCODE;


function dbcursorclose(hCursor : PDBCURSOR) : RETCODE;


function dbcursorcolinfo(hCursor : PDBCursor; Column : Integer; ColName : LPSTR; ColType : LPINT; ColLen : LPDBINT; UserType : LPINT) : RETCODE;


function dbcursorfetch(hCursor : PDBCursor; FetchType : TCursorWalk; RowNum : Integer) : RETCODE;


function dbcursorfetchex(hCursor : PDBCursor; FetchType : TCursorWalk; RowNum : Integer; NRows : Integer; Unknown : Integer) : RETCODE;


function dbcursorinfo(hCursor : PDBCursor; NCols : LPINT; NRows : LPDBINT) : RETCODE;


function dbcursorinfoex(hCursor : PDBCURSOR; Info : PDBCURSORINFO) : RETCODE;


function dbcursoropen(DBProc : PDBPROCESS; SQL : PChar; ScrollOpt : Integer; ConcurOpt : Integer; NRows : Integer; PStatus : LPDBINT) : PDBCURSOR;

Lock given row, if only inside a transaction

Transparent/Explicit Cursor functions


function dbdata(proc: PDBPROCESS; column: Integer): Pointer;


function dbdatlen(proc: PDBPROCESS; column: Integer): Integer;


function dbdead(dbproc : PDBPROCESS) : Bool;


function dberrhandle(Handler : TDBErrHandler) : TDBErrHandler;

Setzen der Meldung- und Fehlercallbacks. Einzige Moeglichkeit an die *) (* aufgetretenen Fehler zu kommen.

procedure dbexit;


procedure dbfreelogin(login: PLOGINREC);


function dbinit: PChar;

Library-Funktionen

function dblogin: PLOGINREC;


function dbmsghandle(Handler : TDBMsgHandler) : TDBMsgHandler;


function dbnextrow(proc: PDBPROCESS): Integer;


function dbnumcols(proc : PDBPROCESS) : Integer;


function dbopen(login: PLOGINREC; ServerName: PChar): PDBPROCESS;


function dbresults(proc: PDBPROCESS) : RETCODE;


function dbretdata(proc: PDBPROCESS; column: Integer): Pointer;


function dbrpcexec(proc: PDBPROCESS): Integer;


function dbrpcinit(proc : PDBPROCESS; ProcName : PChar; Options : Integer): Integer;


function dbrpcparam(proc : PDBPROCESS; paramname : PChar; status : Byte; ptype : Integer; maxlen, datalen : Integer; value : Pointer): Integer;


function dbrpcsend(proc: PDBPROCESS): Integer;


function dbsetlname(login : PLOGINREC; val : PChar; item : Integer): Integer;


function dbsetlogintime(Seconds : Integer) : RETCODE;


function dbsettime(Seconds : Integer) : RETCODE;


function dbsqlexec(proc: PDBPROCESS) : Integer;


function dbsqlok(proc: PDBPROCESS): Integer;


function dbtabcount(dbproc : PDBPROCESS) : Integer;


function dbtabname(dbproc : PDBPROCESS; table : Integer) : PChar;


function dbuse(proc: PDBPROCESS; DBName: PChar): Integer;


function open_commit(Login : PLOGINREC; AppName : PChar) : PDBPROCESS;

Two-Phase-Commit Funktionen

Two-Phase-Commit Funktionen


function remove_xact(dbproc : PDBPROCESS; CommID : DBINT; SiteCount : Integer) : RETCODE;


function scan_xact(dbproc : PDBPROCESS; CommID : DBINT) : RETCODE;


function start_xact(dbproc : PDBPROCESS; AppName : PChar; XActName : PChar; SiteCount : DBINT) : Integer;


function stat_xact(dbproc : PDBPROCESS; CommID : DBINT) : Integer;


Types


DBINT            = Integer

LPBYTE           = ^BYTE

LPDBINT          = ^Integer

LPINT            = ^Integer

PDBCURSOR        = Pointer

PDBCursorInfo    = ^TDBCursorInfo

PDBErrHandler    = ^TDBErrHandler

PDBINTArray      = ^TDBINTArray

PDBMsgHandler    = ^TDBMsgHandler

PDBPROCESS       = Pointer

PLOGINREC        = Pointer

RETCODE          = Integer

TCursorWalk      = (
                       FETCH_NOT_USED,                             (* 0 *)
                       FETCH_FIRST,                                (* 1 *)
                       FETCH_NEXT,                                 (* 2 *)
                       FETCH_PREV,                                 (* 3 *)
                       FETCH_RANDOM,                               (* 4 *)
                       FETCH_RELATIVE,                             (* 5 *)
                       FETCH_LAST                                  (* 6 *)
                     );
Fully dynamic
TDBCursorInfo = record
SizeOfStruct : DBINT;
TotCols : ULONG;
TotRows : ULONG;
CurRow : ULONG;
TotRowsFetched : ULONG;
CursorType : ULONG;
Status : ULONG;
end;

TDBErrHandler    = function (DBProc    : Pointer;
                               Severity  : Integer;
                               DBError   : Integer;
                               OSError   : Integer;
                               DBErrStr  : PChar;
                               OSErrStr  : PChar) : Integer

TDBINTArray      = array[0..0] of DBINT;

TDBMsgHandler    = function (DBProc    : Pointer;
                               MsgNo     : Integer;
                               MsgStarte : Integer;
                               Severity  : Integer;
                               MsgText   : PChar;
                               SrvName   : PChar;
                               ProcName  : PChar;
                               LineNr    : SmallInt) : Integer

Constants

BINARYBIND = 5

BUF_FULL = -3

CHARBIND = 4

CRS_DELETE = 2

Update operation

CRS_INSERT = 3

Delete operation

CRS_LOCKCC = 5

Refetch given row

CRS_REFRESH = 4

Insert operation

CRS_UPDATE = 1

End of results set reached *) (* Following flags define the operator types for the dbcursor function

CUR_DYNAMIC = 1

Keyset driven scrolling

CUR_FORWARD = 0

Optimistic concurrency control based on *) (* selected column values

CUR_KEYSET = -1

Forward only scrolling

CUR_LOCKCC = 2

Read only cursor, no data modifications

CUR_OPTCC = 3

Intent to update, all fetched data locked *) (* when dbcursorfetch is called inside a *) (* transaction block.

CUR_OPTCCVAL = 4

Optimistic concurrency control, data *) (* modifications succeed only if the row *) (* hasn't been updated since the last fetch

CUR_READONLY = 1

Transparent/Explicit Cursor functions

DATETIMEBIND = 7

DBFAIL = 0

DBNOERR = -1

DBRPCRETURN = 1

DBSETAPP = 4

DBSETHOST = 1

DBSETID = 5

DBSETLANG = 6

DBSETPWD = 3

DBSETUSER = 2

DBSUCCEED = 1

EXCOMM = 9

running out of resources - the DBPROCESS *) (* may be dead.

EXCONSISTENCY = 11

fatal error - the DBPROCESS is dead.

EXCONVERSION = 4

non-fatal error

EXFATAL = 10

failure in communication with Server - *) (* the DBPROCESS is dead.

EXINFO = 1

Fehlerlevels im Error-Handler

EXNONFATAL = 3

user error

EXPROGRAM = 7

We have exceeded our timeout period while *) (* waiting for a response from the Server - *) (* the DBPROCESS is still alive.

EXRESOURCE = 8

coding error in user program

EXSERVER = 5

Error in DB-LIBRARY data conversion.

EXTIME = 6

The Server has returned an error flag.

EXUSER = 2

informational, non-error

FTC_ENDOFKEYSET = 4

The row is missing

FTC_ENDOFRESULTS = 8

End of the keyset reached

FTC_MISSING = 2

Fetch succeeded, (failed if not set)

FTC_SUCCEED = 1

6

INTBIND = 3

INT_CANCEL = 2

INT_CONTINUE = 1

INT_EXIT = 0

internal software error - notify MS *) (* Technical Support. *) (* Fehlerrueckgabewerte des Error-Handles

MORE_ROWS = -1

NO_MORE_RESULTS = 2

NO_MORE_ROWS = -2

NTBSTRINGBIND = 11

REG_ROW = MORE_ROWS

SMALLBIND = 2

SQLBINARY = $2d

SQLCHAR = $2f

SQLDATETIME = $3d

SQLDATETIMN = $6f

SQLFLT8 = $3e

SQLFLTN = $6d

SQLIMAGE = $22

SQLINT1 = $30

SQLINT2 = $34

SQLINT4 = $38

SQLINTN = $26

SQLMONEYN = $6e

SQLTEXT = $23

SQLVARBINARY = $25

SQLVARCHAR = $27

STRINGBIND = 10

TINYBIND = 1

dbBind Datentypen

VARYBINBIND = 13

VARYCHARBIND = 12


Variables