Chinaunix首页 | 论坛 | 博客
  • 博客访问: 91763952
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: Sybase

2008-04-11 11:16:14

来源:赛迪网    作者:limeinan

某些数据类型在 Adaptive Server Anywhere 中与在 Open Client 中的范围不同。这种情况下,检索或插入数据过程中可能会发生溢出错误。

下表列出了可映射到 Adaptive Server Anywhere 数据类型、但是在可能值的范围上具有某些限制的 Open Client 应用程序数据类型。

在多数情况下, Open Client 数据类型会映射到 Adaptive ServerAnywhere 数据类型,后者可以具有的值范围更大。因此,可能会出现这样的情况:向 Adaptive Server Anywhere 传递的值将被接受并存储在数据库中,而这个值对于 Open Client 应用程序来说太大,无法读取。

示例

Open Client MONEY 和 SMALLMONEY 数据类型不会超过它们底层的 Adaptive Server Anywhere 实现的整个数字范围。因此,Adaptive Server Anywhere 列中的值有可能会超出 Open Client 数据类型

MONEY 的界限。当客户端通过 Adaptive Server Anywhere 读取这样有问题的值时,就会生成错误。

时间戳

当 Open Client TIMESTAMP 值在 Adaptive Server Anywhere 中传递时,该数据类型的 Adaptive Server Anywhere 实现与它的 Adaptive ServerEnterprise 实现不同。在 Adaptive Server Anywhere 中,该值被映射到Adaptive Server Anywhere DATETIME 数据类型。在 Adaptive Server

Anywhere 中,缺省值是 NULL,而且不保证其唯一性。而 AdaptiveServer Enterprise 可确保该值会单纯地增加,因而是唯一的。

相比之下, Adaptive Server Anywhere TIMESTAMP 数据类型包含年、月、日、时、分、秒和毫秒信息。另外,就所具有的可能值的范围而言, DATETIME 数据类型比由 Adaptive Server Anywhere 映射来的Open Client 数据类型要大。

阅读(381) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~