Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Change column type

  1. #1

    Default Change column type

    Hi,

    I have a table that has a column of format NUMBER(5,0) which is nullable. I need to add a source to the transformation that loads this table. In this source the value for that column is null (null as rel_aant_actieve_gebruikers), but when I check the output fields for that table input step, it indicates this field as a string.
    So I add a select values step to change the type to NUMBER(5,0), but then I get an error:
    Unexpected conversion error while converting value [REL_AANT_ACTIEVE_GEBRUIKERS String] to a Number

    In the other table input step the input column is a date and can also be null. If I do not add the select values step I get the message that I am mixing types of string and number. Should I not worry about this?

    Thanks,
    Patrick

  2. #2

    Default

    Seems like I have to use two select value steps, one for each table input .

  3. #3
    Join Date
    Jan 2015
    Posts
    19

    Default Work-around:

    1) Use the NVL(InFieldx,'default value') function in the SELECT statement
    2) Create staging table with corresponding columns as VARCHAR
    "The person who says it can't be done should not interrupt the person doing it." -- Chinese proverb

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

    Default

    Quote Originally Posted by LKBrwn_DBA View Post
    1) Use the NVL(InFieldx,'default value') function in the SELECT statement
    2) Create staging table with corresponding columns as VARCHAR
    LKBrown_DBA that doesn't actually solve the issue provided.
    The issue is that in the DB, the datatype is a string in one table, and numeric in the other.

    In recent PDI versions (This thread is from 4 years ago!), one could use the "Null if" step to convert "rel_aant_actieve_gebruikers" to a real null, and then do the numeric conversion with a Select Values step.

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.