Problem with stored procedures in oracle and with .net

0

I have a problem that does not allow me to advance in my work, I hope you can help me.

I'm doing a Web API that connects to a database in Oracle, it's a simple CRUD, I've done the Stored Procedures and everything, I've tried them from Oracle and they work perfectly.

The problem is that after having inserted a registry with the Web API after it no longer works hehe, when I go debugging step by step it hangs in command.ExecuteNonQuery() and since then it does not happen, it is very strange and stresses me a lot because I have no idea what it is, I do not have the code because I can not get it from my work computer but I have an example that I use, to make the connection I use Oracle.DataAccess .

OracleConnection connection = new OracleConnection(connString);
OracleCommand command = new OracleCommand("sp_ejemploarray", connection);
command.CommandType = CommandType.StoredProcedure;

command.Parameters.Add(new OracleParameter { ParameterName = "cadena", 
        Direction = ParameterDirection.Input, OracleDbType = OracleDbType.Varchar2, Value = arrayString });
command.Parameters.Add(new OracleParameter { ParameterName = "ok", OracleDbType = OracleDbType.Int32, Direction = ParameterDirection.Output });

 connection.Open();
 command.ExecuteNonQuery(); //Aquí se queda colgado :(

And the Stored is a simple insert into table(values) values(params); .

Do you know if there is a compatibility problem or something? He does not show me any message or something. An important point : the database is made in Oracle, the Web API with C # and to call it I use a page with an AJAX that calls the API and sends the post parameters, they arrive well, I have three layers and the first two pass well until I reach the data layer that is when the api hangs. Thanks in advance, regards!

    
asked by Guillermo Islas 04.12.2018 в 07:36
source

1 answer

0

I think I already found the error, I still had to put COMMIT; after the INSERT, that's why he was hanging. I guess because after I put it on I did not have any problems.

The Oracle.DataAccess library I downloaded from nuguet, the command.Open (); it is good because when there is an error it shows it when debugging and in this case no, it even passed that fast line, and to the table it could do SELECT without any problem.

I'm having some problems with the differences between SQL Server and Oracle, it's my first time using Oracle and that's why I still fail, but as they say, practice makes the master hehe, greetings and thank you very much for your answers!

    
answered by 06.12.2018 в 02:05