Subject Re: [firebird-support] Counting rows affected by UPDATE/INSERT/DELETE queries
Author Ivan Prenosil
> >Use isc_dsql_sql_info (with isc_info_sql_records as request).
> >
> Whats the format of the data it puts into the buffer, I can make head or
> tail of it? Something thats 29 bytes long.


Here are some examples for API function isc_dsql_sql_info() with isc_info_sql_records
in request buffer. Result buffer will contain something like this:

Result buffer for DELETE statement contains:
23, 29,0, (isc_info_sql_records, length=29)
15, 4,0, 0,0,0,0, (isc_info_req_update_count, 0 rows updated)
16, 4,0, 4,0,0,0, (isc_info_req_delete_count, 4 rows deleted)
13, 4,0, 4,0,0,0, (isc_info_req_select_count, 4 rows selected)
14, 4,0, 0,0,0,0, (isc_info_req_insert_count)
1, (isc_info_end)

Result buffer for UPDATE statement contains:
23, 29,0,
15, 4,0, 4,0,0,0,
16, 4,0, 0,0,0,0,
13, 4,0, 4,0,0,0,
14, 4,0, 0,0,0,0,
1,

Result buffer for INSERT statement contains:
23, 29,0,
15, 4,0, 0,0,0,0,
16, 4,0, 0,0,0,0,
13, 4,0, 0,0,0,0,
14, 4,0, 1,0,0,0,
1,


Ivan
http://www.volny.cz/iprenosil/interbase/