ora-00972 identifier is too long oracle 10g

那年仲夏 提交于 2019-12-10 23:17:09

问题


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?


回答1:


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




回答2:


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?




回答3:


SERVICE_ID NVARCHAR2(36) NOT NULL

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.




回答4:


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.



来源:https://stackoverflow.com/questions/2788031/ora-00972-identifier-is-too-long-oracle-10g

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!