Topic on Extension talk:OdbcDatabase/Flow

LIMIT clause not working

2
Roberto Orioli (talkcontribs)

I found that using the limit parameter in #get_db_data: produce a SQL syntax error.

The builded query is something like SELECT a,b,c FROM t LIMIT x. This is a SQL syntax error in MS SQL Server; it should be SELECT TOP x a,b,c FROM t.

Chiefgeek157 (talkcontribs)

Roberto,

Good catch, I am sure there is a place where we can update the translation to be correct for SQL Server. Interestingly, since OdbcDatabase is supposed to work using the ODBC driver for ANY database, not just SQL Server, I am not sure that is a problem with the OdbcDatabase extenstion, but with the ExternalData extension.

If, however, we assume that OdbcDatabase would really never be used except when accessing SQL Server from Linux, then it is likely safe to somehow coerce the combination of OdbcDatabase and ExternalData to use SQL Server=specific SQL constructs.

A good thing to test.

Reply to "LIMIT clause not working"