Does Import CSV to Database v6 work for csv file with null values?

I have a csv file with delimiter '|'. When I try to run the smart service by passing a csv file where few fields are null, it is returning the error message 'Error executing SQL'. But when I replace the null with random text values it is writing the data to DB.

Is this an expected behavior of this smart service?

Is there any way to import or read a csv file with null values?

  Discussion posts and replies are publicly visible

Parents
  • But I noticed today that if the 1st column in the CSV file is empty then it is throwing this error, if other columns in between are null, it is able to read and write NULL to the DB.

  • 0
    Certified Lead Developer
    in reply to Nandhavi Nandakumar

    I just tested this on my side and it works correctly even when the first column is empty — the data is read and inserted as null into the database without any errors.

    Are you sure the column mapping is correct in your configuration? It might be worth double-checking that columns in your CSV matches the expected structure and that the target table and allows nulls where needed.

    Would you mind sharing a sample of the CSV file that’s causing the issue, along with the table script you're using?

    That would help a lot to reproduce the problem and see what might be going wrong with the first column specifically.

    Thanks!

Reply
  • 0
    Certified Lead Developer
    in reply to Nandhavi Nandakumar

    I just tested this on my side and it works correctly even when the first column is empty — the data is read and inserted as null into the database without any errors.

    Are you sure the column mapping is correct in your configuration? It might be worth double-checking that columns in your CSV matches the expected structure and that the target table and allows nulls where needed.

    Would you mind sharing a sample of the CSV file that’s causing the issue, along with the table script you're using?

    That would help a lot to reproduce the problem and see what might be going wrong with the first column specifically.

    Thanks!

Children