1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
/****************************************************************************************
* FICHIERS DE DONNES REFERENCEES
****************************************************************************************/
#define _TUXEDO_
#define _YK_FML_H_
#include <sgk_srvh.h>
#include <sxkv_base.h>
#include <sgk_RetClt.h>
#include <sxl_ot_msg_a2a_emis.h>
EXEC SQL BEGIN DECLARE SECTION;
EXEC SQL INCLUDE "sxz_ot_msg_a2a_emis.h";
EXEC SQL END DECLARE SECTION;
EXEC SQL INCLUDE SQLCA;
int sgf_FctInsert_ot_msg_a2a_emis ( aps_st_ot_msg_a2a_emis )
EXEC SQL BEGIN DECLARE SECTION;
sxz_typ_ot_msg_a2a_emis *aps_st_ot_msg_a2a_emis;
EXEC SQL END DECLARE SECTION;
{
/******************************
** Declaration des variables **
*******************************/
int li_CodRet=0;
/* Declaration d'une structure d'indicateurs pour les variables hotes */
EXEC SQL BEGIN DECLARE SECTION;
sxz_i_typ_ot_msg_a2a_emis ls_i_ot_msg_a2a_emis;
EXEC SQL END DECLARE SECTION;
sge_MsgTrace ( SGKE_DEBUT, __LINE__, __FILE__, "tdx_FctInsert_ot_msg_a2a_emis", 0, 0, 0 ) ;
/***************************************************
** REQUETE INSERT **
****************************************************/
EXEC SQL INSERT INTO OT_MSG_A2A_EMIS
(
OT_A2E_NUM_REQ,
OT_A2E_MESSAGE,
OT_A2E_DATE,
OT_A2E_STATUT
)
OT_A2E_NUM_REQ,
OT_A2E_MESSAGE,
OT_A2E_DATE,
OT_A2E_STATUT
)
VALUES
(
:aps_st_ot_msg_a2a_emis->OT_A2E_NUM_REQ :ls_i_ot_msg_a2a_emis.I_OT_A2E_NUM_REQ,
:aps_st_ot_msg_a2a_emis->OT_A2E_MESSAGE :ls_i_ot_msg_a2a_emis.I_OT_A2E_MESSAGE,
:aps_st_ot_msg_a2a_emis->OT_A2E_DATE :ls_i_ot_msg_a2a_emis.I_OT_A2E_DATE,
:aps_st_ot_msg_a2a_emis->OT_A2E_STATUT :ls_i_ot_msg_a2a_emis.I_OT_A2E_STATUT
);
sga_alrt ( sqlca.sqlcode ) ;
if ( zr_Erreur == 1 )
{
if ( zr_Doublon == 1)
{
sprintf ( zr_comp, "INSERT, doublon sur : OT_MSG_A2A_EMIS\n" ) ;
sge_MsgErreur (SGKE_ERRBD, __LINE__, __FILE__, zr_comp, 0, 0, sqlca.sqlcode);
li_CodRet = -3;
}
else if ( zr_DeadLock == 1 )
{
sprintf ( zr_comp, "Deadlock sur : OT_MSG_A2A_EMIS\n" ) ;
sge_MsgTrace ( SGKE_INFO, __LINE__, __FILE__, zr_comp, 0, 0, 0 ) ;
li_CodRet = -2;
}
else
{
sprintf ( zr_comp, "INSERT sur : OT_MSG_A2A_EMIS --> NOK\n" ) ;
sge_MsgErreur ( SGKE_ERRBD, __LINE__, __FILE__, zr_comp, 0, 0,0 ) ;
li_CodRet = -1;
}
}
sge_MsgTrace ( SGKE_FIN, __LINE__, __FILE__, "tdx_FctInsert_ot_msg_a2a_emis", 0, 0, 0 ) ;
return li_CodRet;
} |
Partager