Discussion

RDB-List

Hi,

I am writing one SQL query as

select * from tablename where compnycd in(4,3,5,6)

Here, i need to pass the values of compnycd dynamically(compnycd is smallint). For that, i have set one property(datatype text) which holds 4,3,5,6 altogether.

But it was not working. So i tried converting the compnycd into char as
select * from tablename where cast(b.wPlnCompCd as char) in ({ContractPage.CompnyCd})

But still it is not retrieving the details from db.

Can anybody tried IN keyword of SQL in Pega? If so, please suggest me.

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

December 14, 2010 - 2:49pm

Have you tried adding quotes around the individual values? Without the quotes, it may interpret 4,3,5, and 6 as numbers.

quote:


Originally posted by VANITHAP

Hi,

I am writing one SQL query as

select * from tablename where compnycd in(4,3,5,6)

Here, i need to pass the values of compnycd dynamically(compnycd is smallint). For that, i have set one property(datatype text) which holds 4,3,5,6 altogether.

But it was not working. So i tried converting the compnycd into char as
select * from tablename where cast(b.wPlnCompCd as char) in ({ContractPage.CompnyCd})

But still it is not retrieving the details from db.

Can anybody tried IN keyword of SQL in Pega? If so, please suggest me.


October 24, 2015 - 8:20pm

Any luck with this?

October 24, 2015 - 9:17pm

Tried {ASIS:PAGE:SelectClause} and worked great with in clause.

 

The input string was formed like "\'SCHOOL00076\',\'SCHOOL00075\',\'SCHOOL02327\'"