在应用程序设计器上构建视图时出错“指定的列名称数目无效”

时间:2019-05-22 17:57:43

标签: oracle peoplesoft peoplecode

SELECT EMPLID
, LST_ASGN_START_DT  
  FROM PS_JOB A 
 WHERE A.EFFDT = ( 
 SELECT MAX(EFFDT) 
  FROM PS_JOB 
 WHERE A.EMPLID = EMPLID 
   AND A.EMPL_RCD = EMPL_RCD 
   AND EFFDT <= SYSDATE ) 
   AND A.EFFSEQ = ( 
 SELECT MAX(EFFSEQ) 
  FROM PS_JOB 
 WHERE A.EMPLID = EMPLID 
   AND A.EMPL_RCD = EMPL_RCD 
   AND A.EFFDT = EFFDT ) 
   AND HR_STATUS='A'

当直接在数据库上运行它时,我没有收到任何错误,但是当我在应用程序设计器上编译并构建它时,出现了“指定的列名数量无效”的错误

我也尝试过这种方法,但是仍然遇到相同的错误。

SELECT A.EMPLID 
 , A.LST_ASGN_START_DT 
  FROM PS_JOB A 
 WHERE A.EFFDT = ( 
 SELECT MAX(EFFDT) 
  FROM PS_JOB 
 WHERE A.EMPLID = EMPLID 
   AND A.EMPL_RCD = EMPL_RCD 
   AND EFFDT <= SYSDATE ) 
   AND A.EFFSEQ = ( 
 SELECT MAX(EFFSEQ) 
  FROM PS_JOB 
 WHERE A.EMPLID = EMPLID 
   AND A.EMPL_RCD = EMPL_RCD 
   AND A.EFFDT = EFFDT ) 
   AND A.HR_STATUS='A'

这也没什么。

SELECT A.EMPLID 
 , A.LST_ASGN_START_DT 
  FROM PS_JOB A 
 WHERE A.EFFDT = ( 
 SELECT MAX(EFFDT) 
  FROM PS_JOB B 
 WHERE A.EMPLID = B.EMPLID 
   AND A.EMPL_RCD = B.EMPL_RCD 
   AND B.EFFDT <= SYSDATE ) 
   AND A.EFFSEQ = ( 
 SELECT MAX(EFFSEQ) 
  FROM PS_JOB C 
 WHERE A.EMPLID = C.EMPLID 
   AND A.EMPL_RCD = C.EMPL_RCD 
   AND A.EFFDT = C.EFFDT ) 
   AND A.HR_STATUS='A'

1 个答案:

答案 0 :(得分:2)

您选择的列有两列,并且记录定义上的列数可能不同。 sql语句和记录定义应具有相同的列数(但不必具有相同的字段名)

看这个例子: 记录有5个字段 enter image description here

并选择具有5个字段: enter image description here