S Sytek Active Member Licensed User Longtime User Aug 14, 2013 #1 Hello Erel! When I Insert a datetime field value PHP: Copy Dim cmd As DBCommand cmd.Initialize cmd.Name = "insert_serial" cmd.Parameters = ArrayAsObject(md5imei,ima.Input,"adddate(current_timestamp,30)","current_timestamp","current_timestamp") reqManager.ExecuteCommand(cmd, "tag") ...The RDC throws me this error. com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: ' current_timestamp' for column 'endaccess' at row 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4094) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2734) I can insert in the phpmyadmin sql command without problem. PHP: Copy insert into serials(serial,name,endaccess,lastaccess,firstaccess) values ('111111','serial name',adddate(current_timestamp,30),current_timestamp,current_timestamp) I'm I Missing Something? Thank's in advance for your help Best Regards! Last edited: Aug 14, 2013
Hello Erel! When I Insert a datetime field value PHP: Copy Dim cmd As DBCommand cmd.Initialize cmd.Name = "insert_serial" cmd.Parameters = ArrayAsObject(md5imei,ima.Input,"adddate(current_timestamp,30)","current_timestamp","current_timestamp") reqManager.ExecuteCommand(cmd, "tag") ...The RDC throws me this error. com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: ' current_timestamp' for column 'endaccess' at row 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4094) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2734) I can insert in the phpmyadmin sql command without problem. PHP: Copy insert into serials(serial,name,endaccess,lastaccess,firstaccess) values ('111111','serial name',adddate(current_timestamp,30),current_timestamp,current_timestamp) I'm I Missing Something? Thank's in advance for your help Best Regards!
S Sytek Active Member Licensed User Longtime User Aug 15, 2013 #2 Sytek said: Hello Erel! When I Insert a datetime field value PHP: Copy Dim cmd As DBCommand cmd.Initialize cmd.Name = "insert_serial" cmd.Parameters = ArrayAsObject(md5imei,ima.Input,"adddate(current_timestamp,30)","current_timestamp","current_timestamp") reqManager.ExecuteCommand(cmd, "tag") ...The RDC throws me this error. com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: ' current_timestamp' for column 'endaccess' at row 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4094) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2734) I can insert in the phpmyadmin sql command without problem. PHP: Copy insert into serials(serial,name,endaccess,lastaccess,firstaccess) values ('111111','serial name',adddate(current_timestamp,30),current_timestamp,current_timestamp) I'm I Missing Something? Thank's in advance for your help Best Regards! Click to expand... EDIT: Hello Erel! I had to remove the Date Functions in the b4a App and added into the server side config file properties PHP: Copy sql.insert_serial=insert into serials(serial,name,endaccess,firstaccess,lastaccess) values (?,?,DATE_ADD(NOW(),INTERVAL 30 DAY),NOW(),NOW()) ...and this Works just fine. Upvote 0
Sytek said: Hello Erel! When I Insert a datetime field value PHP: Copy Dim cmd As DBCommand cmd.Initialize cmd.Name = "insert_serial" cmd.Parameters = ArrayAsObject(md5imei,ima.Input,"adddate(current_timestamp,30)","current_timestamp","current_timestamp") reqManager.ExecuteCommand(cmd, "tag") ...The RDC throws me this error. com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: ' current_timestamp' for column 'endaccess' at row 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4094) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2734) I can insert in the phpmyadmin sql command without problem. PHP: Copy insert into serials(serial,name,endaccess,lastaccess,firstaccess) values ('111111','serial name',adddate(current_timestamp,30),current_timestamp,current_timestamp) I'm I Missing Something? Thank's in advance for your help Best Regards! Click to expand... EDIT: Hello Erel! I had to remove the Date Functions in the b4a App and added into the server side config file properties PHP: Copy sql.insert_serial=insert into serials(serial,name,endaccess,firstaccess,lastaccess) values (?,?,DATE_ADD(NOW(),INTERVAL 30 DAY),NOW(),NOW()) ...and this Works just fine.
Bladimir Carrillo Member Licensed User Longtime User Dec 17, 2015 #3 Hello, How I can insert a datetime value that is not current date time ? My app feature let me save a date time on device internal sqlite database and after sync when I have wifi signal, but the date time value to send to RDC server most be the saved on site (not current date time). I'll appreciate your valuable assistance. Thanks Upvote 0
Hello, How I can insert a datetime value that is not current date time ? My app feature let me save a date time on device internal sqlite database and after sync when I have wifi signal, but the date time value to send to RDC server most be the saved on site (not current date time). I'll appreciate your valuable assistance. Thanks
DonManfred Expert Licensed User Longtime User Dec 17, 2015 #4 This is an old thread. Please start a new thread for your question. Upvote 0