0

我一直在尝试将有效的“INSERT”调整为 SELECT 语句并不断发现错误 -104

a)有人可以帮我理解“。”的原因吗?当我使用“插入”运行时,“where”子句(如下)有效,但在“select”子句上使用时出现错误?b) 使用 SELECT 时应如何正确编写“INSERT”标准?

非常感谢您在此问题上提供的任何帮助

插入:

 INSERT INTO  SISPD2.SIS_DAILY_RECALC                            
         (CIN_NUM,PGM_DIV_FG,NON_CA_FG,PGM_EXCPT_FG,WTW_FG)   
 (SELECT C.CIN_NUM, C.PGM_DIV_FG, C.NON_CA_FG, C.PGM_EXCPT_FG,
         C.WTW_FG                                             
    FROM  SISPD2.SIS_INDV C                                  
   WHERE C.CIN_NUM NOT IN (SELECT CIN_NUM FROM  SISPD2.SIS_DAILY_RECALC)                       

-------------------------------------------------- ----------------------

选择 :

    SELECT C.CIN_NUM  ||','||                                          
         C.PGM_DIV_FG ||','||                                        
         C.NON_CA_FG  ||','||                                        
         C.PGM_EXCPT_FG ||','||                                     
         C.WTW_FG   ||','||                                        
  WHERE (C.CIN_NUM NOT IN (SELECT A.CIN_NUM                        
                            FROM  SISPD2.SIS_DAILY_RECALC A));      

DSNT408I SQLCODE = -104,错误:非法符号“.”。一些可能是合法的符号
是:,从 INTO
DSNT418I SQLSTATE = 42601 SQLSTATE 返回代码

4

1 回答 1

0

除非您正在构建您打算PREPAREEXECUTE

 SELECT C.CIN_NUM  
         , C.PGM_DIV_FG
         , C.NON_CA_FG
         , C.PGM_EXCPT_FG
         , C.WTW_FG
  WHERE (C.CIN_NUM NOT IN (SELECT A.CIN_NUM
                            FROM  SISPD2.SIS_DAILY_RECALC A)); 
于 2016-06-21T18:45:59.130 回答