ODBC:创建表语句中文字类型名称的映射

发布于 2024-08-25 05:58:36 字数 336 浏览 0 评论 0原文

我想知道通过 ODBC 执行的文字“创建表”语句中的数据类型是否被替换为数据库特定的对应项(平台是 Windows/.Net/C#)。 我在 ODBC 文档中找不到此功能,并且似乎没有文字“ODBC 数据类型”的列表。不过,我知道这适用于 Oracle、SQL Server 和 Access;尽管 LONGVARBINARY 类型在所有这些系统中都不是本机类型,但以下语句可以正确执行:

CREATE TABLE (MYCOLUMN LONGVARBINARY)

但是,例如对于 Oracle,映射的本机类型取决于所使用的 ODBC 驱动程序。

这是一个未记录的功能吗?是否有受支持的类型名称列表? 谢谢!

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 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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

灯下孤影 2024-09-01 05:58:36

一般来说,答案是否定的。它取决于各个 ODBC 驱动程序(如果支持的话,每个供应商可能会有所不同)。我在 ODBC 规范中没有看到任何描述“通用”数据类型名称的内容。大多数对 ODBC 的调用都会通过 ODBC 驱动程序管理器,但我不知道在任何情况下它都会对通过它传递的 SQL 语句执行转换/修改。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文