EXEC SQL SET TRANSACTION ISOLATION LEVEL NO COMMIT
END-EXEC
EXEC SQL
INSERT INTO MELBRCOSP
(LBREGN, LBSITE, LBLEMP, LBLHRS, LBSHRS, LBLETM, LBLDAT,
LBCDAT,LBCRTD, LBCRTT, LBCRTU, LBCRTP)
SELECT CRCTAC, OLSITE, OLEMP, SUM(OLLHRS)/COUNT(DISTINCT TLRETM),
SUM(OLSHRS)/COUNT(DISTINCT TLRETM),
SUM(DISTINCT TLRETM),OLDATE,TLRTIM,
:MDY_DATE2,HHMM, :USRNAM, GMNAM
FROM FLOL LEFT JOIN FLEM ON OLEMP = EMCODE
LEFT JOIN CKTIMHIM ON EMSSNO = TLEMPN
LEFT JOIN FLCR ON OLSITE = CRSITE
WHERE OLDATE BETWEEN SCYMD AND ECYMD
AND TRIM(TLPC01) <> 'HP' AND TRIM(TLPC01) <> 'MLEAD'
AND TRIM(TLPC01) <> 'SK' AND TRIM(TLPC01) <> 'VA'
AND TRIM(TLPC01) <> 'FHP'
AND TLRTIM BETWEEN START_KRONOS AND END_KRONOS
GROUP BY CRCTAC, OLSITE, OLEMP, OLDATE
ORDER BY CRCTAC, OLSITE, OLEMP, OLDATE
For Some Reason the SQL precompile fails stating:
Position 45 Column TLRTIM or expression in SELECT list
not valid.
END-EXEC
EXEC SQL
INSERT INTO MELBRCOSP
(LBREGN, LBSITE, LBLEMP, LBLHRS, LBSHRS, LBLETM, LBLDAT,
LBCDAT,LBCRTD, LBCRTT, LBCRTU, LBCRTP)
SELECT CRCTAC, OLSITE, OLEMP, SUM(OLLHRS)/COUNT(DISTINCT TLRETM),
SUM(OLSHRS)/COUNT(DISTINCT TLRETM),
SUM(DISTINCT TLRETM),OLDATE,TLRTIM,
:MDY_DATE2,HHMM, :USRNAM, GMNAM
FROM FLOL LEFT JOIN FLEM ON OLEMP = EMCODE
LEFT JOIN CKTIMHIM ON EMSSNO = TLEMPN
LEFT JOIN FLCR ON OLSITE = CRSITE
WHERE OLDATE BETWEEN SCYMD AND ECYMD
AND TRIM(TLPC01) <> 'HP' AND TRIM(TLPC01) <> 'MLEAD'
AND TRIM(TLPC01) <> 'SK' AND TRIM(TLPC01) <> 'VA'
AND TRIM(TLPC01) <> 'FHP'
AND TLRTIM BETWEEN START_KRONOS AND END_KRONOS
GROUP BY CRCTAC, OLSITE, OLEMP, OLDATE
ORDER BY CRCTAC, OLSITE, OLEMP, OLDATE
For Some Reason the SQL precompile fails stating:
Position 45 Column TLRTIM or expression in SELECT list
not valid.