且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我在mysql数据库中遇到错误

更新时间:2023-02-19 17:20:53





一般在导入时excel sheet到DB有可能出现这个问题。假设我有一张excel表,其中只有一条记录,其余的行都是空的。有时当我们尝试将Excel工作表导入数据库时​​,应该手动删除没有任何数据的行,然后将其导入到数据库中,否则数据库会将剩余的行作为有价值的行进行处理并尝试插入到数据库中,从而导致您遇到的相同错误。



所以如果任何行没有任何数据或者你可以有一个数据,你可以删除记录检查数据库中的条件以跳过这些行。



请按照以下链接更好地理解。

点击此处查看链接参考信息



谢谢

Sisir Patro
Hi,

Generally while importing an excel sheet to DB there is a chance of this issue. Lets say I am having one excel sheet where only one record is there and rest of the rows are empty. Some times when we try to import an excel sheet into DB the rows which does not have any data should be deleted manually and then it should be imported to DB, or else the database will treate the rest of the rows as valued row and try to insert into database and thus result into the same error that you are facing.

So You can delete the records if any row is not having any data or you can have a check condition in the database for the same to skip those rows.

Please follow the following link for better understanding.
Click here for link reference

Thanks
Sisir Patro