Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Multiple parameter ODBC


Multiple parameter ODBC

Author
Message
rkaria
rkaria
SSC Journeyman
SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)

Group: General Forum Members
Points: 93 Visits: 193
Hi

I have created a report in BIDS 2008 that connects via ODBC connection.

I am having issue with the parameters for multiple values.
In the Dataset query I have :
(M10.PARTNO in (:Alloy))

and in the dataset properites under parameter I have:
=join(Parameters!Alloy.Value, ", ")

This works if I select one value from the drop down, but if i select more than one it returns no data.

Can anyone please advise?

Thanks
R
Gazareth
Gazareth
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2868 Visits: 5351
Try changing =join(Parameters!Alloy.Value, ", ") to just =Parameters!Alloy.Value
rkaria
rkaria
SSC Journeyman
SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)

Group: General Forum Members
Points: 93 Visits: 193
Thanks for the reply. Unfortunately still no data. Work if I select one value but more than one gives no data.
Gazareth
Gazareth
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2868 Visits: 5351
Ok, think you'll need to split the parameter out in the query like the one here

So M10.PARTNO in (:Alloy)) becomes M10.PARTNO in ((SELECT Item FROM dbo.DelimitedSplit8K(:Alloy, ',')))

Assuming you're using MS SQL as your datasource, which I'm not sure you are.
rkaria
rkaria
SSC Journeyman
SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)

Group: General Forum Members
Points: 93 Visits: 193
Thanks

Im writing it against Oracle 11g

Is the "dbo.DelimitedSplit8K" part of the query you have written what I should type or should i replacing it with something else? At the moment it is saying 'Right paraenthisis missing' I have checked and there are the right amount of brackets there.

Thanks
Rakhee
Gazareth
Gazareth
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2868 Visits: 5351
dbo.DelimitedSplit8K is the user-defined function described in the article I linked to in my second reply. It's only valid in MS SQL though.

It's basically a bit of code that will convert the parameters into the correct format:
The parameters are being passed to the report query as 'Brass, Bronze' - you need something to convert it into 'Brass', 'Bronze'

This link might help you further:
http://social.msdn.microsoft.com/Forums/uk/sqlreportingservices/thread/31c1ab35-2b78-4d30-9fec-7c95e1cd7d0a

Cheers
Gaz
rkaria
rkaria
SSC Journeyman
SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)

Group: General Forum Members
Points: 93 Visits: 193
Thank you for your help, I found the issue.

I changed my conenction type to Oracle rather than ODBC and now your first suggestions works.
Gazareth
Gazareth
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2868 Visits: 5351
Excellent, thanks.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search