Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle database insert error: invalid data type

2025-01-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Today, when I was working to insert the data in the oracle database, I encountered such an error: invalid data type, and the log also prints out error occurred setting parameters. That's probably what it means. Forget the specific letters. I can also see that the assigned data is inconsistent with the data type of the corresponding field in the database, but the strange thing is:

There are two records in the table, one can be executed successfully, and the other will report an error. This function is to copy the record from the database and then insert it into it.

Because there is a successful execution, I feel that it is not the problem of the program, but the data is wrong, but after comparing the two pieces of data, the valuable fields are of the same type. Without the direction of checking, the wrong sql in the log will not print out the parameters, only insert () values (? ) A bunch of question marks, then passed through the filtered field, half executed

It is found that the problem is that one of the attributes of the assigned object is a user object, and the no property in the user object is stored in the database table. The user object used for the assignment is naturally of the wrong type of error. The record of successful execution is because the attribute is just empty and will not be assigned, so there is no error. The record with value is displayed, and there is no problem with changing it to user.no.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 292

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report