PeopleSoft:发生 SQL 错误。有关详细信息,请查阅您的系统日志
PeopleSoft: A SQL error occured. Please consult your system log for details
在我的 PS 查询上单击 HTML link 时,出现错误:发生 SQL 错误。有关详细信息,请查阅您的系统日志。我想知道这个错误的原因是什么,如果它是我的 PS 查询,因为它非常简单。请参阅下面的 SQL:
SELECT A.EMPLID, A.ACAD_CAREER, A.STDNT_CAR_NBR, A.ADM_APPL_NBR,
A.INSTITUTION, A.SAD_PB_CAS_STATDT
FROM PS_SAD_PB_CAS A, PS_ADM_APPL_PROG B, PS_ADM_MAINT_SCTY B1,
PS_SCC_PS_ADMA_BND C, PS_ADM_APPL_SCTY C1
WHERE ( B.EMPLID = B1.EMPLID
AND B.ACAD_CAREER = B1.ACAD_CAREER
AND B.STDNT_CAR_NBR = B1.STDNT_CAR_NBR
AND B.ADM_APPL_NBR = B1.ADM_APPL_NBR
AND B.APPL_PROG_NBR = B1.APPL_PROG_NBR
AND C.EMPLID = C1.EMPLID
AND C.ACAD_CAREER = C1.ACAD_CAREER
AND C.ADM_APPL_NBR = C1.ADM_APPL_NBR
AND C.INSTITUTION = C1.INSTITUTION
AND ( A.EFFDT =
(SELECT MAX(A_ED.EFFDT) FROM PS_SAD_PB_CAS A_ED
WHERE A.EMPLID = A_ED.EMPLID
AND A.INSTITUTION = A_ED.INSTITUTION
AND A.SAD_PB_REC_TYPE = A_ED.SAD_PB_REC_TYPE
AND A.ACAD_CAREER = A_ED.ACAD_CAREER
AND A.STDNT_CAR_NBR = A_ED.STDNT_CAR_NBR
AND A.SAD_PB_REC_NUMBER = A_ED.SAD_PB_REC_NUMBER
AND A.ADM_APPL_NBR = A_ED.ADM_APPL_NBR
AND A.APPL_PROG_NBR = A_ED.APPL_PROG_NBR
AND A_ED.EFFDT <= SYSDATE)
AND A.EFFSEQ =
(SELECT MAX(A_ES.EFFSEQ) FROM PS_SAD_PB_CAS A_ES
WHERE A.EMPLID = A_ES.EMPLID
AND A.INSTITUTION = A_ES.INSTITUTION
AND A.SAD_PB_REC_TYPE = A_ES.SAD_PB_REC_TYPE
AND A.ACAD_CAREER = A_ES.ACAD_CAREER
AND A.STDNT_CAR_NBR = A_ES.STDNT_CAR_NBR
AND A.SAD_PB_REC_NUMBER = A_ES.SAD_PB_REC_NUMBER
AND A.ADM_APPL_NBR = A_ES.ADM_APPL_NBR
AND A.APPL_PROG_NBR = A_ES.APPL_PROG_NBR
AND A.EFFDT = A_ES.EFFDT)
AND A.EMPLID = B.EMPLID
AND A.ACAD_CAREER = B.ACAD_CAREER
AND A.STDNT_CAR_NBR = B.STDNT_CAR_NBR
AND A.ADM_APPL_NBR = B.ADM_APPL_NBR
AND A.APPL_PROG_NBR = B.APPL_PROG_NBR
AND B.EFFDT =
(SELECT MAX(B_ED.EFFDT) FROM PS_ADM_APPL_PROG B_ED
WHERE B.EMPLID = B_ED.EMPLID
AND B.ACAD_CAREER = B_ED.ACAD_CAREER
AND B.STDNT_CAR_NBR = B_ED.STDNT_CAR_NBR
AND B.ADM_APPL_NBR = B_ED.ADM_APPL_NBR
AND B.APPL_PROG_NBR = B_ED.APPL_PROG_NBR
AND B_ED.EFFDT <= A.EFFDT)
AND B.EFFSEQ =
(SELECT MAX(B_ES.EFFSEQ) FROM PS_ADM_APPL_PROG B_ES
WHERE B.EMPLID = B_ES.EMPLID
AND B.ACAD_CAREER = B_ES.ACAD_CAREER
AND B.STDNT_CAR_NBR = B_ES.STDNT_CAR_NBR
AND B.ADM_APPL_NBR = B_ES.ADM_APPL_NBR
AND B.APPL_PROG_NBR = B_ES.APPL_PROG_NBR
AND B.EFFDT = B_ES.EFFDT)
AND A.EMPLID = C.EMPLID
AND A.INSTITUTION = C.INSTITUTION
AND A.ACAD_CAREER = C.ACAD_CAREER
AND A.STDNT_CAR_NBR = C.STDNT_CAR_NBR
AND A.ADM_APPL_NBR = C.ADM_APPL_NBR
AND to_date( A.SAD_PB_CAS_STATDT,'DD-MON-YY') = to_date(sysdate,'DD-MON-YY')
AND A.SAD_PB_CAS_STATUS IN ('ASG','USD') ));
谁能帮我解决这个错误?非常感谢。
这部分看起来不对:
to_date(a.sad_pb_cas_statdt,'DD-MON-YY') = to_date(sysdate,'DD-MON-YY')
sysdate
已经是一个日期(sad_pb_cas_statdt
可能也是),因此对其应用任何字符函数都是自找麻烦。如果 nls_date_format
设置为与指定格式 'DD-MON-YY'
不兼容的任何内容,它将失败。 (例如,您可以使用 'DD-MON-RRRR'
,但不能使用 YYYY-MM-DD
。)
尝试将其更改为:
a.sad_pb_cas_statdt >= trunc(sysdate) and a.sad_pb_cas_statdt < trunc(sysdate) +1
或
a.sad_pb_cas_statdt between trunc(sysdate) and trunc(sysdate) + interval '86399' second
在我的 PS 查询上单击 HTML link 时,出现错误:发生 SQL 错误。有关详细信息,请查阅您的系统日志。我想知道这个错误的原因是什么,如果它是我的 PS 查询,因为它非常简单。请参阅下面的 SQL:
SELECT A.EMPLID, A.ACAD_CAREER, A.STDNT_CAR_NBR, A.ADM_APPL_NBR,
A.INSTITUTION, A.SAD_PB_CAS_STATDT
FROM PS_SAD_PB_CAS A, PS_ADM_APPL_PROG B, PS_ADM_MAINT_SCTY B1,
PS_SCC_PS_ADMA_BND C, PS_ADM_APPL_SCTY C1
WHERE ( B.EMPLID = B1.EMPLID
AND B.ACAD_CAREER = B1.ACAD_CAREER
AND B.STDNT_CAR_NBR = B1.STDNT_CAR_NBR
AND B.ADM_APPL_NBR = B1.ADM_APPL_NBR
AND B.APPL_PROG_NBR = B1.APPL_PROG_NBR
AND C.EMPLID = C1.EMPLID
AND C.ACAD_CAREER = C1.ACAD_CAREER
AND C.ADM_APPL_NBR = C1.ADM_APPL_NBR
AND C.INSTITUTION = C1.INSTITUTION
AND ( A.EFFDT =
(SELECT MAX(A_ED.EFFDT) FROM PS_SAD_PB_CAS A_ED
WHERE A.EMPLID = A_ED.EMPLID
AND A.INSTITUTION = A_ED.INSTITUTION
AND A.SAD_PB_REC_TYPE = A_ED.SAD_PB_REC_TYPE
AND A.ACAD_CAREER = A_ED.ACAD_CAREER
AND A.STDNT_CAR_NBR = A_ED.STDNT_CAR_NBR
AND A.SAD_PB_REC_NUMBER = A_ED.SAD_PB_REC_NUMBER
AND A.ADM_APPL_NBR = A_ED.ADM_APPL_NBR
AND A.APPL_PROG_NBR = A_ED.APPL_PROG_NBR
AND A_ED.EFFDT <= SYSDATE)
AND A.EFFSEQ =
(SELECT MAX(A_ES.EFFSEQ) FROM PS_SAD_PB_CAS A_ES
WHERE A.EMPLID = A_ES.EMPLID
AND A.INSTITUTION = A_ES.INSTITUTION
AND A.SAD_PB_REC_TYPE = A_ES.SAD_PB_REC_TYPE
AND A.ACAD_CAREER = A_ES.ACAD_CAREER
AND A.STDNT_CAR_NBR = A_ES.STDNT_CAR_NBR
AND A.SAD_PB_REC_NUMBER = A_ES.SAD_PB_REC_NUMBER
AND A.ADM_APPL_NBR = A_ES.ADM_APPL_NBR
AND A.APPL_PROG_NBR = A_ES.APPL_PROG_NBR
AND A.EFFDT = A_ES.EFFDT)
AND A.EMPLID = B.EMPLID
AND A.ACAD_CAREER = B.ACAD_CAREER
AND A.STDNT_CAR_NBR = B.STDNT_CAR_NBR
AND A.ADM_APPL_NBR = B.ADM_APPL_NBR
AND A.APPL_PROG_NBR = B.APPL_PROG_NBR
AND B.EFFDT =
(SELECT MAX(B_ED.EFFDT) FROM PS_ADM_APPL_PROG B_ED
WHERE B.EMPLID = B_ED.EMPLID
AND B.ACAD_CAREER = B_ED.ACAD_CAREER
AND B.STDNT_CAR_NBR = B_ED.STDNT_CAR_NBR
AND B.ADM_APPL_NBR = B_ED.ADM_APPL_NBR
AND B.APPL_PROG_NBR = B_ED.APPL_PROG_NBR
AND B_ED.EFFDT <= A.EFFDT)
AND B.EFFSEQ =
(SELECT MAX(B_ES.EFFSEQ) FROM PS_ADM_APPL_PROG B_ES
WHERE B.EMPLID = B_ES.EMPLID
AND B.ACAD_CAREER = B_ES.ACAD_CAREER
AND B.STDNT_CAR_NBR = B_ES.STDNT_CAR_NBR
AND B.ADM_APPL_NBR = B_ES.ADM_APPL_NBR
AND B.APPL_PROG_NBR = B_ES.APPL_PROG_NBR
AND B.EFFDT = B_ES.EFFDT)
AND A.EMPLID = C.EMPLID
AND A.INSTITUTION = C.INSTITUTION
AND A.ACAD_CAREER = C.ACAD_CAREER
AND A.STDNT_CAR_NBR = C.STDNT_CAR_NBR
AND A.ADM_APPL_NBR = C.ADM_APPL_NBR
AND to_date( A.SAD_PB_CAS_STATDT,'DD-MON-YY') = to_date(sysdate,'DD-MON-YY')
AND A.SAD_PB_CAS_STATUS IN ('ASG','USD') ));
谁能帮我解决这个错误?非常感谢。
这部分看起来不对:
to_date(a.sad_pb_cas_statdt,'DD-MON-YY') = to_date(sysdate,'DD-MON-YY')
sysdate
已经是一个日期(sad_pb_cas_statdt
可能也是),因此对其应用任何字符函数都是自找麻烦。如果 nls_date_format
设置为与指定格式 'DD-MON-YY'
不兼容的任何内容,它将失败。 (例如,您可以使用 'DD-MON-RRRR'
,但不能使用 YYYY-MM-DD
。)
尝试将其更改为:
a.sad_pb_cas_statdt >= trunc(sysdate) and a.sad_pb_cas_statdt < trunc(sysdate) +1
或
a.sad_pb_cas_statdt between trunc(sysdate) and trunc(sysdate) + interval '86399' second