查询时出错:EXECUTE或OPEN语句中的主机变量的值对于其相应的用途而言过大 [英] Error while Querying : The value of a host variable in the EXECUTE or OPEN statement is too large for its corresponding use

查看:2009
本文介绍了查询时出错:EXECUTE或OPEN语句中的主机变量的值对于其相应的用途而言过大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用select查询语句时。输入变量有8个字符,正如预期。

On trying to use a select query statement. The input variable has 8 characters just as expected.

我不知道为什么这个错误来选择查询,因为对于一个选择查询,它会查询,如果它的可用,它将返回否则它将返回空白行。

I dont know why this error comes for select query because for a select query it will query and if its available it will return else it will retun blank rows.

使用Hibernate。

Hibernate is used. Even in mapping its correctly mapped as 8 only.

这是我在日志文件中找到的:

This is what i found in log file:

Cause = com.ibm.db2.jcc.a.SqlException: The value of a host variable in the EXECUTE or OPEN statement is too large for its corresponding use.

有没有人遇到此错误?请给我建议一些解决方案为什么这个错误发生..

Has anybody come across this error before? Please suggest me some solutions on why this error occurs..

推荐答案

一种可能性...这个问题甚至可以发生在SELECT语句。当传入查询的参数超过其数据类型大小的大小时,会弹出此错误。

One possibility... This issue can come even in SELECT statement. When the parameter passed into the query is more than the size of its datatype's size, this error will pop-up.

示例:

Datatype - CHAR(12)
Search Param: "123456789012345"

这篇关于查询时出错:EXECUTE或OPEN语句中的主机变量的值对于其相应的用途而言过大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆