z / os DB2 V 9.1多行插入失败错误代码-104

时间:2015-09-03 19:51:51

标签: db2 zos

插入单行成功,但插入多行无效。

INSERT INTO EMPLYEE(EMPID,EMPNAME,DEPARTMENT,SALARY,DESIGNATION) 
VALUES('1000','XXXXXXX','XX',10000,'SE'),                        
  ('1001','YYYYYYY','YY',9000,'SE'),                         
  ('1002','ZZZZZZZ','ZZ',20000,'MA');

1 个答案:

答案 0 :(得分:0)

DB2 for z / OS不支持使用值列表,其中完全选择是合适的。您可以使用下面的选择。它有点笨拙,但它有效:

INSERT INTO tableName (col1, col2, col3, col4, col5) 
  SELECT val1, val2, val3, val4, val5 FROM SYSIBM.SYSDUMMY1 UNION ALL
  SELECT val1, val2, val3, val4, val5 FROM SYSIBM.SYSDUMMY1 UNION ALL
  SELECT val1, val2, val3, val4, val5 FROM SYSIBM.SYSDUMMY1 UNION ALL
  SELECT val1, val2, val3, val4, val5 FROM SYSIBM.SYSDUMMY1