ora-00972 标识符太长 oracle 10g
我收到标题中提到的错误。
我使用的是 36 个字符的 ID。此错误仅在我的 asp.net web 表单中的 sqldatasource 中抛出。 当我在 Oracle sql Developer
中执行更新时,这不是问题。
我该如何解决这个问题?
I am getting the error mentioned in the title.
I am using a 36 charecter ID. This error is only thrown In my sqldatasource in my asp.net webform.
It is not a problem when I perform updates in Oracle sql developer
.
How can I fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Oracle 支持最多 30 个字符的标识符,而您的标识符长度
36
大于此值。因此,请使其长度为 30 个字符。请参阅此链接
Oracle supports an identifier with at most 30 characters and your identifier length
36
is greater than that.so make it 30 character in length.see this link
如果您从其他环境(例如 SQL Developer)成功执行 DML (UPDATE tableName SET ...),则您的 ASP.NET 代码一定以某种方式错误地指定或构造了表名或表的列名。如果 Oracle 在任何其他检查之前将其中任何一个解析为 > 30 个字符,则会抛出此异常。
正如 Srinivas 指出的那样,最大长度为 30,因此 36 个字符的标识符无法在 SQL Developer 中工作 - 您能否发布在 SQL Developer 中“工作”的语句?
If you are successfully executing DML (UPDATE tableName SET ...) from another environment such as SQL Developer, then your asp.net code must somehow be specifying or constructing the name of the table or a column name of the table incorrectly. Oracle will throw this exception if it parses either of these as >30 characters before any other checks.
As Srinivas pointed out, the maximum length is 30, so a 36 character identifier can't be working from SQL Developer - can you post the statement that is "working" in SQL Developer?
您的 SQL Developer 是否配置为使用多字节字符集?疯狂猜测,特别是因为我希望抛出
ORA-12899:值对于列来说太大
而不是ORA-00972。Is your SQL Developer configured to use a multi-byte character set? Wild guess, especially as I would expect that to throw
ORA-12899: value too large for column
rather than ORA-00972.啊,我明白了 - 这不是 36 个字符长的列名,而是实际数据。很高兴我们清理了这一点。
至于“为什么 ASP.NET SqlDataSource 会发生这种情况”,我怀疑在 ASCII 和 Unicode 之间的转换过程中出现了问题。 NVARCHAR2 是 Unicode,但我怀疑有些东西在 Unicode 世界中运行得不太好。检查一下你的网络服务器、你的客户端、你的数据库,以及你能想到的任何东西——我怀疑你会发现,在这条线上的某个地方,有一个 ASCII 客户端,它不能正确地处理 Unicode,而且正在变得混乱。大约 Unicode 字符串的长度(32 个 Unicode 字符占用 64 个字节(假设 UTF-16))。
祝你好运。
Ah, I see - it's not that column name that is 36 characters long, it's the actual data. Glad we cleared that one up.
As to "why is this happening from an ASP.NET SqlDataSource", I suspect that somewhere along the line there a problem converting between ASCII and Unicode. NVARCHAR2 is Unicode, but I suspect that something isn't playing nicely in the Unicode world. Check out you web server, your clients, your database, anything and everything you can think of - I suspect you'll find that somewhere along the line there's an ASCII client in there that doesn't talk Unicode properly, and is getting mixed up about the length of a Unicode string (32 Unicode characters take up 64 bytes (assuming UTF-16)).
Good luck.