Oracle Package Wizard

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
degas
Posts: 77
Joined: Mon 16 Feb 2009 18:36
Location: Argentina

Oracle Package Wizard

Post by degas » Mon 22 Mar 2010 20:15

The Oracle Package Wizard version 5.20.33 does not support overloaded procedures. Is there a way to work this around?

Another question is when does the Oracle Package Wizard decide when a variable should be nullable or not. Using the script below, the first variable is not nullable and the sencond one is


PROCEDURE DELETE_NOMINACION_GAS_TEMPORAL(pSESSION_ID VARCHAR2,pID_CLIENTE_GAS PLS_INTEGER) is
begin
DELETE DEGNET.NOMINACION_GAS
WHERE SESSION_ID = pSESSION_ID
AND ID_REFERENCIA_SECUNDARIA IN (SELECT ID_REFERENCIA_SECUNDARIA
FROM DESPACHO.REFERENCIA_SECUNDARIA
WHERE ID_CLIENTE_GAS = pID_CLIENTE_GAS);
end;



here is the generated code


public void DeleteNominacionGasTemporal(string psessionId, System.Nullable pidClienteGas, System.Nullable pdiaOperativo) {
OracleParameterCollection parameters;
parameters = this.Parameters;
parameters.Clear();
OracleParameter parameter;
parameter = new OracleParameter("PSESSION_ID", Devart.Data.Oracle.OracleDbType.VarChar);
parameter.Direction = System.Data.ParameterDirection.Input;
parameter.Value = psessionId;
parameters.Add(parameter);
parameter = new OracleParameter("PID_CLIENTE_GAS", Devart.Data.Oracle.OracleDbType.Integer);
parameter.Direction = System.Data.ParameterDirection.Input;
if (pidClienteGas.HasValue) {
parameter.Value = pidClienteGas;
}
else {
parameter.Value = System.DBNull.Value;
}
parameter.Direction = System.Data.ParameterDirection.Input;
parameters.Add(parameter);
parameter = new OracleParameter("PDIA_OPERATIVO", Devart.Data.Oracle.OracleDbType.Date);
parameter.Direction = System.Data.ParameterDirection.Input;
if (pdiaOperativo.HasValue) {
parameter.Value = pdiaOperativo;
}
else {
parameter.Value = System.DBNull.Value;
}
parameter.Direction = System.Data.ParameterDirection.Input;
parameters.Add(parameter);
ExecuteProcedure("DELETE_NOMINACION_GAS_TEMPORAL", parameters);
}

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Tue 23 Mar 2010 17:11

1. As I understand, you are getting the message that offers you to skip the overloaded procedure in dotConnect for Oracle Package Wizard with the 5.20.33 version. I have checked the latest (5.35.79) version, it supports overloaded procedures - generates wrappers for every overload (adds suffix to the name of the next overloaded procedure).

2. For the signature of your DELETE_NOMINACION_GAS_TEMPORAL(pSESSION_ID VARCHAR2,pID_CLIENTE_GAS PLS_INTEGER) procedure in the database, Package Wizard of the 5.35.79 version generated the following signature of method in the C# code:

Code: Select all

public void DeleteNominacionGasTemporal(string psessionId, int pidClienteGas) {
...
}

degas
Posts: 77
Joined: Mon 16 Feb 2009 18:36
Location: Argentina

Post by degas » Thu 25 Mar 2010 15:25

1) It would be great if the package wrapper did not add any suffix (i have not tested). As far as i know there would be no problem with c#generated code by using also overoladed methods. This way is much more clear for the developer who is using the function.

2) Is there a rule that i must be aware of, when setting the Nullable option, as far as how will the wrapper will generate the code.


Thanks

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 26 Mar 2010 14:31

We will investigate the mentioned behaviour and notify you about the results as soon as possible.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Tue 13 Apr 2010 14:18

1) We have changed this behaviour. The suffix will not be added starting from the next build of dotConnect for Oracle.
2) The rule is the following: if you select the "Use Nullable types" option in Oracle Package Wizard, all types will be nullable. The string parameter in your generated code is not marked as nullable, because it is nullable itself. Please refer to MSDN.

Post Reply