Hi everyone,
I have a scenario where I can save SQL statement "SELECT * FROM" in contextA and "TABLENAME" in contextB.
The thing is I want to concatenate these two context variables in query parameter for database input component?
Is it possible?
Thanks in advance!
Hi Shong, It's just a simple SQL "SELECT * FROM EMPLOYEE" statement. Regards, Rozie
If the table name will be a variable, the query can be:
"select * from "+context.tableName
if the SQL has where condition, the query looks like:
"select * from "+context.tableName+" where id>10"
Hope this help you!
Shong
select Q3.F0031 , Q4.F0171 , Q6.F1609,(Q3.F0031+Q3.F0032) as output
From STG_QSTN3 as Q3,STG_QSTN4 as Q4,STG_QSTN6 as Q6
where Q3.Estab_ID = Q4.Estab_ID
and Q3.Estab_ID = Q6.Estab_ID and Q4.Estab_ID = Q6.Estab_ID
Using the technique of context variable, I defined the SQL statement as "context.DOS_formula_Query".
Then in the excel file I separate the SQL statement into different sheet where the "select" statement I put in the sheet1 and "From...Where" statement I put in the sheet2.
Using the context variable, I called upon these statement using "context.DOS_formula_Query".
Is it possible to do above job? I found that the "From..Where" statement cannot be read. Is there any other alternative to do the job?
Below are the snapshot of the job.
Thanks in advance.
Regards,
naim
Hi Naim
In the first and second images, there both has a same name called DOS_formula_Query. I think tContextLoad don't load the right value for the key DOS_formula_Query, because both sheets have a same key DOS_formula_Query. Can you check it?
Shong
I think you need different key names in the excel file and concatenate them in the database query. keys DOS_formula_Select & DOS_formula_From and in the query have context.DOS_formula_Select + " " + context.DOS_formula_From