2 Replies Latest reply on Aug 21, 2014 1:39 PM by Dan Cory

    custom SQL issue using iSeries Access ODBC Driver connect to DB2 on AS400

    Benson Zhao

      I came across a issue using parameter in custom SQL using iSeries Access ODBC Driver.

       

      Using below SQL will be fine

      ++

      select T2."LHYEAR" "Year" , T2."LHPERD" "Period" , T1."CRSG03" "Account Code" , T2."LHDATE" "Transaction Date" , T2."LHGLDT" "Posting Date" , T2."LHDRAM" "Debit Book Currency" , T2."LHCRAM" "Credit Book Currency" , T1."CRSG02" "Cost Center"

      from ABPSLF.GLH T2, ABPSLF.GCR T1

      where LHIAN = CRIAN AND LHYEAR >= 2013

      ++

       

      However, if i replace "ABPSLF" to a parameter in the where clause, there will be a error. Please refer to below attached pic.

      ++

      select T2."LHYEAR" "Year" , T2."LHPERD" "Period" , T1."CRSG03" "Account Code" , T2."LHDATE" "Transaction Date" , T2."LHGLDT" "Posting Date" , T2."LHDRAM" "Debit Book Currency" , T2."LHCRAM" "Credit Book Currency" , T1."CRSG02" "Cost Center"

      from <Parameters.Company>.GLH T2, <Parameters.Company>.GCR T1

      where LHIAN = CRIAN AND LHYEAR >= 2013

      ++

      1.jpg

       

       

      Please kindly advise.

       

      Thanks,

      Billy