2
Hello,
I am trying to add an object to the database by calling my API and I get this error:
ORA-00932: inconsistent datatypes: expected NUMBER got NCLOB
I just wanted some help with directing, comments from where I can get more attention, any little thing, I’m accepting achism, because I really need to sort this out... I’ve been almost two days without knowing what to do... I don’t know where to look...
I’ve checked the data types of the object and the database, they’re the same...
Controller
[HttpPost, Route("api/User/Atualizar/")]
public void Atualizar([FromBody] MeuObjeto model)
{
var Repositorio = new Repositorio();
Repositorio.Adicionar(model); // Erro ocorre aqui
}
Editing
For didactic purposes here, I made it as simple as possible by connecting directly to API
, so I edited the post to facilitate the visualization...
Works the same way and generates the same error...
I would have to do it by C#, above I used the
Convert.ToInt64
to make the conversion ofstring
forlong
, which in other Inserts works, however in this, as I need to go through the previous call to the controller, I received this error...– LeoHenrique
Well, can you debug the type of data that’s coming up in the endpoint update? Maybe you have to force some more casting at some of these points, and where you update with the table, I imagine that there is an SQL that receives the variable with the values received in the API, TO_NUMBER there would not solve?
– Darlei Fernando Zillmer
Then, in debug, I get the correct data, long and string... I don’t have access to that part of the system, I couldn’t modify this that you suggested... I only have access to API...
– LeoHenrique
I asked for help from the staff here, they took a look at some dependencies and it worked... I was really conflicting a class with what was in the bank... I thank you
– LeoHenrique