Hitachi Vantara Pentaho Community Forums
Results 1 to 10 of 10

Thread: Select Component is not working for sql in cdf

  1. #1
    Join Date
    Aug 2007
    Posts
    198

    Default Select Component is not working for sql in cdf

    Hi,

    I have done the following for select component.I am using queryType is sql. and I have uncommented sql type jtable.xaction.sql(Enabled the sql component type )

    var region = "";


    regionSelect =
    {
    name: "regionSelect",
    type: "select",
    parameters:[],
    parameter:"region",
    valueAsId: true,
    htmlObject: "regionSelect_object",
    queryDefinition: {
    queryType: "sql",
    jndi: "SampleData",
    query: function(){
    var query = "SELECT region FROM department_managers";
    return query;
    }
    },
    executeAtStart: true,
    preExecution:function(){},
    postExecution:function(){alert(region);}
    };

    var components = [regionSelect];


    // The initial dashboard load function definition
    function load(){
    Dashboards.init(components);
    }

    // The initial dashboard load function execution
    load();



    I can see the select component but the values is coming as undefined. I am not able to understand, where I have done wrong, Please help me.


    Parveen

  2. #2
    Join Date
    Jul 2007
    Posts
    2,497

    Default

    You need to select 2 columns, select region, region is fine even
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  3. #3
    Join Date
    Aug 2007
    Posts
    198

    Default

    Thanks, it is working.


    Parveen

  4. #4
    Join Date
    Nov 2009
    Posts
    28

    Default

    Just a thought, couldn't it be as an potential improvement for the future to allow single columns in the result from a sql?
    Noticed that the BaseComponent always uses the same result for “id” and “value” if query is not sql. Couldn't that also be true if the the array in the array only has one value?

  5. #5
    Join Date
    Jul 2007
    Posts
    2,497

    Default

    All that thing just sucks


    We're working on it, or at least thinking about it
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  6. #6
    Join Date
    Dec 2010
    Posts
    4

    Default Sql query in selectcomponent of cdf

    Quote Originally Posted by parveenh View Post
    Thanks, it is working.


    Parveen
    Praveen i am getting this error

    Caused by: javax.naming.NameNotFoundException: Name {JNDI} is not bound in this Context
    at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
    at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at org.pentaho.platform.engine.services.connection.datasource.dbcp.BaseDatasourceService.getJndiDataSource(BaseDatasourceService.java:73)
    ... 84 more
    14:48:58,453 ERROR [SQLLookupRule] Error end:
    14:48:58,453 ERROR [SQLLookupRule] a313ab2d-2abf-11e0-afaa-13f2f9dafc36:COMPONENT:context-22420980-1296206338421:jtable.xactionSQLBaseComponent.ERROR_0007 - Connection to data source is not valid

  7. #7

    Default

    I think that this error is related to your JNDI datasources definition.
    Check your connections from the administration-console (PAC).
    All your available JNDIs are defined there...

  8. #8
    Join Date
    Dec 2010
    Posts
    4

    Default

    Where are those configurations stored

  9. #9

    Default

    I dont' know... but those configurations are editable from the PAC...start the administration console and edit JNDIs from there!

  10. #10
    Join Date
    Dec 2010
    Posts
    4

    Default

    I have the same jndi (SampleData) working in other xactions. What i observe is that the {JNDI} is not getting replaced with the value in dashboards. So let me know if anything else is missing
    Last edited by psbsk; 01-28-2011 at 02:01 PM.

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.