T tito Member Licensed User Longtime User Jan 12, 2020 #1 Hi B4X Team, I am using jRDC2 for uploading time values to the database. Thats all working fine for valid time values. My database columns also accepting null values and I want to use it. For build up the commands with null values I have problems. Direct input of "Null" is working, assign a variable with "Null" and put it to the array list is not working: Code: Copy cmd.Name = "insert_arbeitszeiten" cmd.Parameters = Array As Object(Datum,item.mitarbeiter_id,Null,Null,Null,item.Zweck,item.DateTimeTick) commands.Add(cmd) Code: Copy Dim Pausenzeit As String Pausenzeit = Null cmd.Name = "insert_arbeitszeiten" cmd.Parameters = Array As Object(Datum,item.mitarbeiter_id,Pausenzeit,Pausenzeit,Pausenzeit,item.Zweck,item.DateTimeTick) commands.Add(cmd) Error: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect time value: 'null' for column 'pausenzeit' at row 1 Did I something wrong to assign Null to the variable? Thank you Last edited: Jan 12, 2020
Hi B4X Team, I am using jRDC2 for uploading time values to the database. Thats all working fine for valid time values. My database columns also accepting null values and I want to use it. For build up the commands with null values I have problems. Direct input of "Null" is working, assign a variable with "Null" and put it to the array list is not working: Code: Copy cmd.Name = "insert_arbeitszeiten" cmd.Parameters = Array As Object(Datum,item.mitarbeiter_id,Null,Null,Null,item.Zweck,item.DateTimeTick) commands.Add(cmd) Code: Copy Dim Pausenzeit As String Pausenzeit = Null cmd.Name = "insert_arbeitszeiten" cmd.Parameters = Array As Object(Datum,item.mitarbeiter_id,Pausenzeit,Pausenzeit,Pausenzeit,item.Zweck,item.DateTimeTick) commands.Add(cmd) Error: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect time value: 'null' for column 'pausenzeit' at row 1 Did I something wrong to assign Null to the variable? Thank you
Erel B4X founder Staff member Licensed User Longtime User Jan 13, 2020 #2 Change Pausenzeit type to Object. Code: Copy Dim Pausenzeit As Object = Null Upvote 0