java.sql.BatchUpdateException: 批处理中出现错误: ORA-00972: 标识符过长

xymfeng 2012-03-17 10:02:50
问题:java.sql.BatchUpdateException: 批处理中出现错误: ORA-00972: 标识符过长
弄了一天了,还是标识符过长,麻烦各位帮忙看下,到底在那地方出错了,谢谢!
SQL:
insert into fx_yl_card_acct (fx_account_id,fx_account_group_id,fx_account_suspend_code,fx_owner_org_id,fx_account_org_id,fx_manage_org_id,fx_account_open_date,fx_account_close_date,fx_account_expire_date,fx_product_id,fx_product_inner_id,fx_currency_code,fx_terms,fx_acct_status,fx_acct_cata,fx_acct_type_code,fx_account_balance,fx_account_name,fx_customer_id,fx_account_froze_code,fx_base_interest_rate,fx_float_interest_rate,fx_interest_rate_unit_codefx_interest_mode_code,fx_upda_date) values ('6217380000015034','null','null','50601','50601','90001','2012-02-15','null','null','null','null','CNY',null,'null','1','6',2.38,'康昌','140322198301041511','1',null,null,'null','null','2012-03-05');
表结构:
...全文
4436 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
xymfeng 2012-03-17
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 lxyzxq2008 的回复:]
还有,你给sql的字段和你给的表结构的字段根本对不上啊,第一个字段就在你的表定义中没有显示出来,你就不要贴图了,
把定义语句贴出来多好啊,最好按照表的顺序贴出来,上面太乱了!!!

查看表定义语句
>desc tablName;
[/Quote]
(
fx_account_id VARCHAR2(32) not null,
fx_account_group_id VARCHAR2(32),
fx_account_suspend_code VARCHAR2(2),
fx_owner_org_id VARCHAR2(20),
fx_account_org_id VARCHAR2(20),
fx_manage_org_id VARCHAR2(20),
fx_account_open_date VARCHAR2(10),
fx_account_close_date VARCHAR2(10),
fx_account_expire_date VARCHAR2(10),
fx_product_id VARCHAR2(10),
fx_product_inner_id VARCHAR2(16),
fx_currency_code VARCHAR2(3),
fx_terms NUMBER,
fx_acct_status VARCHAR2(2),
fx_acct_cata VARCHAR2(2),
fx_acct_type_code VARCHAR2(4),
fx_account_balance NUMBER(16,2),
fx_account_name VARCHAR2(60),
fx_customer_id VARCHAR2(20),
fx_account_froze_code VARCHAR2(2),
fx_base_interest_rate NUMBER(8,6),
fx_float_interest_rate NUMBER(6,4),
fx_interest_rate_unit_code VARCHAR2(2),
fx_interest_mode_code VARCHAR2(2),
fx_upda_date VARCHAR2(10)
)
xymfeng 2012-03-17
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 liangyike 的回复:]
兄弟是搞金融行业的吧?哪家公司的?

没记错的话,字段长度最大为30
你的 fx_interest_rate_unit_codefx_interest_mode_code 漏了逗号,二合一了。

写代码有点粗心,金融行业的软件工程师如此粗心,很危险。
[/Quote]
哈哈,新手,还没转正呢,老大直接把我一个人扔这了,很是郁闷啊
xymfeng 2012-03-17
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 lxyzxq2008 的回复:]
insert into fx_yl_card_acct (fx_account_id,fx_account_group_id,fx_account_suspend_code,fx_owner_org_id,fx_account_org_id,fx_manage_org_id,fx_account_open_date,fx_account_close_date,fx_account_expire_d……
[/Quote]
确实手误,改过来了
凉一刻 2012-03-17
  • 打赏
  • 举报
回复
兄弟是搞金融行业的吧?哪家公司的?

没记错的话,字段长度最大为30
你的 fx_interest_rate_unit_codefx_interest_mode_code 漏了逗号,二合一了。

写代码有点粗心,金融行业的软件工程师如此粗心,很危险。
xymfeng 2012-03-17
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 lxyzxq2008 的回复:]
你的sql中的那些"null"是什么东西啊,如果你要插入null,直接写null就可以了啊,为什么要加引号呢?
这样不会把null变成字符串null吗??
[/Quote]
这个传进来的值不知道是不是空啊。。。
sql = "insert into fx_yl_card_acct (fx_account_id,fx_account_group_id," +
"fx_account_suspend_code,fx_owner_org_id,fx_account_org_id,fx_manage_org_id," +
"fx_account_open_date,fx_account_close_date,fx_account_expire_date,fx_product_id,fx_product_inner_id," +
"fx_currency_code,fx_terms,fx_acct_status,fx_acct_cata,fx_acct_type_code,fx_account_balance,fx_account_name," +
"fx_customer_id,fx_account_froze_code,fx_base_interest_rate,fx_float_interest_rate,fx_interest_rate_unit_code," +
"fx_interest_mode_code,fx_upda_date" +
") values ('" + fx_account_id + "','"
+ fx_account_group_id + "','" + fx_account_suspend_code + "','"
+ fx_owner_org_id + "','" + fx_account_org_id + "','"
+ fx_manage_org_id + "','"+fx_account_open_date+"','"+fx_account_close_date+"','"+fx_account_expire_date+"','" + fx_product_id + "','" + fx_product_inner_id + "','"
+ fx_currency_code + "',"+fx_terms+",'" + fx_acct_status
+ "','" + fx_acct_cata + "','" + fx_acct_type_code + "',"+fx_account_balance+",'" + fx_account_name + "','"
+ fx_customer_id + "','" + fx_account_froze_code + "',"+fx_base_interest_rate+","+fx_float_interest_rate+",'"+fx_interest_rate_unit_code+"','"+ fx_interest_mode_code + "','"+fx_upda_date+"');";
n++;
lxyzxq2008 2012-03-17
  • 打赏
  • 举报
回复
insert into fx_yl_card_acct (fx_account_id,fx_account_group_id,fx_account_suspend_code,fx_owner_org_id,fx_account_org_id,fx_manage_org_id,fx_account_open_date,fx_account_close_date,fx_account_expire_date,fx_product_id,fx_product_inner_id,fx_currency_code,fx_terms,fx_acct_status,fx_acct_cata,fx_acct_type_code,fx_account_balance,fx_account_name,fx_customer_id,fx_account_froze_code,fx_base_interest_rate,fx_float_interest_rate,fx_interest_rate_unit_code[color=#000080],fx_interest_mode_code[/color],fx_upda_date) values ('6217380000015034','null','null','50601','50601','90001','2012-02-15','null','null','null','null','CNY',null,'null','1','6',2.38,'康昌','140322198301041511','1',null,null,'null','null','2012-03-05');

--这个应该是手误吧?要不应该报字段不存在啊
cowboyhn 2012-03-17
  • 打赏
  • 举报
回复
你输入的fx_interest_rate_unit_codefx_interest_mode_code这个字段太长了,也许是漏了个逗号吧。
lxyzxq2008 2012-03-17
  • 打赏
  • 举报
回复
还有,你给sql的字段和你给的表结构的字段根本对不上啊,第一个字段就在你的表定义中没有显示出来,你就不要贴图了,
把定义语句贴出来多好啊,最好按照表的顺序贴出来,上面太乱了!!!

查看表定义语句
>desc tablName;
lxyzxq2008 2012-03-17
  • 打赏
  • 举报
回复
你的sql中的那些"null"是什么东西啊,如果你要插入null,直接写null就可以了啊,为什么要加引号呢?
这样不会把null变成字符串null吗??
「已注销」 2012-03-17
  • 打赏
  • 举报
回复
fx_account_suspend_code VARCHAR2(2),你插入的值是'null',去掉引号或减小长度

17,382

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧