[Gambas-user] ExecuteScalar

John Dovey dovey.john at gmail.com
Fri Jun 25 03:23:56 CEST 2021


This is not a terribly important question, because there are obvious ways
to do it, but is there a Gambas equivalent for " ExecuteScalar"?

For example if I have the SQL "Select COUNT(*) from 'SomeTable';"
I can of course do

<snip open database code>
    Dim RS As Result
    Try RS = $con.Exec( "SELECT COUNT(*) as NoOfRecords from 'echodist' " )
    doCountEchos = RS!NoOfRecords
    Try $con.Close

but I'm wondering if there is a better way?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210624/9f100ad2/attachment.htm>


More information about the User mailing list