Count in Firebird 3.0 Bigint X Firebird 2.5 Integer

Asked

Viewed 722 times

2

In my system, after the migration of Firebird 2.5 to the 3.0, many reports and other functions began to give problem stating that the expected was Integer and the current is LargeInt. I took a look and saw some research with count in the 3.0 return a column Bigint, while in the 2.5 returns a column Integer.

To solve it the way I know it, I’d have to make a cast in everything that is giving error, I tested and it worked, however it is a big system, it will take a lot of work.

Does anyone know any way to resolve this, on the Firebird? some configuration, or something?

  • It wasn’t clear to me. You select Count, and assign this value to an Integer type variable. This in Firebird 3 gives error ?

  • 1

    No @Victorzanella... In the simple Open of dataset error is generated. This is because the dataset already owns the TFields added, but when opened, the field comes in another format... That’s why the message: Expected Integer, found Largeint.

  • Hard to say @Andrey. The question is focused on Firebird. I’ll wait for the sounobre to answer. ;)

  • Tranquil @Victorzanella... I may be wrong, but as I’ve been through this problem, it seems obvious the problem.. but let’s wait for the sounobre

  • 1

    Victorzanella is exactly what @Andrey said, if I add it again in the dataset, I’ll stick to the incident backwards, giving Firebird 2.5 an error... I’m actually looking for some miraculous configuration that saves me from casting a multiple piece of code.... rsrs

3 answers

2

In Firebird I believe I have no way to configure this, see on Release Notes pag. 89. Unfortunately in this case you will have to cast or if you are using the Fields added on qry or clientdataset I think you just remove the field and add again that the driver maps the type correctly.

I tell you to read the book Firebird Migration Guide 3, has some really cool tips.

  • 1

    Thank you very much... I thought I had something to do so it wouldn’t be too much trouble... doing the cast on everything is going to be a lot of work... and I can’t remove the field, because I still have clients using version 2.5...

2


Buddy, if you’re using the FireDAC, there is a very plausible solution.
It’s called MapRules, more information you can find on link.

With this technology, you can tell the system to treat a field LargeInt as Integer or vice versa.
I use this feature in our system to make compatibility between different banks.

  • Buddy, I’m not using Firedac.... to no Delphi 7 using Unidac...

  • Unidac also has this solution. Thank you.

0

To solve the compatibility problem, change the line in the query count() for cast(count() as integer). Will work perfectly in version 2.5 and 3.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.