[英]DB2 + C#: Getting a SQL0302N error when trying to store a Bigint value
This not seems to make any sense, but i'm selecting a BIGINT data from a table, and inserting it into another BIGINT column into another table (the tables are identical, only reside in different servers), and SQL0302N is thrown. 这似乎没有任何意义,但是我正在从一个表中选择一个BIGINT数据,并将其插入另一个表的另一个BIGINT列中(这些表是相同的,仅驻留在不同的服务器中),并引发SQL0302N。 WHen i change the value of this bigint column to something lesser, the exception goes away.
当我将此bigint列的值更改为较小值时,该异常消失了。
The value itself is 2601354496. Other similar values cause the exception too. 该值本身是2601354496。其他类似的值也会引起异常。
Any thoughts? 有什么想法吗?
The problem coincidentally wasn't with BIGINT, but with VARCHAR. 巧合的是问题不是BIGINT,而是VARCHAR。 The database was created with wrong collation (UTF8 at destination, ISO8859 at source), and some special characters were being incorrectly translated.
数据库使用错误的排序规则创建(目标为UTF8,源为ISO8859),并且某些特殊字符被错误翻译。
There were no display issues, but the string storage sizes were varying. 没有显示问题,但是字符串存储大小有所不同。 And then, apparently, depending on the size of the number, independently of the string, the error was thrown.
然后,显然,取决于数字的大小,而与字符串无关,将引发错误。
But the truth was: the problem was only with the strings. 但事实是:问题仅在于弦乐。 When editing the values through TOAD or IBM Data Studio, the applications apparently fixed the collations and the problems gone away.
通过TOAD或IBM Data Studio编辑值时,应用程序显然可以解决排序规则问题,而问题却不存在了。 But at my C# application, it was not happening.
但是在我的C#应用程序中,它没有发生。
I've decided to recreate the database correctly instead of fixing the data, and everything worked fine. 我决定正确地重新创建数据库,而不是修复数据,并且一切正常。
If only those error messages were more clearer and descriptive... 如果仅这些错误消息更清晰,更具描述性...
Thanks for the efforts of everyone. 感谢大家的努力。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.