免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 13217 | 回复: 2
打印 上一主题 下一主题

嵌入SQL的错误,SQL0302N [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-05-17 13:08 |只看该作者 |倒序浏览
SQL0302N  The value of a host variable in the EXECUTE or OPEN statement is too large for its corresponding use.  SQLSTATE=22003
是这个错误代码,在运行的时候发生的.大概意思是插入数据库的字段和数据库里定义的不符合,我找到了详细的错误解释:
  1. bash-3.00$ db2 ? SQL0302N


  2. SQL0302N The value of a host variable in the EXECUTE or OPEN
  3.           statement is too large for its corresponding use.

  4. Explanation:

  5. The value of an input host variable was found to be too large for
  6. its use in the SELECT, VALUES, or prepared statement.  One of the
  7. following occurred:

  8. o   The corresponding host variable or parameter marker used in
  9.     the SQL statement is defined as string, but the input host
  10.     variable contains a string that is too long.

  11. o   The corresponding host variable or parameter marker used in
  12.     the SQL statement is defined as numeric, but the input host
  13.     variable contains a numeric value that is too large.

  14. o   The terminating NUL character is missing from the C language
  15.     NUL-terminated character string host variable.

  16. o   Federated system users: in a pass-through session, a data
  17.     source-specific restriction might have been violated.



  18. This error occurs as a result of specifying either an incorrect
  19. host variable or an incorrect SQLLEN value in an SQLDA on an
  20. EXECUTE or OPEN statement.

  21. The statement cannot be processed.

  22. User Response:

  23. Ensure that the input host variable value is the correct type and
  24. length.  If the input host variables supply values to parameter
  25. markers, match values with the implied data type and length of
  26. the parameter marker.

  27. Federated system users: for a pass-through session, determine
  28. what data source is causing the error (see the problem
  29. determination guide for procedures to follow to identify the
  30. failing data source).  Examine the SQL dialect for that data
  31. source to determine which specific restriction has been violated,
  32. and adjust the failing statement as needed.

  33. sqlcode :  -302

  34. sqlstate :  22001, 22003
复制代码

但我仔细检查过那些字段了,应该是没有上述情况的啊.
有没有人碰到过这个问题,还有什么其他的情况会导致这样啊.我把set语句后面的字段一个一个排查过来,就是每次就set一个字段还是不行.

论坛徽章:
0
2 [报告]
发表于 2006-05-19 10:54 |只看该作者
在 EXECUTE 或 OPEN 语句中的主机变量值对于其相应的使用来说过大。
说明:
发现输入主机变量的值对于其在 SELECT、VALUES 或准备语句中的使用来说太大。发生下列其中一种情况:

SQL 语句中使用的相应主机变量或参数标识符被定义为字符串,但是输入主机变量包含的字符串太长。
SQL 语句中使用的相应主机变量或参数标识符被定义为数字,但是输入主机变量包含的数值太大。
C 语言以 NUL 终止的字符串主机变量中丢失终止字符 NUL。
联合系统用户:在传递(Pass-Through)会话中,可能已违反特定于数据源的限制。
由于在 EXECUTE 或 OPEN 语句上的 SQLDA 中指定了不正确的主机变量或不正确的 SQLLEN 值,所以发生此错误。

不能处理该语句。

用户响应:
确保输入主机变量值的类型和长度是正确的。如果输入主机变量向参数标识符提供值,则使这些值与参数标识符的隐含数据类型和长度相匹配。

联合系统用户:对于传递(Pass-Through)会话,确定哪一个数据源导致该错误(请参阅 Problem determination guide 以了解标识失败数据源所要遵循的过程)。检查该数据源的 SQL 对话以确定违反了哪个特定限制,并根据需要来调整限制。

希望对你有帮助吧

论坛徽章:
0
3 [报告]
发表于 2013-04-15 17:33 |只看该作者
去打补丁吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP