I am using the below code in R but I have a small problem I can't find the solution. Because I will have many WHERE TE_ID = *** AND TE_ID = *** AND ... AND
I am trying to find a simple way to assign the numbers (02343) to variables, if it is possible out of the query.
So in practice, I have 300 different TE_ID. What is a way to avoid adding 100 AND, or any other way that will help me
jdbcDriver <- JDBC(driverClass="oracle.jdbc.OracleDriver", classPath="lib/ojdbc6.jar")
jdbcConnection <- dbConnect(jdbcDriver, "jdbc:oracle:thin:@//database.hostname.com:port/service_name_or_sid", "username", "password")
MyData <- dbGetQuery(jdbcConnection,"SELECT VALUE,DATA_POINT_DATE
FROM HD.HD_SE_HAM
WHERE TE_ID = 02342
and end_date = to_date('31/12/9999', 'dd/mm/yyyy')
and DATA_SKATA_DATE Between '01-Jan-10 ' and '30-Jun-13'
order by data_skata_date asc")