Multi-value string. How exactly it looks like?

  • I have Multi-value string parameter @P_RISKID in my report that represents currecnies.

    User can select this combination for example;

    CAD

    CAD+CSW

    EUR

    In my dataset "MainData1"

    how can I test the code for multi-value scenario?

    Is it something like

    SET @P_RISKID = 'CAD,CAD+CSW,EUR'

    This doesn't work.

    The report works but how to set @P_RISKID properly in Query Analyzer?

  • If I understand correctly that you are trying to test the inputs, then you'd do it this way:

    SET @P_RISKID = 'CAD+CSW'

    Then do the same with each individually.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • I'm not sure you understand the problem.

    I am talking about multi-value string parameter.

    In Report Manager I can select three different values:

    CAD

    CAD+CSW

    EUR

    How can I do the same thing in Query Analyzer?

    This is not just SET @P_RISKID = 'CAD'This would be wrong because

    the value is ['CAD','CAD+CSW','EUR'] or something like that.

    The question is how do I test it in QA?

  • IT depends...

    if you're looking for something to split out the values into a list for a more permanent solution, there are a number of scripts on this site to do this, check out Jeff Moden's article on the tally table, just search by his name under articles.

    But if you're just looking for a quick and dirty way to test that the report is doing what you expect it to you have 2 options. Grab a trace of the database and use the code from the trace, or copy and paste your code from your dataset into Query Analyzer. Since this is a multivalue parameter I imagine in yoru where statement there is something like

    WHERE yourColumn in (@P_RISKID)

    You can just manually change that to

    WHERE yourColumn in ('CAD','CAD+CSW','EUR')

    Basically just add the extra single quotes where appropriate.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • Does the report call a proc?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply