奇怪的 Oracle 错误:标识符太长 ORA-00972

发布于 2024-12-13 05:25:33 字数 2040 浏览 1 评论 0原文

我在使用ORACLE 10g时遇到过这个问题。我在这里阅读了对此问题的答案(ora-00972 标识符太长 oracle 10g) 堆栈溢出,但它们对我不起作用。也许我的情况有所不同。

现在我有这些表名称:WIMAX_TRAFFIC_STATSWIMAX_RADIO_STATS。当我尝试使用 Erlang/OTP,我收到错误:

{error,"[DataDirect][ODBC Oracle Wire Protocol driver][Oracle]ORA-00972: 
identifier is toolong SQLSTATE IS: HY000"}
So, i searched google and found answers saying that maybe my table names are too long. So i did this below and tried again:
SQL> ALTER TABLE WIMAX_RADIO_STATS RENAME TO WR;
Table altered.
SQL> ALTER TABLE WIMAX_TRAFFIC_STATS RENAME TO WT;
Table altered.
I am still getting the same error. Other sources sya that it could be the data i am writing in some of my columns. My table definitions are here below:

SQL> DESCRIBE WT;
 Name                                      Null?    Type
 ----------------------------------------- -------- -----------------
 SDATE                                              DATE
 ELEMENT_TYPE                                       VARCHAR2(50)
 MANAGED_ELEMENT                                    VARCHAR2(50)
 USER_LABEL                                         VARCHAR2(200)
 JOB_ID                                             VARCHAR2(50)
 MEAS_TYPE                                          VARCHAR2(50)
 MEAS_VALUE                                         VARCHAR2(50)

我在那里写入的数据值都不长于列长度定义。我真的很想知道。我尝试在表中写入长度小于 10 个字符的字符串,但仍然收到此错误。 请提供一些身体帮助!

编辑

示例查询请求如下:

INSERT INTO WT(element_type,managed_element,user_label,job_id,meas_type,
meas_value) VALUES("BreezeMAX MBS",
"SubNetwork=ASN,MeContext=,ManagedElement=MBS.172.17.9.9",
"BMAX-Shoal2[MTN-Egate]",
"99297","rbMngmntPortPacketsDiscardedOnRx","0");

SDATE 字段默认设置为 sysdate

I have faced this problem when working with ORACLE 10g. I read the answers given to this question here (ora-00972 identifier is too long oracle 10g) on stack overflow but they have not worked for me. Perhaps my situation is different.

Now i had these table names:WIMAX_TRAFFIC_STATS and WIMAX_RADIO_STATS. When i tried inserting data into them through an ODBC Connection with Erlang/OTP, i got the error:

{error,"[DataDirect][ODBC Oracle Wire Protocol driver][Oracle]ORA-00972: 
identifier is toolong SQLSTATE IS: HY000"}

So, i searched google and found answers saying that maybe my table names are too long. So i did this below and tried again:

SQL> ALTER TABLE WIMAX_RADIO_STATS RENAME TO WR;
Table altered.
SQL> ALTER TABLE WIMAX_TRAFFIC_STATS RENAME TO WT;
Table altered.

I am still getting the same error. Other sources sya that it could be the data i am writing in some of my columns. My table definitions are here below:


SQL> DESCRIBE WT;
 Name                                      Null?    Type
 ----------------------------------------- -------- -----------------
 SDATE                                              DATE
 ELEMENT_TYPE                                       VARCHAR2(50)
 MANAGED_ELEMENT                                    VARCHAR2(50)
 USER_LABEL                                         VARCHAR2(200)
 JOB_ID                                             VARCHAR2(50)
 MEAS_TYPE                                          VARCHAR2(50)
 MEAS_VALUE                                         VARCHAR2(50)

None of the data values i write there is longer than the column length definition. I really wonder. Am attempting to write strings that are less than 10 characters long in the table but yet still getting this error. Some body help, please !

EDIT

SAMPLE query request is as follows:

INSERT INTO WT(element_type,managed_element,user_label,job_id,meas_type,
meas_value) VALUES("BreezeMAX MBS",
"SubNetwork=ASN,MeContext=,ManagedElement=MBS.172.17.9.9",
"BMAX-Shoal2[MTN-Egate]",
"99297","rbMngmntPortPacketsDiscardedOnRx","0");

The SDATE field has a default set as sysdate

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽袖吟 2024-12-20 05:25:33

您使用了错误的引号。

VALUES('BreezeMAX MBS',
       ^             ^

演示:

SQL> create table t (a varchar(100));
Table created.

SQL> insert into t(a) values ("qasdqsdqsdqsdqsdqsdqsdlmqmsldqsmldqsmldq");
insert into t(a) values ("qasdqsdqsdqsdqsdqsdqsdlmqmsldqsmldqsmldq")
                         *
ERROR at line 1:
ORA-00972: identifier is too long

SQL> insert into t(a) values ('qasdqsdqsdqsdqsdqsdqsdlmqmsldqsmldqsmldq');
1 row created.

You're using the wrong quotes.

VALUES('BreezeMAX MBS',
       ^             ^

Demo:

SQL> create table t (a varchar(100));
Table created.

SQL> insert into t(a) values ("qasdqsdqsdqsdqsdqsdqsdlmqmsldqsmldqsmldq");
insert into t(a) values ("qasdqsdqsdqsdqsdqsdqsdlmqmsldqsmldqsmldq")
                         *
ERROR at line 1:
ORA-00972: identifier is too long

SQL> insert into t(a) values ('qasdqsdqsdqsdqsdqsdqsdlmqmsldqsmldqsmldq');
1 row created.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文