Subject Re: Strange problem using Between ... And...
Author Svein Erling Tysvær
--- In firebird-support@yahoogroups.com, "william_yuwei" wrote:
> I've got a very strange problem, I have a sql statement in a
> stored procedure which works OK UNTIL TODAY. It just suddenly return
> strange result. I have a field called ACCOUNT_NO is of type INTEGER,
> in the where clause I have like, ACCOUNT_NO between :FromAccount and
> :ToAccount, if FromAcccount is 1 and ToAccount is 1000, it should
> return whatever the range in 1-1000. but all suddenly it returns 1,
> 10, 100, 1000, total 4 records always no matter how many records it
> should have.

This is what I would expect to be the result if CONTACTS.ACCOUNT_NO
was defined as CHAR, VARCHAR or something similar. Have you checked
the current definition of this table?

I don't know enough about the internals of Firebird, but maybe some
automatic type conversion in your makes the comparison against
CONTACTS.ACCOUNT_NO be a character comparison in your first SP,
whereas it is translated to an integer when you assign it to your
output variable in the second procedure.

HTH,
Set