Hello!
Please need help, because I have a similar problem:
Im using dotconnect 6.60 with C# in .NET
I have an Stored Procedure in Oracle :
Code: Select all
PROCEDURE AGREGA_CC_CREDITOS(pfcorteANT IN DATE, pfechafin IN DATE)
IS
emesg VARCHAR2 (2500) := 'Testing';
BEGIN
dbms_output.enable(1000000);
BEGIN
INSERT INTO BURO.PRE_BDSALDOS
(FCORTE, STATUS, FUENTEBD, CLNS, CDGCLNS, CICLO, CDGCL, INICICLO, FINCICLO, CANTENTRE, PLAZO, FREQPAGOS, PAGOESP, SALDO, SDOVENCIDO,
NUMPAGVEN, MOP, FCIERRECTA, CVEPREVENC, CDGRG, CDGCO)
(SELECT pfechafin, CC.STATUSCC, CC.FUENTEBD, CC.CLNS, CC.CDGNS, CC.CICLO, CC.CDGCL, CC.INICICLO, CC.FINCICLO, CC.PRCCANTENT,
CC.NUMPAGOS, CC.FREQPAGOS, CC.PAGOPACCL, CC.SALDOCL, CC.SDOVENCL, CC.NUMPAGVEN, CC.PAGOACTUAL, CC.FCIERRECTA,
NULL AS CVEPREVENC, VPRC.CDGRG, VPRC.CDGCO -- null as cdgrg, null as cdgco
FROM CIRCRED.SALDOS CC,
ICARO.VW_PRC VPRC
WHERE CC.FCORTE = pfcorteANT AND CC.FUENTEBD = 'ESIACOM' AND CC.STATUSCC NOT IN ('CIERR')
AND CC.CLNS = VPRC.CLNS AND CC.CDGNS = VPRC.CDGCLNS AND CC.CICLO = VPRC.CICLO AND CC.CDGCL = VPRC.CDGCL);
EXCEPTION
WHEN OTHERS THEN -- <-- Como indicar que atrapa CUALQUIER EXCEPCION SIN DEJAR QUE LA DETECTE .NET ??
emesg := 'ERROR: ' || SQLCODE || '-' || SQLERRM ;
DBMS_OUTPUT.PUT_LINE(emesg);
END;
END AGREGA_CC_CREDITOS;
When i execute it from TOAD or from Sqldeveloper (an oracle tool) it works fine
without any errors or exceptions.
But
This is the code im using to invoke that stored procedure from my app in C# with dotconnect
Code: Select all
//using System.Data.OracleClient; // --> If i use this, runs ok without exceptions!
using Devart.Data.Oracle;
public void Agrega_CC_Creditos(DateTime pfcmesant, DateTime pffin) // 02 -- AGREGA CREDITOS DE CC DE MES ANTERIOR
{
string connectionString = csutils.Varconst.BURO_cnstr;
/* call stored procedure */
using (OracleConnection cn = new OracleConnection(connectionString))
{
OracleCommand cmd = new OracleCommand("BURO.BC_CREDITOS.AGREGA_CC_CREDITOS", cn);
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("pfcorteANT", pfcmesant);
cmd.Parameters.AddWithValue("pfechafin", pffin);
try
{ cn.Open();
cmd.ExecuteNonQuery();
}
catch (OracleException ex)
{
/* handles the exception and does not ignore it */
string mensaje = string.Empty;
mensaje = ex.Message;
MessageBox.Show(mensaje);
}
finally
{
cn.Close();
if (cmd != null) cmd.Dispose();
}
}
}
****
when i excecute it, i get an exception error like this.
ORA-01858: a non-numeric character was found where a numeric was expected\n
ORA-06512: at \"ESIACOM.INICIOREAL\", line 152\n
ORA-06592: CASE not found while executing CASE statement\n
ORA-06512: at \"ESIACOM.FECHAPERIODO\", line 129\n
ORA-06512: at \"ESIACOM.VENCIMIENTOPOST\", line 99\n
ORA-06512: at \"ESIACOM.FINPR\", line 50\n
ORA-06512: at \"BURO.BC_CREDITOS\", line 217\n
ORA-06512: at line 2"
Is there any way to IGNORE that exceptions...?
Thanks in advance...