Pentaho

 View Only
Expand all | Collapse all

Pentaho 9.2 null value different in Pentaho and SQL server

This thread has been viewed 19 times
  • 1.  Pentaho 9.2 null value different in Pentaho and SQL server

    Posted 03-20-2023 11:18

    I'm trying to get a value with database lookup but pentaho doesn't seems to process null values the same way as SQL server in the WHERE statement, I tried sending an empty string instead or change the KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL property but it doesn't seems to change anything, is there a way to fix this issue ?



    ------------------------------
    Gwenael Mahe
    Data Service Manager
    Richardson
    ------------------------------



  • 2.  RE: Pentaho 9.2 null value different in Pentaho and SQL server

    Posted 03-21-2023 06:09

    It seems that you are having issues with Pentaho not processing null values in the same way as SQL Server when performing a database lookup using the WHERE statement. You have tried sending an empty string and changing the KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL property, but to no avail.

    To fix this issue, you could try using the IS NULL or IS NOT NULL operator in your WHERE statement instead of trying to match against an empty string or null value. For example:

    SELECT column_name
    FROM table_name
    WHERE column_name IS NULL;

    This will return all rows where the column_name value is null.

    Alternatively, you could try using the COALESCE function in your query to replace null values with a default value. For example:

    SELECT COALESCE(column_name, 'default_value')
    FROM table_name;

    This will return the column_name value if it is not null, or the default_value if it is null. 

    SkyWard Alpine


    ------------------------------
    Diana Stanley
    Chief Financial Officer
    Glicks Furniture
    ------------------------------