Question
Verizon Data Services
IN
Last activity: 23 Mar 2023 6:53 EDT
How to pass the values dynamically in a in query when using connect sql
SELECT "PZINSKEY" AS "pzInsKey", "CASEID" AS "CaseId" from Data.TABLENAME WHERE "PZINSKEY" IN '{ASIS:.pyDescription}'
Tried multiple ways :
Commas separated
Value list property
Comma separated with \"
Comma separated with \'
Can somebody tell me if it's possible to pass the values inside a in query dynamically from a property.
In my use case I have to take union of 4/5 tables and hence I don't want to run a report definition.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Verizon Data Services
IN
I am able to pass the values dynamically using in .
Bits in Glass
IN
@nikhilk7251 please tell me if my understanding is correct. If you are hardcoding ASIS with comma seperated values it's working but you are not able to pass this value dynamically right?
Updated: 19 Mar 2023 4:43 EDT
Bits in Glass
IN
@nikhilk7251 can you try calling connect sql within a page context. On the page set commas seperated values and refer the same within the query. Also please refer below URL for reference where instead of IN they are using equal.
https://support.pega.com/question/how-pass-parameter-value-connect-sql-inserting-or-selecting-data
Verizon Data Services
IN
@Anoop Krishna Did you try this solution because when I tried hardcoding the value in a text property as "\'value1\', \'value2\', \'value3\'" and used the same as equal to instead of in it's pulling 0 results.
Updated: 19 Mar 2023 13:23 EDT
Bits in Glass
IN
@nikhilk7251 can you try by keeping just comma seperated values with equals.
equals a, b, c
Virtusa
IN
Hi @nikhilk7251,
Select * from data.pr_abc_paymentg_data_card where CardNumber = '{ASIS:.CardNumber}' is working properly
but when I tried using IN it is not working properly.
Thanks
Verizon Data Services
IN
@UdayReddyGunthala Are you passing multiple values in CardNumber property, if so can u please share how are you setting the value and the query the system in generating in the backend.
I tried hardcoding the value in a text property as "\"value1\", \"value2\", \"value3\"" and used the same as equal to instead of in but not working.
Accepted Solution
Verizon Data Services
IN
I am able to pass the values dynamically using in .
Bits in Glass
IN
@nikhilk7251 great. Did you add anything else? Can please post here, what changes have you done to make this work? So that will help others.