Is there a way to use a variable in the From SQL statement, I tried FILE and it fails to compile, when I use @FILE by itself it will compile but in the joblog it says it can't find the file *LIBL/@FILE, any suggestions
@FILE is a file name that is passed earlier in the program
SQL Statement..................
C $InsertSql BEGSR
C/EXEC SQL SET TRANSACTION ISOLATION LEVEL NO COMMIT
C/END-EXEC
C/EXEC SQL
C+ INSERT INTO FLLDSUPWP
C+ (WPFILE,WPRECD,WPDATE,WPUSER,WPPGM)
C+ SELECT FILE,COUNT(*),:ISO_DATE,:USRNAM,GMNAM
C+ FROM FILE
C/END-EXEC
*
C ENDSR
Compile Error...............................
SQL0104 30 80 Position 19 Token : was not valid. Valid tokens: ( TABLE LATERAL <IDENTIFIER>.
@FILE is a file name that is passed earlier in the program
SQL Statement..................
C $InsertSql BEGSR
C/EXEC SQL SET TRANSACTION ISOLATION LEVEL NO COMMIT
C/END-EXEC
C/EXEC SQL
C+ INSERT INTO FLLDSUPWP
C+ (WPFILE,WPRECD,WPDATE,WPUSER,WPPGM)
C+ SELECT FILE,COUNT(*),:ISO_DATE,:USRNAM,GMNAM
C+ FROM FILE
C/END-EXEC
*
C ENDSR
Compile Error...............................
SQL0104 30 80 Position 19 Token : was not valid. Valid tokens: ( TABLE LATERAL <IDENTIFIER>.