I'm trying to query a Linked server and need to use the LIKE clause. I'm using the following but I' getting an error that states: OLE DB provider "Advantage.OLEDB" for linked server "CODE3" returned message "Error 7200: AQE Error: State = 42000; NativeError = 2115; [Extended Systems][Advantage SQL Engine]Expected lexical element not found: USER There was a problem parsing the WHERE clause in your SELECT statement. -- Location of error in the SQL statement is: 62 Select STATLINK from STATUTE where UPPER(ST_STRING) LIKE UPPER('%394 467%')".
Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "Select STATLINK from STATUTE where UPPER(ST_STRING) LIKE UPPER('%394 467%')" for execution against OLE DB provider "Advantage.OLEDB" for linked server "CODE3".
Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "Select STATLINK from STATUTE where UPPER(ST_STRING) LIKE UPPER('%394 467%')" for execution against OLE DB provider "Advantage.OLEDB" for linked server "CODE3".
Code:
Select * from OPENQUERY(CODE3,'Select STATLINK from STATUTE where UPPER(ST_STRING) LIKE UPPER(''%394 467%'')')