Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Database Lookup try to convert field to integer

  1. #1

    Default Database Lookup try to convert field to integer

    Hello.

    I try to use the Database Lookup step and the transformation fails because it try to convert a String field into an Integer but I don't understand why.

    Here's a printscreen of my Lookup:
    Name:  DBLookup.jpg
Views: 25
Size:  25.7 KB

    Both BusinessPartnerID and bpid are String. However when I run the transformation, it gives me the following error:
    "Conversion failed when converting the varchar value 'xxxx' to data type int"

    If I change the = for a LIKE it works but unless I'm mistaken, I don't feel it is the correct behaviour... or is it?!

    Thanks.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    Maybe I'm wrong, but i think that LIKE is less stringent than "="?
    I guess that I should Google this...
    -- Mick --

  3. #3

    Default

    Quote Originally Posted by Mick_data View Post
    Maybe I'm wrong, but i think that LIKE is less stringent than "="?
    I guess that I should Google this...
    Exactly my point
    That's why I don't think it's the solution, looks more like a bug to me but I prefer to ask before posting a JIRA... It's so basic that I feel like I'm doing something wrong otherwise a lot of people would have noticed this.

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

    Default

    Without any wildcard characters, LIKE will return the same result as the equality comparator, for a price.
    While the query planner would use available indexes, LIKE queries will start a table scan.
    So long, and thanks for all the fish.

  5. #5

    Default

    Quote Originally Posted by marabu View Post
    Without any wildcard characters, LIKE will return the same result as the equality comparator, for a price.
    While the query planner would use available indexes, LIKE queries will start a table scan.
    So can I correctly assume there is a bug with the Database Lookup trying to convert my column to an integer ?

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

    Default

    I never saw this error, yet.
    What is your Kettle version?
    So long, and thanks for all the fish.

  7. #7

    Default

    Oh sorry for not specifying this at first
    I'm using 5.0.1-stable on Windows.


    Update: if I check the box "Load all data from table" it doesn't gives me the error... Still, doesn't make sense to me.
    Last edited by mblondinde; 04-30-2014 at 06:10 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.