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

Categories

0 votes
4.4k views
in Technique[技术] by (71.8m points)

c# - FastReport.Net - Passing Multiple Values With Seperated Comma

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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) 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...