简体   繁体   English

DB2 + C#:尝试存储Bigint值时出现SQL0302N错误

[英]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.

相关问题 错误SQL30061N使用IBM.EntityFrameworkCore从Visual Studio 2017 c#中的DB2 iSeries提取数据 - Error SQL30061N pulling data from DB2 iSeries in Visual Studio 2017 c# using IBM.EntityFrameworkCore 将 SQL 中的 BigInt 值转换为 c# 中的日期时间 - Convert BigInt value in SQL to datetime in c# DB2“ SQL0901 SQL系统错误”。 尝试从包含UNION的视图中进行选择时 - DB2 'SQL0901 SQL System Error.' when trying to SELECT from view containing UNION DB2错误[07004] SQL0313N - DB2 ERROR [07004] SQL0313N 尝试使用 CsvHelper 将 csv 文件内容存储到 C# 字典时出错 - Getting error when trying to store csv file contents into a C# Dictionary using CsvHelper C# MVC Core 5 Site 在尝试打开与 Azure SQL DB 的连接时引发编码错误 - C# MVC Core 5 Site throws encoding error when trying to open a connection to Azure SQL DB C# 和 SQL 服务器中的 long 和 bigint 的值太大 - Value too big for long and bigint in C# and SQL Server 尝试在C#中查询数据库,然后将其存储到变量中 - Trying to Query a DB in C# and then store it to a variable 尝试在Windows Store App C#中查看设计器时出错 - Error when trying to view designer in windows store app c# 无效的游标状态错误C#DB2 - Invalid Cursor State Error C# DB2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM