Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using FastReport.Net and I want to passing multiple values in a parameter. I have dynamic values for this parameter. For example;

SELECT * FROM Students
WHERE StuNo IN (@pStuNo);

@pStuNocan includes (3, 8, 11), but fastreport does not allow such use.

I could not find any solution on this issue. I'm waiting for your help, thanks.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
4.0k views
Welcome To Ask or Share your Answers For Others

1 Answer

I reached the result by assigning the parameter as a string and then splitting it. My solution script is as follows;

SELECT * FROM Students
WHERE StuNo IN(select regexp_split_to_table(@pStuNo,',')::INTEGER) 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...