Issue with DS Server Routine
Posted: Wed Nov 11, 2015 3:49 am
I am using DataStage server routine to connect and extract data from DB2 table.
Its running fine when '1'='1' used in where clause
DB2CntCmd = " db2 connect to " :DBName : " user " :User : " using " : Password
ResultText = @Null
Call DSExecute("UNIX", DB2CntCmd, ResultText, SystemReturnCode)
RET_REQ = "db2 -x " : "'SELECT MAX ( LAST_UPDT_DT ) FROM OZR00UC1.OXIUPD WHERE '1' = '1' WITH UR'"
Call DSExecute("UNIX", RET_REQ , ResultText, SystemReturnCode)
Ans=ResultText
Return(Ans)
But facing issue when i am using below query
RET_REQ = "db2 -x " : "'SELECT MAX ( LAST_UPDT_DT ) FROM OZR00UC1.OXIUPD WHERE 'c' = 'c' WITH UR'"
Prob is - I am not able to use any kind of Varchar field in where clause of the query
Its running fine when '1'='1' used in where clause
DB2CntCmd = " db2 connect to " :DBName : " user " :User : " using " : Password
ResultText = @Null
Call DSExecute("UNIX", DB2CntCmd, ResultText, SystemReturnCode)
RET_REQ = "db2 -x " : "'SELECT MAX ( LAST_UPDT_DT ) FROM OZR00UC1.OXIUPD WHERE '1' = '1' WITH UR'"
Call DSExecute("UNIX", RET_REQ , ResultText, SystemReturnCode)
Ans=ResultText
Return(Ans)
But facing issue when i am using below query
RET_REQ = "db2 -x " : "'SELECT MAX ( LAST_UPDT_DT ) FROM OZR00UC1.OXIUPD WHERE 'c' = 'c' WITH UR'"
Prob is - I am not able to use any kind of Varchar field in where clause of the query