Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Unable to get queryfields for SQL

  1. #1
    Join Date
    Mar 2014
    Posts
    7

    Default Unable to get queryfields for SQL

    Hi All,

    I am terribly new to Pentaho and am currently working on my first assignment. I am trying to extract data from an Oracle databse through a query (using Table Input stage) and then do some modifications on the data before wrinting into multiple files.

    But while trying to get the metadata of the query over to the subsequent stages, I keep hitting this message:

    Unable to get queryfields for SQL:
    Select xxxxxxxx from xxxxxxxxxx; ( The query selects data from 4 tables)
    ORA-00911: invalid character


    Incidentally this was working perfectly fine last a coupld of days ago ( Friday) and now it refuses to work. I am using 5.0.0-M1 build version of Pentaho.

    ANy help is highly appreciated. Please let me know if I need to provide additional information.

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Quote Originally Posted by harsha1238 View Post
    ORA-00911: invalid character
    Remove the terminating semicolon from your SELECT statement and try again.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Mar 2014
    Posts
    7

    Default

    Hi,

    Thanks for the reply. I removed the semicolon but the query seems to be having the same problem when I pass the parameter:

    select a.xxx fom table a where a.key = ${key_val_id}

    The variable key_val_id is a variable that gets generated in a transformation upstream. I am NOT passing it as a parameter to my current transformation as I was told that it is not required.

    when i remove the where clause, I can see the metadata. What am I doing wrong?

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    You don't say you enabled option "Replace variables in script?" - did you?
    So long, and thanks for all the fish.

  5. #5
    Join Date
    Mar 2014
    Posts
    7

    Default

    I did. I have that option enabled in my input stage.

  6. #6
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Seems like you don't have a default value for your variable key_val_id.
    So long, and thanks for all the fish.

  7. #7
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    Quote Originally Posted by harsha1238 View Post
    as I was told that it is not required.

    when i remove the where clause, I can see the metadata. What am I doing wrong?
    It's not, however you still need to tell the Spoon environment what the variable is, and what value to assign to it.
    You can either declare it as a parameter (and set a default value), or set an environment variable manually (which your upstream transform does) by going Edit -> Set Environment Variables
    **THIS IS A SIGNATURE - IT GETS POSTED ON (ALMOST) EVERY POST**
    I'm no expert.
    Take my comments at your own risk.

    PDI user since PDI 3.1
    PDI on Windows 7 & Linux

    Please keep in mind (and this may not apply to this thread):
    No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.
    Signature Updated: 2014-06-30

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.