Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Parametrized SQL clause in CDE

  1. #1

    Default Parametrized SQL clause in CDE

    Hi there!

    In every dashboard I've made I have been in the need of doing things like this, in order to minimize the number of queries:

    select whatever from wherever where ${column1} = ${value1}
    The problem is that when I need to parametrize ${column1}, I have to define its type, and choose between String, Integer, Date, StringArray, ... If I choose String, its initial logical type, it wraps my parameter with single quotes, therefore not obtaining any data (or giving a syntaxis error).

    I'm actually using pentaho 4.8 ce, but I recall that in another dashboard I made, in pentaho 4.5 ce, it was OK to do things like that. However, it seems that not anymore.
    Is there any way to achieve what?

    And is there any tip you can give in order to improve the maintenance of "complex" dashboards and reuse things so the dashboards scheme is simpler?

    Thx in advance and great job btw.

  2. #2


    I've just checked that when I did use parametrized clauses it was with mdx, not sql datasources, so that may be the difference because it's not working now

    Anyway, is there any to do what I want with sql?

  3. #3
    Join Date
    Nov 2011


    yeah, that works in MDX but not in SQL queries, because we are using JAVA prepared statements and that's not a valid usage (although there are rumours some db engines support it).

    Switch to MDX? :-)

    Myabe if you use CASE statements you can have some more dynamic queries but that will increase the query complexity.
    Pedro Vale
    CTools Product Development

  4. #4


    Doh, prepared statements have just fu** me here
    I'll try it with MDX then, thx for the clarification.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.