Procedure in Firebird with C #

1

Expensive, good evening

I'm new to Firebird, even though I've messed with it a few times, but nothing professional, but now due to a need the Embedded solution has been set to use.

Well, I'm developing a user interface with Stored Procedure by IBExpert, when I run the code in this environment the return is zero as defined, but in the application (windows.forms with C #) calling the procedure by the ExecuteScalar method or ExecuteNonQuery the return that comes up is -1

Can some blessed person enlighten this person? I wanted to understand why return is -1 and not 0 as defined.

(Below the procedure code)

CREATE OR ALTER PROCEDURE IDB_SP_USU_GRAVA_USUARIO (
 in_usu_id integer,
 in_usu_log varchar(50),
 in_usu_pwd varchar(80),
 in_usu_nam varchar(80),
 in_usu_sta char(1),
 in_usu_dta_val date,
 in_prf_id integer)
 returns ( msg_ret integer )
 as
 BEGIN
 if ( :IN_USU_ID = 0 ) then in_usu_id = NULL;
 if ( ( :in_usu_dta_val < current_date) or (:in_usu_dta_val IS NULL)) then    IN_USU_DTA_VAL = dateadd(year, 1, current_date);

UPDATE or INSERT INTO idb_tb_usu_usuarios
    (usu_id, usu_log, usu_pwd, usu_nam, usu_sta, prf_id, usu_dta_inc, usu_dta_fin)
VALUES
    (:IN_USU_ID, :IN_USU_LOG, :IN_USU_PWD, :IN_USU_NAM, :IN_USU_STA, :IN_PRF_ID, CURRENT_DATE, :IN_USU_DTA_VAL);
MSG_RET = sqlcode;

END
    
asked by anonymous 21.09.2016 / 03:38

0 answers