Query response in Firebird 5 from programming language

46 views
Skip to first unread message

Carlos Mazariegos

unread,
Oct 1, 2024, 5:54:39 PM10/1/24
to firebird-support
Hi,

When performing a query with count(*) from a programming language, Firebird 5 returns the result in a bigint type field. We can change the configuration in Firebird 5 to return the result in an integer

Regards

Mark Rotteveel

unread,
Oct 2, 2024, 4:10:10 AM10/2/24
to firebird...@googlegroups.com
No, you can't change this by configuration. You will need to adjust your
program to work with bigint. Also, this was changed in Firebird 3.0
already, not Firebird 5.0.

Mark
--
Mark Rotteveel

Carlos Mazariegos

unread,
Oct 2, 2024, 12:30:34 PM10/2/24
to firebird...@googlegroups.com
Thanks for your reply

--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/cef566f4-e258-4ae7-875a-5a5c244bff8a%40lawinegevaar.nl.


--
Carlos Mazariegos
carlosema...@gmail.com
Guatemala, CA

Svein Erling Tysvær

unread,
Oct 2, 2024, 4:51:11 PM10/2/24
to firebird...@googlegroups.com
I've no clue why bigint is a problem (and I still only use Firebird 2.5), but couldn't changing count(*) to cast(count(*) as integer) be a possible workaround?

Set

Mark Rotteveel

unread,
Oct 3, 2024, 4:54:25 AM10/3/24
to firebird...@googlegroups.com
On 02/10/2024 22:50, Svein Erling Tysvær wrote:
> I've no clue why bigint is a problem (and I still only use Firebird
> 2.5), but couldn't changing count(*) to cast(count(*) as integer) be a
> possible workaround?

In some languages or libraries, requesting the value of a BIGINT column
as a 32-bit integer will fail, even if the actual value could be
converted without loss of precision.

In other words, you can only request a 32-bit integer from an INTEGER
column, and you must request a 64-bit integer from a BIGINT.

In any case, if you can change the query, you can probably also change
the code to perform the right conversion.

Mark
--
Mark Rotteveel
Reply all
Reply to author
Forward
0 new messages