Board index » delphi » Question of TQuery

Question of TQuery

Hi,

Situation:
We have a TDatabase and a TQuery. The TDatabase is linking to DB2
database through ODBC. The TQuery has a 'SQLpassthrough' option.

Question:
When we use Tquery to run SQLs with no result set (i.e insert, update),
how can we get the number of effected rows in Database. ExecSQL is a
method with no return value and we failed to find any property or
function that can return such value.

 

Re:Question of TQuery


Quote
In article <325047D0.6...@iss.clear.co.nz> dragan erak <de...@iss.clear.co.nz> writes:
>From: dragan erak <de...@iss.clear.co.nz>
>Subject: Question of TQuery
>Date: Mon, 30 Sep 1996 15:21:04 -0700
>Hi,
>Situation:
>We have a TDatabase and a TQuery. The TDatabase is linking to DB2
>database through ODBC. The TQuery has a 'SQLpassthrough' option.
>Question:
>When we use Tquery to run SQLs with no result set (i.e insert, update),
>how can we get the number of effected rows in Database. ExecSQL is a
>method with no return value and we failed to find any property or
>function that can return such value.

how about writing a stored procedure that returns the set you want, then use
tquery.execsql with

tquery.sql[0] := "execute procedure blabla param1 returning values :answer"

Interrogate the tquery params property to get answer. I haven't tried it,
but it should work

HTH

Boris Ingram, Cyborg Software
boris...@iafrica.com
100076.3...@compuserve.com
http://www.pcb.co.za/users/borising/cyborg.htm

Other Threads