Problem calling to a Oracle Package from c# application

Problem calling to a Oracle Package from c# application

Postby Sergio » Tue 29 Sep 2009 07:22

Hello , i have a problem with this code in c#:

....
OraclePackage package = new OraclePackage();

OracleParameter param1 = new OracleParameter("x_IDCR", Devart.Data.Oracle.OracleDbType.Number);
param1.Direction =System.Data.ParameterDirection.Input;
param1.Value = caratula_id;

OracleParameter param2 = new OracleParameter("x_DeleteMark", Devart.Data.Oracle.OracleDbType.Number);
param2.Direction = System.Data.ParameterDirection.Input;
param2.Value = 1;

OracleParameter param3 = new OracleParameter("s_val", Devart.Data.Oracle.OracleDbType.Char);
param3.Direction = System.Data.ParameterDirection.Output;

this.Connection.Open();
package.Connection = this.Connection;
package.PackageName = "EXDCB_THOT_PK";
package.Parameters.Add(param1);
package.Parameters.Add(param2);
package.Parameters.Add(param3);

// The show whe executed the next Line
object result = package.ExecuteProcedure("Caratula_Delete_Mark", package.Parameters);

this.Connection.Close();

.....

The Error:

ORA-06550: line 2, column 14:
PLS-00306: wrong number or types of arguments in call to 'CARATULA_DELETE_MARK'
ORA-06550: line 2, column 3:
PL/SQL: Statement ignored


I haven´t idea what is the problem , the name of package and oracle function are correct, wha´s happend?


Thaks for all.
Sergio
 
Posts: 2
Joined: Tue 29 Sep 2009 07:14

Postby Sergio » Tue 29 Sep 2009 07:43

I forgot the 'ParameterCheck' parameter in the call.. :roll:
Sergio
 
Posts: 2
Joined: Tue 29 Sep 2009 07:14

Postby Shalex » Tue 29 Sep 2009 09:25

The ParameterCheck property gets or sets a value indicating whether the command object regenerates parameter objects if text of the command is changed.
For more information, please refer to http://www.devart.com/dotconnect/oracle ... Using.html , the Using Parameters section.
Shalex
Devart Team
 
Posts: 7608
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle