Pass value into sql in statement

Stimulsoft Reports.NET discussion
Post Reply
wangxianlg
Posts: 6
Joined: Wed Dec 21, 2011 3:44 pm
Location: US

Pass value into sql in statement

Post by wangxianlg »

Hi,

I would like to pass value like '7002', '6997' into sql statement using in statement like following:

select * from users where id in (@Ids)

the @Ids value looks like '7002', '6997'

Please help!

Thanks
Alan
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Pass value into sql in statement

Post by HighAley »

Hello, Alan.
wangxianlg wrote:I would like to pass value like '7002', '6997' into sql statement using in statement like following:

select * from users where id in (@Ids)

the @Ids value looks like '7002', '6997'
We don't support list parameters in SQL query but you could use a variable of type string.

Code: Select all

select ... from ... where id in ({var1})
Where var1 = "'7002', '6997'"

Thank you.
Post Reply