You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
Here's my problem that i'm hoping talend could help solve.
So i have a large db and I want to access data from that database using dynamic queries. Lets say I have a db with a column called "colors". I want the user to enter "blue" "red" "brown" and it will query (i.e. select * from somedb WHERE color = "blue" AND color = "red"...) the db and get the results from those three queries. I don't know what colors a user will put in, might be 2, might be 50. Is there a way to put those colors in as context group and do a foreach variable (colors) in a context group, generate a query and get the results from each of those queries. I would appreciate any help on this, thanks!
Hello
You need query records dynamically based on each color entered by user.
Here is java example, please see my screenshots.
tJava_1 code:
String s=((String)globalMap.get("tMsgBox_1_RESULT"));
String [] array=s.split(",");
globalMap.put("array",array);tMysqlInput_1 query:
"select * from person where color='"+(String)globalMap.get("color")+"'"Feel free to ask for help if you have any trouble!
Best regards
shong
Offline
Thanks shong, i'll mess around and see what I can do, if I run into any issues i'll let you know, thanks again.
This was exactly what I was looking for, got it working perfect, thanks again!
Pages: 1