0

Am looking for a way to get the maximum value of an integer data type in a function. Since FB doesn't have an unsigned type, casting from -1 doesn't work. Nor can I find any built-in constant or function to get it. Any other ideas? (Am not looking to hardcode any value.)

2
Contributors
4
Replies
21
Views
4 Years
Discussion Span
Last Post by pritaeas
0

So I'm assuming you're looking for a function to return that (or whatever any new value in newer versions would be)?

Correct.

Would range of integer change though?

No, but I'd like it to work on the different data types (int, smallint, decimal etc.), so that my query keeps working even if the data type is changed.

Edited by pritaeas

0

OK, that makes sense. I had a quick scan and couldn't find one either. So something like an int.MAX type thingy - no - failed :(

I'm assuming it's to prevent an error in queries by validating input against field datatypes?

0

I'm assuming it's to prevent an error in queries by validating input against field datatypes?

In my case to help order results, null being the highest available number.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.