Subject Re: Stored Procedure Problem
Author Adam
--- In, "Tomy Handaka"
<Tomy.Handaka@...> wrote:
> Dear all,
> I have a 'strange' behaviour on Firebird's stored procedure. I
> constructed a query for a report that includes date format as input
> parameter, like (simplified):
> FROM... WHERE .... between :DATETO and :DATEFROM <==
> DATEFROM is smaller than DATETO
> If that query is executed using SQLEditor, it works well. But when it
> applied into stored procedure, with valid statement, the query return
> null result.

To my knowledge, Firebird does not ever work with the above query.
Both DSQL and PSQL expect the first argument for between to be smaller
than or equal to the second argument. I have no idea what the SQL
standard says about this, but always issue the lower value first if
you want it to work. It doesn't return a null result, it returns 0
records btw.