[Gambas-user] odbc a way to know if a sql DDL was susessfully or not?

Benoît Minisini gambas at ...1...
Wed May 24 15:58:57 CEST 2017


Le 24/05/2017 à 15:47, PICCORO McKAY Lenz a écrit :
> due the odbc does not provide a record count like mysql does (cos provider
> may o nor offer) on every sql query..
> 
> how we can know if a DDL sql (i mean a select, a dropt table, or a create
> table) was excecuted using the result object and without a try catch method?
> 
> 
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com

The record count is only for Result objects. So you should not get it 
for a CREATE or a DROP TABLE statement.

A record count of -1 means that you have to use the MoveNext() method 
until the Available property is False to get each record. Once done, 
then you know how many records you get.

I think the reason is that the underlying ODBC driver sends the result 
line by line, whereas the others (MySQL, PostgreSQL and SQLite drivers) 
send all the lines by default.

Maybe the ODBC driver should store the entire query result in memory to 
simulate a standard Result object when it is internally "move forward" only?

-- 
Benoît Minisini




More information about the User mailing list