Last active
August 29, 2015 13:59
-
-
Save juristr/10451546 to your computer and use it in GitHub Desktop.
Dapper ODBC QueryMultiple Error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Pieces of code that is being executed | |
*/ | |
// our variable holding the query | |
private static string QUERY_ADMISSION_PERSONAL_DATA = | |
@" | |
SELECT QCLCOGNO as LastName, QCLNOME as FirstName, QCLLINGUA as PrintLanguage FROM JXPLURIF.QUADCL00F WHERE QCLDONUM=? | |
SELECT QRIVALORE as Consort FROM JXPLURIF.QUADRI00F WHERE QRIDONUM=? AND QRICODICE='0106' | |
SELECT QRIVALORE as Children FROM JXPLURIF.QUADRI00F WHERE QRIDONUM=? AND QRICODICE='0107' | |
SELECT QRIVALORE as DependentChildren FROM JXPLURIF.QUADRI00F WHERE QRIDONUM=? AND QRICODICE='0108' | |
SELECT QRIVALORE as Family FROM JXPLURIF.QUADRI00F WHERE QRIDONUM=? AND QRICODICE='0109' | |
SELECT QRIVALORE as DependentFamily FROM JXPLURIF.QUADRI00F WHERE QRIDONUM=? AND QRICODICE='0110'"; | |
... | |
// our ODBC connection | |
var conn =new OdbcConnection(); | |
... | |
// querying | |
using (var multi = conn.QueryMultiple(QUERY_ADMISSION_PERSONAL_DATA, new DynamicParameters( | |
new | |
{ | |
Id = id | |
}))) | |
{ | |
... | |
} | |
// the following exception is thrown | |
"ERROR [42000] [IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0199 - Keyword SELECT not expected. Valid tokens: FOR WITH FETCH ORDER UNION EXCEPT OPTIMIZE.", |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How is
QueryMultiple
being handled?? The problem apparently is that the underlying ODBC driver doesn't recognize that there are multiple queries but sees them as one and thus doesn't execute because he doesn't expect aselect
statement.