1

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.

Shekhar
  • 11,438
  • 36
  • 130
  • 186

1 Answers1

5

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})
pdpi
  • 4,163
  • 2
  • 21
  • 30
  • thanks for your answer. I had to go through test cases present here http://code.google.com/p/pentaho-cda/source/browse/trunk/test/pt/webdetails/cda/tests/?r=381 , to know how to use StringArray type parameter. – Shekhar Mar 01 '12 at 06:57
  • We really need to remove that repository -- CDA has been moved to github (https://github.com/webdetails/cda) – pdpi Mar 01 '12 at 11:41
  • well, you need to create documentation also. CDA is really really great but lacks documentation. I would love to help you guyz. – Shekhar Mar 02 '12 at 10:17