|
All,
I'm going crazy with this SQL stmt - when run I get a 'Token ) was not valid. Valid tokens: + -" (after digits) message in the joblog. For the life of me, I don't see the problem. Is there an easier or more intuitive way of debugging embedded SQL?
'SELECT T4.trmifl, TIMESTAMP(T1.ISIHDATE, '+
'CAST(SUBSTR(DIGITS(T1.IHTIME),1,2)|| ''.'''+
'|| SUBSTR(DIGITS(T1.IHTIME),3,2) AS TIME) '+
' ), T1.ISIHDATE, CAST( SUBSTR(DIGITS '+
'(T1.IHTIME),1,2) || ''.'' || '+
'SUBSTR(DIGITS(T1.IHTIME),3,2) AS TIME ), '+
'T1.IHTIME, T3.IOSEQ, T2.IDACODE, '+
'T2.IDAVALU, T1.IHNOTE, T4.TRMIRS, '+
' T2.IDACOMM, T1.IHRECB, T4.TRRNAME, '+
' T4.TRMIDT, T4.TRMITM, '+
' TIMESTAMP(T1.ISIHDATE, CAST( '+
' SUBSTR(DIGITS(T1.IHTIME),1,2) || '+
' ''.'' || SUBSTR(DIGITS(T1.IHTIME) '+
' ,3,2) AS TIME ) ), '+
'TIMESTAMP(T4.ISTRTRDT , CAST(SUBSTR( '+
'DIGITS(T4.TRTRTM),1,2) ||''.''|| SUBSTR( '+
'DIGITS(T4.TRTRTM),3,2) ||''.''|| '+
'TIMESTAMP(T2.IDASYSDT , CAST( SUBSTR( '+
'DIGITS(T2.IDASYSTM),1,2))||''.''|| SUBSTR('+
'DIGITS(T2.IDASYSTM),3,2))||''.''|| '+
'SUBSTR(DIGITS(T2.IDASYSTM),5,2) AS TIME)),'+
' T2.IDASYSDT, CAST(SUBSTR(DIGITS '+
'(T2.IDASYSTM),1,2) '+
'||''.''|| SUBSTR(DIGITS(T2.IDASYSTM),3,2) '+
'||''.''|| SUBSTR(DIGITS(T2.IDASYSTM),5,2) '+
'AS TIME ) , '+
' TIMESTAMP(T4.TRMIDT, T4.TRMITM ) '+
' FROM SQAFC312.NCPIOHP T1 INNER JOIN '+
' NCPIODPA T2 ON
T1.IHPAT = T2.IDAPAT AND'+
' T1.ISIHDATE = T2.IDADATE AND '+
' T1.IHTIME = T2.IDATIME '+
' INNER JOIN NCIOMSP T3 On '+
' T2.IDACODE = T3.IOCODE '+
' INNER JOIN SQAFC312.NCTRNSP T4 ON'+
' T1.IHPAT = T4.TRPAT# and '+
' T1.ISIHDATE = T4.ISTRACDT AND
'+
' T1.IHTIME = T4.TRACTM AND '+
' T4.TRCODE = ''I'' '
As always, thanks for your advice and help.
Warmest Regards,
Richard Reeve
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.