C# call oracle stored function -


  function ar_knyga_egzistuoja (id number) Return number to make or change number kiekis; Start counting (*) in kniegos with kiekis, where kn_id = id; Returning insect; End;   

C # code:

  conn.Open (); Oracle Commands CMD = New Oracle Commands (); Cmd.Connection = conn; Cmd.CommandText = "ar_knyga_egzistuoja"; Cmd.CommandType = CommandType.StoredProcedure; ODBP parameter param = new ODBP parameter (); Cmd.Parameters.Add ("id", OracleType.Number) .Value = id; Cmd.ExecuteNonQuery (); Var kiekis = convert toString (cmd.Parameters ["kiekis"]. Value); MessageBox.Show (kiekis); cmd.Parameters.RemoveAt (0); Conn.Close ();   

I'm getting the error:

  PLS-00221: 'AR_KNYGA_EGZISTUOJA' is no process or unspecified ORA-06550: line 1, column 7 :   

This process is not a function, but I know that I can call functions like functions, what is wrong

If you mean code ORA-06550 means that the function needs to be rewritten. I'm not seeing anything clearly wrong with the code so that you can have problems like permissions or incorrect table names, and if you can run the function first and foremost in the PL / SQL editor, then you can get that race Afterwards, try ...

  var cmd = new OracleCommand (); Cmd.Connection = conn; Cmd.CommandText = "ar_knyga_egzistuoja"; Cmd.CommandType = CommandType.StoredProcedure; Cmd.Parameters.Add ("id", id); Cmd.Parameters.Add ("kiekis", OracleType.Number); cmd.Parmeters ["kiekis"] Direction = parameter direction. Return value; cmd.Connection.Open (); Cmd.ExecuteNonQuery (); Var kiekis = convert toString (cmd.Parameters ["kiekis"]. Value); MessageBox.Show (kiekis); cmd.Connection.Close (); When a return value of   

kiekis type number is available, it should be able to run the job like a stored procedure for.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -