CONST
InvHandle = -2; Error = -1; Success = 0; (* return codes *)
SuccessWithInfo = 1; NoDataFound = 100;
showErrors = 1; haltOnErrors = 2; verboseErrorMsg = 3; (* options *)
\
ConnectionD = RECORD
ret: INTEGER; (* return code of the last operation *)
dbc-: LONGINT; (* connection handle *)
PROCEDURE (c: Connection) Prepare (sqlString: ARRAY OF CHAR): Statement;
PROCEDURE (c: Connection) Error (str: ARRAY OF CHAR);
PROCEDURE (c: Connection) Commit;
PROCEDURE (c: Connection) Rollback;
PROCEDURE (c: Connection) GetIntInfo (infoNr: INTEGER; VAR info: LONGINT);
PROCEDURE (c: Connection) GetStrInfo (infoNr: INTEGER;
VAR info: ARRAY OF CHAR);
PROCEDURE (c: Connection) GetIntOption (option: INTEGER;
VAR info: LONGINT);
PROCEDURE (c: Connection) SetIntOption (option: INTEGER; info: LONGINT);
PROCEDURE (c: Connection) GetStrOption (option: INTEGER;
VAR info: ARRAY OF CHAR);
PROCEDURE (c: Connection) SetStrOption (option: INTEGER;
info: ARRAY OF CHAR);
END ;
Statement = POINTER TO StatementD;
StatementD = RECORD
ret: INTEGER; (* return code of the last operation *)
stmt-: LONGINT; (* statement handle *)
conn-: Connection; (* the connection on which the statement is executed *)
PROCEDURE (s: Statement) Execute;
PROCEDURE (s: Statement) IsNull (varName: ARRAY OF CHAR): BOOLEAN;
PROCEDURE (s: Statement) SetNull (varName: ARRAY OF CHAR);
PROCEDURE (s: Statement) Fetch (): BOOLEAN;
PROCEDURE (s: Statement) Error (str: ARRAY OF CHAR);
PROCEDURE (s: Statement) RowCount (): LONGINT;
PROCEDURE (s: Statement) GetOption (option: INTEGER; VAR info: LONGINT);
PROCEDURE (s: Statement) SetOption (option: INTEGER; info: LONGINT);
END ;
\< VAR
env-: ODBC.ENV; (* environment handle for the ODBC session *)
options: SET;
PROCEDURE Open (source, user, passwd: ARRAY OF CHAR): Connection;
PROCEDURE OpenUI (connStrIn: ARRAY OF CHAR;
VAR connStrOut: ARRAY OF CHAR): Connection;
PROCEDURE SetOption;
PROCEDURE SQLError (env, dbc, stmt: LONGINT; VAR sqlState: ARRAY OF CHAR;
VAR nativeErr: LONGINT; VAR errMsg: ARRAY OF CHAR): INTEGER;
PROCEDURE ShowError (ret: INTEGER; str: ARRAY OF CHAR; env, dbc,
stmt: LONGINT);
END EmbeddedSQL.
nnnnnnnnnn¯
DEFINITION EmbeddedSQL;