Subject Problem with Locate on a SubSelect-Field
Author guido.klapperich@t-online.de
I have the follow query:
select URID,
URUSER,
(select USID from USERS where
USLOGINNAME=USERS_REPLICATION.URUSER) as USID,
(select USLASTNAME from USERS where
USLOGINNAME=USERS_REPLICATION.URUSER) as USLASTNAME,
(select USFIRSTNAME from USERS where
USLOGINNAME=USERS_REPLICATION.URUSER) as USFIRSTNAME,
URMIN,
URMAX,
URCOMPUTERNAME,
URREPLUSER
from USERS_REPLICATION
order by URMIN

I have a IB_LocateEdit, that searches on the field USLASTNAME. But when
I want to locate a name, I get the error:
SQL error code=-104
Token unknown - line , char 10 (

Here's what the SQL_Monitor says:
/*---
PREPARE STATEMENT
TR_HANDLE = 15745204
STMT_HANDLE = 15759824

SELECT URID
from USERS_REPLICATION
WHERE (((UPPER( USLASTNAME ) >= UPPER( ? /* LOC_3 */ ))))
ORDER BY (select USLASTNAME from USERS where
USLOGINNAME=USERS_REPLICATION.URUSER) ASC

FIELDS = [ Version 1 SQLd 2 SQLn 30
RDB$RELATION_FIELDS.RDB$FIELD_NAME = <NIL>
RDB$RELATION_FIELDS.RDB$RELATION_NAME = <NIL> ]

ERRCODE = 335544569
----*/
/*---
PREPARE STATEMENT
TR_HANDLE = 15745204
STMT_HANDLE = 15759824

SELECT URID
from USERS_REPLICATION
WHERE (((UPPER( USLASTNAME ) >= UPPER( ? /* PRM_0 */ ))))
ORDER BY (select USLASTNAME from USERS where
USLOGINNAME=USERS_REPLICATION.URUSER) ASC

FIELDS = [ Version 1 SQLd 2 SQLn 30
RDB$RELATION_FIELDS.RDB$FIELD_NAME = <NIL>
RDB$RELATION_FIELDS.RDB$RELATION_NAME = <NIL> ]

ERRCODE = 335544569
----*/
/*---
INTERPRETE BUFFER =

SECONDS = 0,010

ERRCODE = 17
----*/
/*---
INTERPRETE BUFFER = Dynamic SQL Error

ERRCODE = 21
----*/
/*---
INTERPRETE BUFFER = SQL error code = -104

ERRCODE = 31
----*/
/*---
INTERPRETE BUFFER = Token unknown - line 4, char 10

ERRCODE = 1
----*/
/*---
INTERPRETE BUFFER = (

ERRCODE = -1
----*/
/*---
COMMIT
TR_HANDLE = 15745204
----*/
/*---
COMMIT
TR_HANDLE = 15745528
----*/
/*---
COMMIT
TR_HANDLE = 15751068
----*/

Any ideas ?


Guido