I managed to get things working. For some reason, the serial value
after insert is not being correctly returned in the record (it always
returns 0), but the rowid value is, and that's what I wanted. Can't
speak for the accuracy of the rest of it, but in case anybody else finds
it useful, here's my code:
uses BDE;
type TSQLCAW = record
sqlwarn0: char; // = W if any of sqlwarn[1-7] = W
sqlwarn1: char; // = W if any truncation occurred or
// database has
transactions
sqlwarn2: char; // = W if a null value returned or
// ANSI database
sqlwarn3: char; // = W if no. in select list != no. in
into list or
// turbo backend
sqlwarn4: char; // = W if no where clause on prepared
update,
// delete or
incompatible float format
sqlwarn5: char; // = W if non-ANSI statement
sqlwarn6: char; // reserved
sqlwarn7: char; // reserved
end;
TSQLCA = record
sqlcode: cardinal;
sqlerrm: array[0..71] of char; // error message
parameters
sqlerrp: array[0..7] of char;
sqlerrd: array[0..5] of cardinal;
// 0 - estimated number of rows returned
// 1 - serial value after insert or ISAM
error code
// 2 - number of rows processed
// 3 - estimated cost
// 4 - offset of the error into the SQL
statement
// 5 - rowid after insert
sqlwarn: TSQLCAW;
end;
const CSqlcaSize = SizeOf(TSQLCA);
var LSQLCA: TSQLCA;
LLen: Word;
if (DbiGetProp(
hDBIObj(Database1.Handle),
drvNATIVESQLCA,
@LSQLCA,
CSqlcaSize,
LLen) = DBIERR_NONE)
and (LLen = CSqlcaSize) then begin
...
Cheers,
> Carl Reynolds Ph: +64-9-4154790
> CJN Technologies Ltd. Fax: +64-9-4154791
> [EMAIL PROTECTED] DDI: +64-9-4154795
> PO Box 302-278, North Harbour, Auckland, New Zealand
> 12 Piermark Drive, North Harbour Estate, Auckland, NZ
> Visit our website at http://www.cjntech.co.nz/
>
> -----Original Message-----
> From: Greg Amer [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, October 14, 1999 5:45 PM
> To: Multiple recipients of list database
> Subject: Re: [DUG-DB] (Informix) Where can I get sqlca.h?
>
> Yeah I have seen a definition for this somewhere I forget where but
> the dbiGetOrdProp didn't work with it any how. If you are still
> interested
> to have a play with it give me a yell and I'll see if I can dig it up.
>
> ----------------------------------------------------------------------
> -----
> New Zealand Delphi Users group - Database List -
> [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
application/ms-tnef