开发者

ODBC: Mapping of literal type names in create table statements

开发者 https://www.devze.com 2022-12-22 23:54 出处:网络
I was wondering if data types in a a literal \"create table\" statement, executed over ODBC, are replaced with their database specific counterparts (platform is Windows/.Net/C#).

I was wondering if data types in a a literal "create table" statement, executed over ODBC, are replaced with their database specific counterparts (platform is Windows/.Net/C#). I cannot find this feature in the ODBC docs, and there seems to be no list of literal "ODBC data types". However, I know that this works for Oracle, SQL Server and Access; the following statement is executed correctly, although the type LONGVARBINARY is no native开发者_如何学Python type in all of these systems:

CREATE TABLE (MYCOLUMN LONGVARBINARY)

However, e.g. for Oracle the mapped native type depends on the used ODBC driver.

Is this an undocumented feature? Is there a list of supported type names anywhere? Thanks!


In general, the answer is no. It would be dependent on the individual ODBC drivers (and possibly different from every vendor if it were supported). I have not seen anything in the ODBC specification that describes "common" data type names. Most calls into ODBC do go through the ODBC driver manager, but I am not aware of any situations in which it would perform translation/modification of SQL statements being passed through it.

0

精彩评论

暂无评论...
验证码 换一张
取 消