Using CE Studio 7.2.2…
If I use anything but the simplest query, I cannot retain the ability to use graphical output options for my connector.
I have two issues I’d like help with related to the following.
Using postgres, can I contemplate writing a query like:
select customerid, customer, pass1, pass2, var1, var2, var3, var4, var5, date1, date2
from customer
where customer=‘${variable}’
union
select 0,‘’,‘’,‘’,0,0,0,0,0,null,null
from customer
limit 1
-
How do I define and specify ${variable}, if I’m able to use such a construct?
-
How do I retain the ability to specify the return as a 1xn result, if I’m able to do that?
Thanks,
Ford
Hi Ford,
Your query works.
re 1: you specify ${variable} as a pool variable - obviously calling it something meaningful - and assign it a value as required from a previous step.
The query goes into the Enter Query - Enter Query or Batch Script box.
If you switch to the “Editor” editor then I would return from a script something like this:
String query = "select customerid, customer, pass1, pass2, var1, var2, var3, var4, var5, date1, date2" +
" from customer" +
" where customer='" + var1 + "'" +
" union" +
" select 0,'','','',0,0,0,0,0,null,null" +
" from customer" +
" limit 1";
return query;
re 2: Sorry I have no idea how it determines how to return the graphical approach. To be honest I simply gave up on it as it was inconsistent and switched to scripting mode all the time. Much more powerful.
regards
Seán
PS: If this reply answers your question, please mark as resolved.