Five Stars

Passing Implicit context variables to the Source Query

Hi All,


Please let me know on how to handle the below scenario

My plan is to load data from a Source table based on a date value, In my current setup I'm using Implicit context variables (Pulling context variables from Database).


I'm using the LastRunDate context variable from the context variable table and using it in my source query, But this is not working, 

something like the below query

Please note that the source is Oracle and hence the query is formatted to match Oracle query standards

"select * from table where create_date > TO_DATE("+context.LastRunDate+",'MON DD YYYY HH:MIAM')"

LastRunDate is stored as varchar in the context variable table in the following format 'MON DD YYYY HH:MIAM'


Appreciate your help







However, this is not working, I'm able to see the context variable LastRunDate











Eleven Stars

Re: Passing Implicit context variables to the Source Query

Your query should be as follows......


"select * from table where create_date > TO_DATE('"+context.LastRunDate+"','MON DD YYYY HH:MIAM')"

I haven't tested this (you will need to check that the query works in Oracle), but you certainly missed the single quotes around your "LastRunDate" context. Your String concatenation looks OK, but if "LastRunDate" is a Varchar, you will need to supply it to the query with single quotes (') around it. I've added them above.

Rilhia Solutions
Five Stars

Re: Passing Implicit context variables to the Source Query

Sorry guys, this is a false alarm

This basically because of issue with me putting in wrong context value (case sensitive value).

I checked it now and it works fine.