政府机关updateinsert

informix一个update语句报错

create temp table shh(bankcode CHAR(12),BusinessCode        CHAR(15)) with no log;load from jf1.unl delimiter '|'insert into shh;update prpjfcombus set bankcode=(select a.bankcode from shh a  where a.BusinessCode=prpjfco...显示全部
create temp table shh
(
bankcode CHAR(12),
BusinessCode        CHAR(15)
)
with no log;

load from jf1.unl delimiter '|'
insert into shh;

update prpjfcombus set bankcode=
(select a.bankcode from shh a
  where a.BusinessCode=prpjfcombus.BusinessCode
    );

运行上面语句报错:
391: Cannot insert a null into column (prpjfcombus.bankcode).
Error in line 4
Near character position 4

麻烦大家帮忙分析一下。

jf1.unl:
0801025500|898430159600500
0801025500|898430159604401
0801025500|898430159604501
0801025500|898430159604601
0801025500|898430159604701
0801025500|898430159604801
0801025500|898430159604901
0801025500|898430159605001
0801025500|898430159605101
0801025500|898430159605201
0801025500|898430159605301
0801025500|898430159605401
0801025500|898430163000234
0801025500|898430163000235
0801025500|898430163000236
0801025500|898430163000237
0801025500|898430163000238
0801025500|898430292231488
0801025500|898430163000239
0801025500|898430163000240
0801025500|898430163000241
0801025500|898430163000242
0801025500|898430163000243
0801025500|898430163000244
0801025500|898430163000267
0801025500|898430192230169
0801025500|898430359601506
0801025500|898430359601504
0801025500|898430359601500
0801025500|898430292231497
0801025500|898430292231491
0801025500|898430192230170
0801025500|898430192230171收起
参与10

查看其它 9 个回答wisefox的回答

wisefoxwisefoxCIOccc
加where 条件

where exists
(select 1  from shh b where b.BusinessCode=prpjfcombus.BusinessCode)
互联网服务 · 2011-08-25
浏览981

回答者

wisefox
CIOccc

wisefox 最近回答过的问题

回答状态

  • 发布时间:2011-08-25
  • 关注会员:0 人
  • 回答浏览:981
  • X社区推广