Forum

anuragkumar
      5 years ago #16501
      Up
      0
      Down
      ::

      Hi @chris,

      I am using below insert query in my connector:

      INSERT INTO person (name, age,graduatedOn,birth_date_time,isAlive)
      VALUES (:name:, :age:Integer:, :graduatedOn:Date:,:birth_date_time:Date:, :isAlive:);

      Here, I am passing value from a struct having all string fields.

      There is no problem, when I have set all the fields in the struct and none is empty. Insert query runs fine then.

      Problem is in below conditions:

      1) when age is empty, then I get below error:

      {
      “message”: “Invalid payload for connector type SQL: Parameter age had invalid format: JSON Literal for type Integer malformed”,
      “success”: false
      }

      2) When age is filled, then I get error for the date field ‘graduatedOn’, error is below:

      {
      “message”: “Data truncation: Incorrect date value: ” for column ‘graduatedOn’ at row 1″,
      “success”: false
      }

      Please find below the table description:

      How can I deal with this situation, as I can have empty fields in my struct if user has not entered any value for it.

      Regards

      Anurag

       

       

       

       

       

      Attachments:
      You must be logged in to view attached files.