arraysparameterspentahocda

How to use StringArray type Parameter in Pentaho CDA?


Does anyone knows how to use parameter of type StringArray in Pentaho CDA?

<DataAccess id="Testing_StringArrayParam" 
    connection="2" 
    type="sql" 
    access="public">
    <Name>Testing String Array Parameter</Name>
    <Query>
        select distinct all_functional_areas.functional_area_name
    from tbl_cand_organization_mst all_companies,
        tbl_cand_functional_area_mst all_functional_areas 
    where all_companies.organization_name=${ClientName})
    </Query>
    <Parameters>
        <Parameter name="ClientName" type="StringArray"/>
    </Parameters>
    <Columns>
        <Column idx="0"><Name>Functional_Area</Name></Column>
    </Columns>
    <Output indexes="0"/>
</DataAccess>

I would like to know how to give array of values for ClientName parameter?

If anyone knows it, then please let me know. I am not able to find answer about this thing anywhere. Samples given with CDA do not use StringArray parameter.


Solution

  • CDA will replace

    ${ClientName}
    with
    "Client1", "Client2", "Client3"
    .

    So you just need the query to read

    select distinct all_functional_areas.functional_area_name
        from tbl_cand_organization_mst all_companies,
        tbl_cand_functional_area_mst all_functional_areas 
    where all_companies.organization_name in (${ClientName})