Subject Re: [IBO] TIB_LookupCombo case insensitive inc search
Author Jason Wharton
Brian,

After looking into this I now recall some things that I forgot.

InterBase doesn't allow the ORDER BY clause to look like this:

/*---

PREPARE STATEMENT

TR_HANDLE = 13589512

STMT_HANDLE = 13589348

SELECT DEPT_NO

, DEPARTMENT

FROM DEPARTMENT

WHERE DEPT_NO > ? /* PRM_0 */

ORDER BY UPPER( DEPARTMENT ) ASC

FIELDS = [ Version 1 SQLd 11 SQLn 2

EMPLOYEE.EMP_NO = <NIL>

EMPLOYEE.FIRST_NAME = <NIL> ]

ERRCODE = 335544569

----*/

/*---

INTERPRETE BUFFER =

ERRCODE = 17

----*/

/*---

INTERPRETE BUFFER = Dynamic SQL Error

ERRCODE = 21

----*/

/*---

INTERPRETE BUFFER = SQL error code = -104

ERRCODE = 30

----*/

/*---

INTERPRETE BUFFER = Token unknown - line 5, char 8

ERRCODE = 5

----*/

/*---

INTERPRETE BUFFER = UPPER

ERRCODE = -1

----*/

So, the conclusion to this is you need to have a true mirror column
maintained by triggers or you need to declare a COMPUTED column at the table
level.

I don't think it is possible to use an aliased column from the select list
in the ORDER BY clause either. It's either columns in the table or the raw
number indicating the numerical position of the column in the select list.

I happen to think that enhancing the SQL capabilities of InterBase here
should be a good morsel for the folks at Borland and/or the FireBird folks.

Sorry to string you along here!

Regards,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com