On 22/12/2012 09:14, Tim Bunce wrote:
I have a copy of the SQL:2011 standard, yet I cannot seem to find a
list of numbers correlating to data types? Is this DBI specific? Is
it still supported? Am I missing something?
It's not DBI specific. I've attached the copy I have.
Thanks. This has led me to the relevant section of the 2011 (which is
the same as 2008) SQL/CLI page 80:
Table 7, "Codes used for implementation data types in SQL/CLI",
specifies the codes associated with the
SQL data types used in implementation descriptor areas.
Now my current challenge is finding the ODBC definitions, which has thus
far been unfruitful. I've been right through the current ODBC documentation:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms710252%28v=vs.85%29.aspx
Failing that, tried finding the ODBC SDK. Searches in MSDN downloads
only seemed to turn up MDAC:
http://www.microsoft.com/en-us/download/details.aspx?id=21995
Which didn't include the header files mentioned here (which I assume
must contain the codes I seek):
http://msdn.microsoft.com/en-us/library/windows/desktop/ms713603%28v=vs.85%29.aspx
I did manage to find some second hand references to ODBC data type codes
from SQL Server 2000:
http://msdn.microsoft.com/en-us/library/aa179135%28v=SQL.80%29.aspx
and open XML:
http://msdn.microsoft.com/en-us/library/office/documentformat.openxml.spreadsheet.parameter.aspx
On google I found some notes from Denis Box at Fermilab USA, who had the
same troubling finding them (interesting as he references your book as
the only place he could find them):
http://home.fnal.gov/~dbox/SQL_API_Portability.html
... Ah, found a copy of the header files, they come with the Windows 7 SDK:
http://www.microsoft.com/en-us/download/details.aspx?id=3138
By default it'll try to install all sorts, but you only need to select
the header files. sqlext.h contains the ODBC SQL extended datatype codes.
I'm still doing this post because:
A) Others who get stuck looking for this may find this post. Google
brings up the DBI archives quite a lot for non DBI specific searches on
this kind of thing
B) Checking the header file doesn't seem like the ideal solution.
Somebody might know of an official MS resource where this is properly
defined?
If I can help with this, let me know, I can submit patches.
I'd be delighted to get patches updating those. Thanks!
Working on it. If no one comes back with a better resource, should I add
a description of how to find the ODBC codes from the header files?
Lyle