Subject Re: [IBO] Locate method generate a exception when dont find a information
Author Svein Erling Tysvær
What does your statement look like? The SQL you wrote is simply wrong, to me it seems like it is something created from IBO based on a query similar to:

SELECT ORCAMENTOS_VENDAS.PK_ORCS_VENDAS
FROM ORCAMENTOS_VENDAS
where (data between :P00and :P01
  AND (((UPPER( CLIENTE_NOME ) <= UPPER( :LOC_3 ))))
ORDER BY CLIENTE_NOME DESC

I think this is wrong for two reasons:

a) The parameter seems to be named :P00and (no space between 'P00' and 'and'), which probably generates the syntax error (data between :P00 :P01 lacks the 'and')
b) :LOC_3 is of unknown type

:P00and and :P01 can be deducted to be of the same type as 'data', but :LOC_3 is treated by the UPPER function before being compared to the result of another UPPER, hence I doubt Firebird or IBO is capable of guessing the type of :LOC_3 and I'd be even more surprised if it could guess its length (well, maybe it can treat this parameter as BLOB subtype TEXT).

This could of course be due to an error in IBO removing spaces without adding them back, but check that your statement actually contains the space between 'P00' and 'and'. And does your problem persist if you change your query to

SELECT ORCAMENTOS_VENDAS.PK_ORCS_VENDAS
FROM ORCAMENTOS_VENDAS
where (data between :P00 and :P01
  AND (((UPPER( CLIENTE_NOME ) <= UPPER( CAST(:LOC_3 AS VARCHAR(100))))))
ORDER BY CLIENTE_NOME DESC

Set