Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi There i have coded following code in tJDBC input.
"select count(1) as record_count , '"+context.primary_keys+"' as primary_keys from
"+context.table_name+"
group by '"+context.primary_keys+"'
having count(1) =1
"
I am not able to find the result of above query which is showing error at group by clause.
Can anybody help to know how talend read context variable in group by clause??
"select count(1) as record_count , '"+context.primary_keys+"' as primary_keys from
"+context.table_name+"
group by '"+context.primary_keys+"'
having count(1) =1
"
count(1) ! count(fieadName), count(*) or sum(1)
context.primary_keys have to be not empty it's comma separated list of fields name.
fields name: are with non spaces or quoted depending on your db.
if primary_keys are primary keys, all results are going to be unique! no need to count!
Hi fdenis,
Actually what i am doing know , i want duplicates record which is present in my table so i read the table from my DB and i have updated primary keys in primary_keys columns and then i used tjava component to read my table name and primary_keys so i created context variable.i used that context variable in tjdbc component and coded as ,
"select count(*) as record_count , '"+context.primary_keys+"' as primary_keys from
"+context.table_name+"
group by '"+context.primary_keys+"'
having count(*) >1
"
But i am not getting my expected result .Please find the screenshot that i have uploaded.
Thanks fdenis,
need one more help
As i am new to talend how and where should i defined globalmap variable?