Bug #4782 | UNION query returns different datatype than SELECT in Access | ||
---|---|---|---|
Submitted: | 28 Jul 2004 8:19 | Modified: | 28 Jul 2004 19:52 |
Reporter: | Matthew Kerr | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | Connector / ODBC | Severity: | S1 (Critical) |
Version: | 3.51.08 | OS: | Windows (Win XP) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[28 Jul 2004 8:19]
Matthew Kerr
[28 Jul 2004 8:35]
Matthew Kerr
Microsoft ODBC SQL trace file of two example queries
Attachment: SQL.LOG (application/octet-stream, text), 36.20 KiB.
[28 Jul 2004 8:40]
Matthew Kerr
From the trace file, it seems like MyODBC/MySQL respond differently to the date field: MSACCESS a08-c54 EXIT SQLGetData with return code 0 (SQL_SUCCESS) HSTMT 0A7E1D58 UWORD 4 SWORD -2 <SQL_C_BINARY> (bad) vs. MSACCESS a08-c54 EXIT SQLGetData with return code 0 (SQL_SUCCESS) HSTMT 0A7E1D58 UWORD 4 SWORD -8 <SQL_C_WCHAR> (good!)
[28 Jul 2004 19:52]
Dean Ellis
This is the same issue as reported in 4578, and was corrected in Connector/ODBC 3.51.9. Note that UNION can return different data types than a simple SELECT currently due to the method by which the union is resolved; this should be addressed in 4.1. The problem regarding returning as a binary data type, however, has been fixed.
[13 Sep 2004 3:16]
Matthew Kerr
3.51.09 solved the binary issue, but now it's showing as a text/char field when being returned from a UNION versus correctly returning it as date or datetime from a single SELECT. I can't seem to use your CAST workaround in this case. Do you have any updated information or workarounds?
[16 Sep 2004 19:17]
Dean Ellis
That is due to the UNION (as above), with no real workaround for 4.0.