distributed queries and ODBC 3.51.10
Hi,
I use distributed queries on MS sql server 2000 to run query on multiple instance of MySQL server. The query looks like this:
SELECT * FROM OPENQUERY(MyLinkedServer,
'SELECT host,date,mid(msg,locate(''to'',msg,INSTR(msg,''from''))+3,locate(''/'',msg,INSTR(msg,''to''))-(locate(''to'',msg,INSTR(msg,''from''))+3)) as ip FROM MyTableName)>0'
)
MyLinkedServer is the name of the MySQL linked server.
The MySQL Database Server installed on my machine is the GA 4.1.7.
The ODBC Connector used is the 3.51.10
when I run the query above I obtain the following error message:
Could not get the current row value of column '[MSDASQL].ServerName' from the OLE DB provider 'MSDASQL'.
[OLE/DB provider returned message: Requested conversion is not supported.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetData returned 0x80040e1d].
I found that the error was on the mid function:
I modify the query in this way giving the length parameter a numeric explicit value:
SELECT * FROM OPENQUERY(MyLinkedServer,
'SELECT host,date,mid(msg,locate(''to'',msg,INSTR(msg,''from''))+3,5) as ip FROM MyTableName)>0'
)
this query works well but I cannot use it because in my apps the length parameter can't be passed as a costant.
Is there a bug in the ODBC connector? what can I due to workaround this problem?