How to pass Multi and Singlr value Parameters to DB2 query, which is using in SSRS report for ODBC connection

Hi Guys,
I am using DB2 database in SSRS. I have to pass Single Value and Multi Value Parameters. I tried with Select * From DB2Table Where
Column=@PRM_Name Or Select * From DB2Table Where
Column=:PRM_Name . It is not working and throwing error. Please help me out.
Connection Details: ODBC
Thanks Shiven:)

Hi SKM,
So you mean to say that Go to DataSource->Add Dataset-> Query Type-Text-> Under Query:
click on fx (Expression)-> Write this expression
For Single Value Parameter:
="SELECT customer_name, telephone_number, address1, address2, city from MyTable
WHERE city = '" + Parameters!City.Value + "'"
OR
="SELECT customer_name, telephone_number, address1, address2, city from MyTable
WHERE city =  '" & Parameters!City.Value & "'"
Keep it in mind if Parameter is String then
It should be in Single quote ''.
 Like
="SELECT customer_name, telephone_number, address1, address2, city from MyTable WHERE city
='Hyderabad' "
For Multivalu Parameter:
="SELECT EmployeeID, FirstName, LastName, LoginID FROM SHIVEN.AUDIT Where FirstName
in ('" + REPLACE(JOIN(Parameters!City.Value,","),",","','") + "')"
NOTE:
If your Parameter is Single Value Parameter and You want to enter string values with Coma (,)
separated (Like Hyderabad, Chennai, Delhi).
In this case, you have to use below expression.
="SELECT customer_name, telephone_number, address1, address2, city from MyTable
WHERE city IN ('" + REPLACE(Parameters!City.Value ,",","','") + "')"
OR
="SELECT customer_name, telephone_number, address1, address2, city from MyTable
WHERE city IN  ('" & REPLACE(Parameters!City.Value ,",","','") & "')"
In above expression: Replace will replace all , with ‘,’ and city IN (‘Hyderabad’, ‘Chennai’,
‘Delhi’) will not throw any error.
 Note: You have to write expression in one line in Expression editor for dataset
query
Thanks It is working fine but it is tough job if query is big.
Hi S kumar,
The above approach we use when we have source like DB2, becasue DB2 has some syntactical differences to pass multivalue paramaeter. I tested and it works good, if i am mentioning the query in above format by using Fx button while creating dataset.
but if we want fetch data from view which exist in DB2 and we need to call db2 view in SSRS and pass multivalue parameter in a way we did above then could you please mention the steps and way to achieve this.
Thanks in advance!

Similar Messages

  • How to pass HTML radio group value to an SQL query

    I need to display a radio group in Printer Friendly Mode so that when the value in the radio group changes the page is submitted and the report is updated to the new value.
    I can't use a standard APEX radio group item as it renders in disabled mode when the page is in printer friendly mode.
    I have therefore used a standard HTML radio group in a HTML region as follows:
    <div id="radio_bank" align="left" class="NonPrintable">
    <input type="radio" name="bank" value="Trial Bank"> Trial Bank
    <input type="radio" name="bank" value="Tissue Bank" checked> Tissue Bank
    <input type="radio" name="bank" value="Temporary Bank"> Temporary Bank
    <input type="radio" name="bank" value="All"> All
    </div>
    I have set up a dynamic action to submit the page on change event. This works but it navigates me to a "Page cannot be found " error page. I have an unconditional branch defined on the current page but this is ignored.
    Questions
    1) can a standard APEX radio group appear in Printer friendly mode? - This would solve my problem.
    2) how to submit the page using the above scenario to render the current page (dynamic action)
    3) how to capture the selected value of the radio group and pass it to SQL where clause
    thanks in advance
    PaulP

     

  • How to build Hierarchy and get values from DAX Evaluation Query?

    i have create Calander Hierachy for Year,Quarter,Month... in this invisible tabuler model medata properties.
    any one give steps for create Hierachy and Get Data From DAX evaluation context ?.
    VenkadesanPerumal

    Venkadesan, is this still an issue?
    Thanks!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • How to pass more than one value for one column in procedure

    hi
    select id, name from col_tab where dept_name in ('ECE','CIVIL');
    when i was running this it is working well.
    CREATE OR REPLACE PACKAGE pack_str
    AS
    TYPE type_refcur IS REF CURSOR;
    PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur);
    END pack_str;
    CREATE OR REPLACE PACKAGE BODY pack_str
    AS
    PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur)
    IS
    BEGIN
    OPEN ans FOR
    select id,name from col_tab where dept_name in char_in ;
    END str;
    END pack_str;
    the package was created.
    my doubt is
    1.how to pass more than one value for char_in (e.g ('ECE','CIVIL'))
    2. when i was storing the value in string like val = 'ECE,CIVIL' ,
    how to get the id,name for ECE and CIVIL.
    plz help me

    Hi Rebekh ,
    I am recreating your packages for the desired output.
    CREATE OR REPLACE PACKAGE pack_str
    AS
         TYPE type_refcur IS REF CURSOR;
         PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur);
    END pack_str;
    CREATE OR REPLACE PACKAGE BODY pack_str
    AS
         PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur)
         IS
              lv_t varchar2(200);
         BEGIN
              lv_t := REPLACE(char_in,',',''',''');
              lv_t := 'select id,name from col_tab where dept_name in (''' || lv_t || ''')' ;
              OPEN ans FOR lv_t;
         END str;
    END pack_str;
    Note:-
    Input Parameter char_in is a comma seperated value for dept_name
    -Debamalya

  • How to pass the FORM Fields value by Form Personalization

    Hi ALL,
    I want to pass form filds values in to procedure. I am calling this procedure through form personalization of that form..... But it's not accepting any form field's value there... when i am passing hardcoded vales procedure is executing fine...
    can any one suggest what to do???
    i tried with these syntax
    TEST_EMP_FP(:ADDR.ADDRESS_ID,'ABC')
    TEST_EMP_FP(${item.ADDR.ADDRESS_ID.value},'ABC')
    Regards
    Ravi

    Hi,
    Iam calling an SRS from forms personlization. Can any body tell me how to pass the Form field values as parameters to the Reports. (Example when they call this Concurrent request from Transact5ions screen, The invoice number should be defaulted in the report parameter).
    Regards,,
    Anil.

  • State machine custom task workflow how to pass one task field value to the next task field

    i am using ItemMetadata.xml to pass value from list to custom task first value its passing the but second value is showing as null
    plus how to pass one custom task value to the next custom task
    i.e one supervisor approver comments submitted field i want to see on department manager approval custom task which is the next approver from supervisor
    ows_firstfield=""
    ows_SecondField=""
    the above ows fields are from list
    in this i am unable to retrive the second value in the task form this is my first query?
    second query is that how can we pass one task field value to next approver task field value?
    any idea
    MCTS,ITIL

    What type of workflow is this?  IS this Visual Studio or SharePOint designer or third party (K2, Nintex, etc...)?  YOu should be able to get ahold of the task that was edited via the correlation token, and then grab any value you want from that
    task (wether it be a custom field or a standard worfklow task field). 
    It would help to know what you are using to build the workflow.
    Thanks!

  • How to separate debit and credit values in gl statement report (daywise)

    hi
    experts,
    i have report.
    selection criteria is
    chars of account.
    gl account
    date .
    how to separate debit and credit values in gl statement?.(i know there is a indicator shkzg).
    but send me code.
    op
    date,   total credit,total debit , balances.
    also calculate opening and closing balance.
    u created such type of report then plz help me.
    thanks&regards.\
    ajay.

    Hi,
    Usually it can be determined using the field shkzg. If it contain 'S' its debit and if it contains 'H' then its credit.
    Before showing the amount you need to do like;
    IF wa_gl-shkzg = 'H'.
    wa_gl-dmbtr = wa_gl-dmbtr * (-1). " dbmtr - amount
    ENDIF.
    This will solve your problem.
    Regards
    Karthik D
    Edited by: Karthik D on Jun 3, 2009 12:29 PM

  • How to pass username and password while invoking a web service through wsdl

    Hello All,
    i am calling a web service through wsdl, but it is giving error 401. i want to know how to pass userid and password when i am invoking webservice?
    i am using NetBeans 6.1.
    i did following thing:
    First i created one web application, then i right clicked on project new->web service client, and gave the url for my wsdl.
    after that i create one main class and try to call my required operation by that wsdl.
    Thanks in advance

    Thanks dumchikov, i tried the same thing what ever you told but there is no option for security.
    when i right clicked on web service reference its open 1 window which have 2 tab one is quality of service and second is wsdl customization, then i clicked on wsdl customization. which contain Global Customization, Port Types, Port Type Operations, Port Type Faults, Binding, Binding Operations, Services, Ports and External Binding Files. it don't have security option.

  • How to pass username and password with the portal url

    i want to access portal from my web site. i have created username and password fields in my web page. when submited , my portal page should open. so how to pass username and password with the portal url.

    This is not straightforward; but it is doable.
    First tell us about your portal version; portal 10.1.4 has a slightly different method of doing it and the pre-10g portals were completely different animals.
    And if you are in AS Rel 2, then the most important document for you would probably be the following:
    [Creating Deployment Specific Pages| http://download-west.oracle.com/docs/cd/B14099_19/idmanage.1012/b14078/custom.htm#i1015535]
    You might want to use it in conjunction with some metalink notes about your portal version and such a login page.
    hope that helps!
    AMN

  • How to pass user and password in workspace when open a bqy

    hello,
    how to pass user and password of workspace when refresh a bqy for a query in DB2.
    I don't know where to insert the properties in order to use user and password of workspace,
    I want to use user of login of workspace,
    I don't want to make to appear the mask of login newly when the user refresh the query.
    I don't want to set a default user and password
    thanks
    massimo

    Dear Friend,
    What you mean?
    1. Do you mean how to pass login page on workspace ?
    2. or Do you mean how you can use a connection file to connect to db that is hide from user?
    3. or You mean how to use user & password to login to doc on workspace
    Answer for 1:
    use link
    http://HyperServer:45000/workspace/browse/get/MyFolder/MyIR.bqy?user=admin&pass=password
    Answer for 2:
    a) Upload or import connection file ( MyConn.oce ) to DB2 into workspace,
    b) for IR doc properties change file connection ( MYConn.oce )
    Answer for 2:
    use link without user & pass parameter
    http://HyperServer:45000/workspace/browse/get/MyFolder/MyIR.bqy <?user=admin&pass=password>
    regards
    siyavuş

  • How can my wife and I be friends in game center if we use the same Itunes account?

    How can my wife and I be friends in game center if we use the same Itunes account?

    You can set up multiple accounts in Game Centre, sign out and create new account. You just need a different email address from any existing Apple ID's and a new password. You can still use the old account for purchases.

  • How do I download the music from iTunes onto an old iPhone 3gs? I have reset the iPhone to factory settings and when I plug it in it wants to use the device name for my current iPhone 5 and I don't want to change anything on my old iPhone.

    How do I download the music from iTunes onto an old iPhone 3gs without affecting my iPhone 5? I have reset the iPhone to factory settings and when I plug it in it wants to use the device name for my current iPhone 5 and I don't want to change anything on my current iPhone. iTunes won't let me change the device name for the 3gs. I just want to use the old iPhone like an touch.

    Hi littlemansa,
    If I am understanding you correctly, it sounds like you are returning to an old iPhone that has been erased and you would like to set it up as a new device without restoring from a backup which would affect the name of your iPhone, as well as the contents therein. I have an article for you that can help you set up your iPhone as a new device, and that information can be found below:
    How to erase your iOS device and then set it up as a new device or restore it from backups - Apple Support
    http://support.apple.com/en-us/HT4137
    Basically, it seems like you may be stuck on a screen that is asking if you would like to restore your device from the backup that is filed under the name of your new iPhone, or if you would like to set up the device as a new device. I would suggest that you set it up as a new device to achieve your desired results. 
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • I have ordered an i-pad and cancelled it the other day. I have used my indian debit for that order. So money got debited immediately. Apple has sent an email saying that it is successfully cancelled. But money is not yet credited into my account.

    i have ordered an i-pad and cancelled it the other day. I have used my indian debit for that order. So money got debited immediately. Apple has sent an email saying that it is successfully cancelled. But money is not yet credited into my account. please let me know what is happening. I cancelled the order on April 9th. Its already been more than 15 days.

    Your best corse of action would be to either email apple support or ring them giving them your debit I'd and the order number where they will be able to look at what's wrong and set u going on the right track

  • Received this error message when starting iTunes and reinstalling does not resolve it:  The registry settings used by iTunes drivers for importing and burning CDs and DVDs is missing.

    Received this error message when starting iTunes and reinstalling does not resolve it:  The registry settings used by iTunes drivers for importing and burning CDs and DVDs is missing...
    Can I uninstall existing iTunes without losing my media library?  and then install fresh to fix this problem?

    Hi there kweitkamp,
    You may find the troubleshooting steps in the article below helpful.
    iTunes for Windows: "Registry settings" warning when opening iTunes
    http://support.apple.com/kb/TS3299
    -Griff W. 

  • In my family we have 3IPhones 4S, one IPhone5, one IPad3, one IPadMini and two IPad 4. Is it possible to use the same energieadapter for all of those ?

    In my family we have 3IPhones 4S, one IPhone5, one IPad3, one IPadMini and two IPad 4. Is it possible to use the same energieadapter for all of those ?

    Yes but the iPhone chargers will struggle to charge the iPads ,they need more power than the iPhone chargers produce and with an iPad will charge VERY slowly
    The iPad chargers whether 10w or 12 will happily charge all your devices and Apple confirms the compatibility on the relevant web page.

Maybe you are looking for

  • Nokia customer service support - Warranty claim fo...

    Just finished being online with one of the support staff at Nokia USA's phone number, with a thick mumbling accent, and obviously having a hard time understanding english. Anyway lens shutter is falling apart, due to build quality issue or design iss

  • Exception Details: org.apache.jasper.JasperException

    I keep getting this error message when trying to run a web application with Sun Studio Creator. It happens when I try to bind a backbean to a selectOne tag using javaserver faces. Any help would be appreciated. Javaserver Face Page. <?xml version="1.

  • PO History

    Hi ABAPers,    Can any one tell me what are the tables to be taken to display PO History. If possible can any send me a report on PO History. Its urgent.. waiting for your reply.. Thanks Kumar

  • Billing date is for Monday for the orders created on Saturday and Sunday

    Hi Friends, I have an issue,that for the orders that are created on weekdays, the Billing date is for the same day. But for the orders that are created on Saturday and Sunday,the Billing date is being determined automatically for Monday. The goods ar

  • Deactivate old phone? I need help guys

    I got my iphone and I activated over itunes...It is stuck on the verizon accept terms page and wont go anywhere but my iphone said "activated" after that. I called *228 and activated it. Is my old phone now deactivated?  dont get ths