/*********************************************
 *           Code generated by the           *
 * Altibase Precompiler2(APRE) Ver.1(7.1.0.1.2)*
 *********************************************/

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ulpLibInterface.h>

/* The variable _esqlopts specifies command-line options
 * {-n, -unsafe_null, stmt caching, ...}
 */
static short _esqlopts[10] = {0,0,1,0,0,0,0,0,0,0};

/*
 *========================================================================
 *
 *   시스템명 : 요금징수 시스템
 *   파 일 명 : wrk_data_handle.pc
 *   작 성 자 : 조보용
 *   작 성 일 : 2012.09.24
 *   수 정 일 :
 *   설    명 :
 *
 *========================================================================
*/

#include <stdio.h>
#include <unistd.h>
#include <strings.h>
#include <string.h>
#include "ora_sql.h"
#include "bas_tbl.h"
#include "passraw.h"
#include "wrk_data_def.h"

/*
*========================================================================
*
*   SYSTEM   : AZN_PLAZA_LANE APP
*   FILE     : tcs_db_def.h
*   Progrmer : JBY (baarong@neighbor21.co.kr)
*   Date     : 2018.07.13
*   Modified :
*   Remark   : Table Information.
*
*========================================================================
*/


#define  _TCS_DB_DEF

/***************************************************************************
   OPRM_DATE_INFO : 일자정보테이블 -ok
***************************************************************************/
struct   oprm_date_info {
    unsigned char    c_plz_id[6+1]; /* 영업소ID */
    unsigned char    c_dat[8+1];    /* 일자 */
    unsigned int     n_date_clss;   /* 일자구분 */
    unsigned char    c_note[100+1]; /* 비고 */
};

typedef struct oprm_date_info   T_OPRM_DATE_INFO;
#define SZ_OPRM_DATE_INFO    sizeof(T_OPRM_DATE_INFO)

/***************************************************************************
   PUBH_DAYEND_FLAG : 일변경FLAG테이블 -ok
***************************************************************************/
struct pubh_dayend_flag {
    unsigned char    c_plz_id[6+1];         /* 영업소ID */
    unsigned char    c_work_date[8+1];      /* 근무일자 */
    unsigned char    c_lane_no[2+1];        /* 차로번호 */
    unsigned char    c_occrn_date_tm[14+1]; /* 발생일시 */
};

typedef struct pubh_dayend_flag   T_PUBH_DAYEND_FLAG;
#define SZ_PUBH_DAYEND_FLAG    sizeof(T_PUBH_DAYEND_FLAG)

/***************************************************************************
   OPRO_TABLE_NO : 개정번호관리 -ok
***************************************************************************/
struct   opro_table_no {
    unsigned char    c_plz_id[6+1];                     /* 영업소ID */
    unsigned char    c_basc_modf_date_tm[14+1];         /* 기초정보수정일시 */
    unsigned char    c_basc_apl_date_tm[14+1];          /* 기초정보적용일시 */
    unsigned int     n_basc_rvs_no;                     /* 기초정보개정번호 */
    unsigned char    c_workr_modf_date_tm[14+1];        /* 근무자정보수정일시 */
    unsigned char    c_workr_apl_date_tm[14+1];         /* 근무자정보적용일시 */
    unsigned int     n_workr_rvs_no;                    /* 근무자정보개정번호 */
    unsigned char    c_fare_modf_date_tm[14+1];         /* 요금수정일시 */
    unsigned char    c_fare_apl_date_tm[14+1];          /* 요금적용일시 */
    unsigned int     n_fare_rvs_no;                     /* 요금개정번호 */
    unsigned char    c_rgstr_tag_bl_modf_date_tm[14+1]; /* 무효기명 TAG 수정일시 */
    unsigned char    c_rgstr_tag_bl_apl_date_tm[14+1];  /* 무효기명 TAG적용일시 */
    unsigned int     n_rgstr_tag_bl_rvs_no;             /* 무효기명 TRG B/L 개정번호 */
    unsigned char    c_iss_comp_modf_date_tm[14+1];     /* RFID발행사정보수정일시 */
    unsigned char    c_iss_comp_apl_date_tm[14+1];      /* RFID발행사정보적용일시 */
    unsigned int     n_iss_comp_rvs_no;                 /* RFID발행사정보개정번호 */
    unsigned char    c_perd_tag_pl_modf_date_tm[14+1];  /* 기간권P/L 수정일시 */
    unsigned char    c_perd_tag_pl_apl_date_tm[14+1];   /* 기간권P/L 적용일시 */
    unsigned int     n_perd_tag_pl_rvs_no;              /* 기간권P/L 개정번호 */
    unsigned char    c_prev_fare_cls_date_tm[14+1];     /* 구요금폐쇄일시 */
};

typedef struct opro_table_no   T_OPRO_TABLE_NO;
#define SZ_OPRO_TABLE_NO    sizeof(T_OPRO_TABLE_NO)

/***************************************************************************
   OPRM_BASIC_INFO : 영업소기초정보 -ok
***************************************************************************/
struct   oprm_basic_info {
    unsigned char    c_plz_id[6+1]; /* 영업소ID */
    unsigned char    c_plz_nm[30+1]; /* 영업소명 */
    unsigned char    c_eng_plz_nm[30+1]; /* 영업소명(영문) */
    unsigned char    c_plz_phone[30+1]; /* 영업소전화번호 */
    unsigned char    c_day_chng_tme[4+1]; /* 일변경시각 */
    unsigned char    c_dayend_date_tm[4+1]; /* 일마감일시 */
    unsigned int     n_ggup_lane_cnt; /* 상행차로수 */
    unsigned int     n_ggdwn_lane_cnt; /* 하행차로수 */
    unsigned int     n_cngb_lane_cnt; /* 가변차로수 */
    unsigned char    c_iss_comp_cd[2+1]; /* 발행사코드 */
    unsigned char    c_modf_date_tm[14+1]; /* 최종수정일시 */
    unsigned char    c_comp_cd[2+1]; /* 회사코드 */
    unsigned char    c_oprtn_comp_cd[6+1]; /* 운영기관ID */
    unsigned char    c_long_plz_id[6+1]; /* 최장영업소ID */
    unsigned int     n_max_chrg_amt; /* 1회최대충전금액 */
    unsigned int     n_max_chrg_blnc; /* 최대충전잔액 */
    unsigned char    c_rtdc_tag_new_apl_date[14+1]; /* 감면TAG신정보적용일시 */
    unsigned char    c_rtdc_tag_pre_cls_date[14+1]; /* 감면TAG구정보폐쇄일시 */
};

typedef struct oprm_basic_info   T_OPRM_BASIC_INFO;
#define SZ_OPRM_BASIC_INFO    sizeof(T_OPRM_BASIC_INFO)

/***************************************************************************
   OPRM_RDCT_APL_INFO : 감면 적용 정보
***************************************************************************/
struct   oprm_rdct_apl_info {
    unsigned char    c_tag_atrb[1+1]; /* TAG 속성 */
    unsigned char    c_rdct_type[1+1]; /* 면제/할인구분 */
    unsigned char    c_use_yn[1+1]; /* 사용여부 */
    unsigned char    c_nw_apl_vhcl_clss[6+1]; /* 신적용차종 */
    unsigned char    c_prev_apl_vhcl_clss[6+1]; /* 구적용차종 */
    unsigned int     n_nw_dcrte1; /* 신할인율1종 */
    unsigned int     n_nw_dcrte2; /* 신할인율2종 */
    unsigned int     n_nw_dcrte3; /* 신할인율3종 */
    unsigned int     n_nw_dcrte4; /* 신할인율4종 */
    unsigned int     n_nw_dcrte5; /* 신할인율5종 */
    unsigned int     n_nw_dcrte6; /* 신할인율6종 */
    unsigned int     n_prev_dcrte1; /* 구할인율1종 */
    unsigned int     n_prev_dcrte2; /* 구할인율2종 */
    unsigned int     n_prev_dcrte3; /* 구할인율3종 */
    unsigned int     n_prev_dcrte4; /* 구할인율4종 */
    unsigned int     n_prev_dcrte5; /* 구할인율5종 */
    unsigned int     n_prev_dcrte6; /* 구할인율6종 */
};

typedef struct oprm_rdct_apl_info   T_OPRM_RDCT_APL_INFO;
#define SZ_OPRM_RDCT_APL_INFO    sizeof(T_OPRM_RDCT_APL_INFO)

/***************************************************************************
   OPRM_LANE_INFO : 차로정보 -ok
***************************************************************************/
struct   oprm_lane_info {
    unsigned char    c_plz_id[6+1]; /* 영업소ID */
    unsigned char    c_pscl_lane_no[2+1]; /* 물리차로번호 */
    unsigned char    c_logc_lane_no[2+1]; /* 논리차로번호 */
    unsigned char    c_lane_clss[1+1]; /* 차로구분 */
    unsigned char    c_inout_clss[1+1]; /* 입출구 구분 */
    unsigned char    c_lane_type[1+1]; /* 차로형태 */
    unsigned char    c_vhcl_decd_ss1[2+1]; /* 차량판독시간1 */
    unsigned char    c_vhcl_decd_ss2[2+1]; /* 차량판독시간2 */
    unsigned char    c_lane_nm[7+1]; /* 차로명 */
    unsigned char    c_ip_addr[16+1]; /* IP주소 */
    unsigned char    c_port[8+1]; /* PORT */
    unsigned char    c_note[40+1]; /* 비고 */
    unsigned char    c_drct_nm[30+1]; /* 방향명 */
    unsigned char    c_sub_port[8+1]; /* SUBPORT */
};

typedef struct oprm_lane_info   T_OPRM_LANE_INFO;
#define SZ_OPRM_LANE_INFO    sizeof(T_OPRM_LANE_INFO)

/***************************************************************************
   OPRM_USER_INFO : 근무자 기초정보 -ok
***************************************************************************/
struct   oprm_user_info {
    unsigned char    c_mngmt_plz_id[6+1]; /* 관리영업소ID */
    unsigned char    c_workr_no[6+1];     /* 근무자번호 */
    unsigned char    c_workr_nm[30+1];    /* 근무자명 */
    unsigned char    c_comp_no[8+1];      /* 사번 */
    unsigned char    c_empl_crd_no[16+1]; /* 직원카드번호 */
};

typedef struct oprm_user_info   T_OPRM_USER_INFO;
#define SZ_OPRM_USER_INFO    sizeof(T_OPRM_USER_INFO)

/***************************************************************************
   OPRM_FARE_INFO : 요금정보
***************************************************************************/
struct   oprm_fare_info {
    unsigned char    c_plz_id[6+1]; /* 영업소 ID */
    unsigned char    c_plz_nm[30+1]; /* 영업소명 */
    unsigned char    c_in_plz_id[6+1]; /* 입구 영업소 ID */
    unsigned char    c_in_plz_nm[30+1]; /* 입구 영업소명 */
    unsigned char    c_out_plz_id[6+1]; /* 출구 영업소 ID */
    unsigned char    c_out_plz_nm[30+1]; /* 출구 영업소명 */
    unsigned int     n_min_fare; /* 최소요금 */
    unsigned char    c_limit_hh[2+1]; /* 제한시간-시 */
    unsigned char    c_limit_mi[2+1]; /* 제한시간-분 */
    unsigned int     n_nw_fare_clss1; /* 1종_신요금 */
    unsigned int     n_prev_fare_clss1; /* 1종_구요금 */
    unsigned int     n_nw_fare_clss2; /* 2종_신요금 */
    unsigned int     n_prev_fare_clss2; /* 2종_구요금 */
    unsigned int     n_nw_fare_clss3; /* 3종_신요금 */
    unsigned int     n_prev_fare_clss3; /* 3종_구요금 */
    unsigned int     n_nw_fare_clss4; /* 4종_신요금 */
    unsigned int     n_prev_fare_clss4; /* 4종_구요금 */
    unsigned int     n_nw_fare_clss5; /* 5종_신요금 */
    unsigned int     n_prev_fare_clss5; /* 5종_구요금 */
    unsigned int     n_nw_fare_clss6; /* 6종_신요금 */
    unsigned int     n_prev_fare_clss6; /* 6종_구요금 */
};

typedef struct oprm_fare_info   T_OPRM_FARE_INFO;
#define SZ_OPRM_FARE_INFO    sizeof(T_OPRM_FARE_INFO)

/***************************************************************************
   P : 기간TAG 판매금액
***************************************************************************/
struct   oprm_perd_tag_fare_info {
    unsigned char    c_plz_id[6+1]; /* 영업소ID */
    unsigned char    c_tag_atrb[1+1]; /* TAG 속성 */
    unsigned char    c_tag_atrb_dtl_cd[2+1]; /* TAG 속성 세부코드 */
    unsigned int     n_prev_fare_clss1; /* 1종_구요금 */
    unsigned int     n_nw_fare_clss1; /* 1종_신요금 */
    unsigned int     n_prev_fare_clss2; /* 2종_구요금 */
    unsigned int     n_nw_fare_clss2; /* 2종_신요금 */
    unsigned int     n_prev_fare_clss3; /* 3종_구요금 */
    unsigned int     n_nw_fare_clss3; /* 3종_신요금 */
    unsigned int     n_prev_fare_clss4; /* 4종_구요금 */
    unsigned int     n_nw_fare_clss4; /* 4종_신요금 */
    unsigned int     n_prev_fare_clss5; /* 5종_구요금 */
    unsigned int     n_nw_fare_clss5; /* 5종_신요금 */
    unsigned int     n_prev_fare_clss6; /* 6종_구요금 */
    unsigned int     n_nw_fare_clss6; /* 6종_신요금 */
};

typedef struct oprm_perd_tag_fare_info   T_OPRM_PERD_TAG_FARE_INFO;
#define SZ_OPRM_PERD_TAG_FARE_INFO    sizeof(T_OPRM_PERD_TAG_FARE_INFO)

/***************************************************************************
   OPRM_RGSTR_TAG_BL : 기명TAG B/L 마스터
***************************************************************************/
struct   oprm_rgstr_tag_bl {
    unsigned int     d_seq_no;             /* 관리연번 */
    unsigned char    c_tag_id[24+1];       /* TAG ID */
    unsigned char    c_rgst_yn[1+1];       /* 등록 여부 */
    unsigned char    c_rgst_date_tm[14+1]; /* 등록일시 */
};

typedef struct oprm_rgstr_tag_bl   T_OPRM_RGSTR_TAG_BL;
#define SZ_OPRM_RGSTR_TAG_BL    sizeof(T_OPRM_RGSTR_TAG_BL)

/***************************************************************************
   OPRC_RGSTR_TAG_BL : 기명TAG B/L 변경분
***************************************************************************/
struct   oprc_rgstr_tag_bl {
    unsigned int     d_seq_no;             /* 관리연번 */
    unsigned char    c_tag_id[24+1];       /* TAG ID */
    unsigned char    c_rgst_yn[1+1];       /* 등록 여부 */
    unsigned char    c_rgst_date_tm[14+1]; /* 등록일시 */
};

typedef struct oprc_rgstr_tag_bl   T_OPRC_RGSTR_TAG_BL;
#define SZ_OPRC_RGSTR_TAG_BL    sizeof(T_OPRC_RGSTR_TAG_BL)

/***************************************************************************
   OPRM_ISS_COMP_INFO : 발행사정보
***************************************************************************/
struct   oprm_iss_comp_info {
    unsigned char    c_iss_comp_cd[2+1]; /* 발행사코드 */
    unsigned char    c_iss_nm[30+1];     /* 발행사명 */
    unsigned char    c_use_yn[1+1];      /* 사용여부 */
};

typedef struct oprm_iss_comp_info   T_OPRM_ISS_COMP_INFO;
#define SZ_OPRM_ISS_COMP_INFO    sizeof(T_OPRM_ISS_COMP_INFO)

/***************************************************************************
   OPRM_PERD_TAG_PL : 기간TAG P/L 마스터
***************************************************************************/
struct   oprm_perd_tag_pl {
    unsigned int     d_seq_no;             /* 관리연번 */
    unsigned char    c_tag_id[24+1];       /* TAG ID */
    unsigned char    c_rgst_yn[1+1];       /* 등록 여부 */
    unsigned char    c_rgst_date_tm[14+1]; /* 등록일시 */
};

typedef struct oprm_perd_tag_pl   T_OPRM_PERD_TAG_PL;
#define SZ_OPRM_PERD_TAG_PL    sizeof(T_OPRM_PERD_TAG_PL)

/***************************************************************************
   OPRC_PERD_TAG_PL : 기간TAG P/L 변경분
***************************************************************************/
struct   oprc_perd_tag_pl {
    unsigned int     d_seq_no;             /* 관리연번 */
    unsigned char    c_tag_id[24+1];       /* TAG ID */
    unsigned char    c_rgst_yn[1+1];       /* 등록 여부 */
    unsigned char    c_rgst_date_tm[14+1]; /* 등록일시 */
};

typedef struct oprc_perd_tag_pl   T_OPRC_PERD_TAG_PL;
#define SZ_OPRC_PERD_TAG_PL    sizeof(T_OPRC_PERD_TAG_PL)

/***************************************************************************
   OPRO_LANE_STAT : 차로상태정보 -ok
***************************************************************************/
struct   opro_lane_stat {
    unsigned char    c_plz_id[6+1]; /* 영업소ID */
    unsigned char    c_lane_no[2+1]; /* 차로번호 */
    unsigned char    c_lane_clss[1+1]; /* 차로구분 */
    unsigned char    c_insr_stat[8+1]; /* 기기상태 */
    unsigned char    c_basc_stat[1+1]; /* 기초상태 */
    unsigned int     n_basc_rvs_no; /* 기초정보개정번호 */
    unsigned char    c_workr_crd_stat[1+1]; /* 근무자카드상태 */
    unsigned int     n_workr_crd_rvs_no; /* 근무자카드개정번호 */
    unsigned char    c_fare_stat[1+1]; /* 요금상태 */
    unsigned int     n_fare_rvs_no; /* 요금개정번호 */
    unsigned char    c_rgstr_tag_bl_stat[1+1]; /* 기명 TAG B/L 상태 */
    unsigned int     n_rgstr_tag_bl_rvs_no; /* 기명 TAG B/L 개정번호 */
    unsigned char    c_iss_comp_cd_stat[1+1]; /* TAG 발행사코드 상태 */
    unsigned int     n_iss_comp_cd_rvs_no; /* TAG 발행사코드 개정번호 */
    unsigned char    c_perd_tag_pl_stat[1+1]; /* 기간권 P/L 상태 */
    unsigned int     n_perd_tag_pl_rvs_no; /* 기간권 P/L 개정번호 */
    unsigned char    c_control_type[2+1]; /* 제어기구분 */
    unsigned char    c_comm_stat[1+1]; /* 통신상태 */
    unsigned char    c_fw_ver[4+1]; /* 차로F/W버전 */
    unsigned int     d_rgstr_tag_bl_last_seq; /* 기명 TAG B/L 최종처리일련번호 */
    unsigned int     d_perd_tag_pl_last_seq; /* 기간권 P/L 최종처리일련번호 */
    unsigned char    c_last_gthr_date_tm[14+1]; /* 최종수집일시 */
    unsigned char    c_work_date[8+1]; /* 근무일자 */
    unsigned char    c_work_no[4+1]; /* 근무번호 */
    unsigned int     n_last_recv_trnm_seq; /* 최종수신전송연번 */
    unsigned int     n_grt_trnm_seq; /* 보증전송연번 */
    unsigned char    c_dayend_recv_date_tm[14+1]; /* 일마감 수신일시 */
    unsigned char    c_work_strt_date_tm[14+1]; /* 근무개시일시 */
    unsigned char    c_work_end_date_tm[14+1]; /* 근무종료일시 */
    unsigned char    c_strt_trnm_seq[8+1]; /* 개시전송일련번호 */
    unsigned char    c_end_trnm_seq[4+1]; /* 종료전송일련번호 */
};

typedef struct opro_lane_stat   T_OPRO_LANE_STAT;
#define SZ_OPRO_LANE_STAT    sizeof(T_OPRO_LANE_STAT)

/***************************************************************************
   PUBH_EQUIP_STAT : 장비상태(보수데이터)
***************************************************************************/
struct   pubh_equip_stat {
    unsigned char    c_plz_id[6+1];         /* 영업소ID */
    unsigned int     d_seq;                 /* 전송연번 */
    unsigned char    c_work_no[4+1];        /* 근무번호 */
    unsigned char    c_occrn_date_tm[14+1]; /* 발생일시 */
    unsigned char    c_lane_no[2+1];        /* 차로번호 */
    unsigned char    c_work_stat[1+1];      /* 근무상태 */
    unsigned char    c_knmc[2+1];           /* 기종 */
    unsigned char    c_recvr_tn[1+1];       /* 복구여부 */
    unsigned char    c_err_cd[2+1];         /* 에러코드 */
};

typedef struct pubh_equip_stat   T_PUBH_EQUIP_STAT;
#define SZ_PUBH_EQUIP_STAT    sizeof(T_PUBH_EQUIP_STAT)

/***************************************************************************
   PUBO_PASS_CLOSE : 폐쇄차로 통행명세
***************************************************************************/
struct   pubo_pass_close {
    unsigned char    c_plz_id[6+1];         /* 영업소ID */
    unsigned char    c_lane_no[2+1];        /* 차로번호 */
    unsigned char    c_work_date[8+1];      /* 근무일자 */
    unsigned int     d_seq;                 /* 일련번호 */
    unsigned char    c_occrn_date_tm[14+1]; /* 발생일시 */
    unsigned int     n_forwd_backwd_type;   /* 전진/후진 구분 */
    unsigned int     n_sens_vhcl_clss;      /* 감지차종 */
    unsigned int     n_img_no;              /* 영상번호 */
    unsigned int     n_axle;                /* 축수 */
    unsigned int     n_trwdt;               /* 윤폭 */
    unsigned int     n_trtrd;               /* 윤거 */
    unsigned int     n_breath;              /* 차폭 */
    unsigned int     n_cond;                /* 차장 */
    unsigned int     n_garage;              /* 차고 */
    unsigned int     n_point;               /* 위치 */
    unsigned int     n_sped;                /* 속도 */
    unsigned char    c_prcs_stat[1+1];      /* 처리상태 */
};

typedef struct pubo_pass_close   T_PUBO_PASS_CLOSE;
#define SZ_PUBO_PASS_CLOSE    sizeof(T_PUBO_PASS_CLOSE)

/***************************************************************************
   PUBO_SENSING : 감지데이터
***************************************************************************/
struct   pubo_sensing {
    unsigned char    c_plz_id[6+1];            /* 영업소ID */
    unsigned char    c_work_date[8+1];         /* 근무일자 */
    unsigned char    c_work_no[4+1];           /* 근무번호 */
    unsigned char    c_sens_date_tm[14+1];     /* 감지일시 */
    unsigned int     d_sens_seq;               /* 감지일련번호 */
    unsigned char    c_forwd_backwd_type[1+1]; /* 전진/후진 구분 */
    unsigned char    c_sens_vhcl_clss[1+1];    /* 감지차종 */
    unsigned int     n_axle;                   /* 축수 */
    unsigned int     n_trwdt;                  /* 윤폭 */
    unsigned int     n_trtrd;                  /* 윤거 */
    unsigned int     n_breath;                 /* 차폭 */
    unsigned int     n_cond;                   /* 차장 */
    unsigned int     n_garage;                 /* 차고 */
    unsigned int     n_point;                  /* 위치 */
    unsigned int     n_sped;                   /* 속도 */
    unsigned char    c_prcs_yn[2+1];           /* 처리여부 */
    unsigned int     d_trnm_seq;               /* 전송일련번호 */
    unsigned char    c_vio_caus[2+1];          /* 위반사유 */
    unsigned char    c_tag_id[24+1];           /* TAG ID */
};

typedef struct pubo_sensing   T_PUBO_SENSING;
#define SZ_PUBO_SENSING    sizeof(T_PUBO_SENSING)

/***************************************************************************
   PUBO_WORK_STATE : 근무상태정보
***************************************************************************/
struct   pubo_work_state {
    unsigned char    c_plz_id[6+1];        /* 영업소ID */
    unsigned char    c_work_date[8+1];     /* 근무일자 */
    unsigned char    c_work_no[4+1];       /* 근무번호 */
    unsigned char    c_lane_type[2+1];     /* 차로구분 */
    unsigned char    c_workr_no[6+1];      /* 근무자번호 */
    unsigned char    c_strt_date_tm[14+1]; /* 개시일시 */
    unsigned char    c_end_tm[14+1];       /* 종료일시 */
    unsigned char    c_end_type[1+1];      /* 종료구분 */
    unsigned int     n_strt_trnm_seq;      /* 개시전송일련번호 */
    unsigned int     n_end_trnm_seq;       /* 종료전송일련번호 */
    unsigned char    c_work_type[1+1];     /* 근무구분 */
    unsigned char    c_work_end_stat[1+1]; /* 근무마감상태 */
};

typedef struct pubo_work_state   T_PUBO_WORK_STATE;
#define SZ_PUBO_WORK_STATE    sizeof(T_PUBO_WORK_STATE)

/***************************************************************************
   PUBO_OUT_WAY_PRCS : 출구처리데이터 Check
***************************************************************************/
struct   pubo_out_way_prcs {
    unsigned char    c_plz_id[6+1];                  /* 영업소ID */
    unsigned char    c_work_date[8+1];               /* 근무일자 */
    unsigned char    c_work_no[4+1];                 /* 근무번호 */
    unsigned int     d_trnm_seq;                     /* 전송일련번호 */
    unsigned int     d_prcs_seq;                     /* 처리일련번호 */
    unsigned char    c_lane_type[2+1];               /* 차로구분 */
    unsigned int     d_etcs_prcs_seq;                /* ETCS 처리일련번호 */
    unsigned char    c_in_way_prcs_date_tm[14+1];    /* 입구진입일시 */
    unsigned char    c_in_way_plz_id[6+1];           /* 입구영업소ID */
    unsigned char    c_in_way_work_date[8+1];        /* 입구영업소 근무일자 */
    unsigned char    c_in_way_work_no[4+1];          /* 입구영업소 근무번호 */
    unsigned int     d_in_way_prcs_seq;              /* 입구영업소 처리일련번호 */
    unsigned char    c_in_way_sens_vhcl_clss[1+1];   /* 입구영업소_감지차종 */
    unsigned char    c_in_way_prcs_vhcl_clss[1+1];   /* 입구영업소_처리차종 */
    unsigned char    c_prcs_date_tm[14+1];           /* 처리일시 */
    unsigned char    c_vio_cd[2+1];                  /* 위반코드 */
    unsigned int     d_org_toll;                     /* 원통행요금 */
    unsigned int     d_toll;                         /* 통행요금 */
    unsigned int     n_pymt_dc_rate;                 /* 지불할인율 */
    unsigned int     d_rcpt_toll;                    /* 수납금액 */
    unsigned int     d_rcpt_prev_balc;               /* 수납전잔액 */
    unsigned char    c_rcpt_prcs_type[2+1];          /* 수납처리구분 */
    unsigned char    c_rcpt_prcs_type_dtl_cd[2+1];   /* 수납처리구분세부코드 */
    unsigned char    c_work_type[1+1];               /* 근무구분 */
    unsigned char    c_sens_vhcl_clss[1+1];          /* 감지차종 */
    unsigned char    c_prcs_vhcl_clss[1+1];          /* 처리차종 */
    unsigned char    c_img_vhcl_no[24+1];            /* 영상차량번호 */
    unsigned char    c_rcpt_type[1+1];               /* 수납구분 */
    unsigned char    c_online_type[1+1];             /* 온라인구분 */
    unsigned int     d_sens_seq;                     /* 감지일련번호 */
    unsigned char    c_tag_id[24+1];                 /* TAG ID */
    unsigned char    c_iss_comp_cd[2+1];             /* 발행사 코드 */
    unsigned char    c_iss_comp_cd_consns_yn[1+1];   /* 발행사 코드 일치여부 */
    unsigned char    c_tag_vhcl_clss[1+1];           /* TAG 차종 */
    unsigned char    c_tag_vhcl_clss_consns_yn[1+1]; /* TAG 차종 일치여부 */
    unsigned char    c_tag_atrb[1+1];                /* TAG 속성 */
    unsigned char    c_tag_atrb_consns_yn[1+1];      /* TAG 속성 일치여부 */
    unsigned char    c_tag_vhcl_no[10+1];            /* TAG 차량번호 */
    unsigned char    c_tag_vhcl_no_consns_yn[1+1];   /* TAG 차량번호 일치여부 */
    unsigned char    c_vald_term[8+1];               /* 유효기간 */
    unsigned char    c_tag_vald_term_yn[1+1];        /* TAG 유효기간 일치여부 */
    unsigned char    c_tag_crc[2+1];                 /* TAG CRC */
    unsigned char    c_tag_crc_consns_yn[1+1];       /* TAG CRC 일치여부 */
    unsigned char    c_tag_sgnt[4+1];                /* TAG 서명값 */
    unsigned char    c_many_tag_yn[1+1];             /* MANY TAG 여부 */
    unsigned char    c_vhcl_clss_modf_yn[1+1];       /* 차종수정여부 */
    unsigned char    c_vhcl_no_modf_yn[1+1];         /* 차량번호수정여부 */
    unsigned char    c_toll_modf_yn[1+1];            /* 통행요금수정여부 */
    unsigned char    c_vhcl_no_info_yn[1+1];         /* 차량번호 정보 존재 여부 */
    unsigned char    c_dpaymt_contrct_yn[1+1];       /* 후불약정여부 */
    unsigned char    c_audt_type[1+1];               /* 심사처리구분 */
    unsigned char    c_in_way_info_modf_yn[1+1];     /* 입구정보 수정여부 */
};

typedef struct pubo_out_way_prcs   T_PUBO_OUT_WAY_PRCS;
#define SZ_PUBO_OUT_WAY_PRCS    sizeof(T_PUBO_OUT_WAY_PRCS)

/***************************************************************************
   PUBO_PRCS_VHCL_NO : 처리차량번호데이터 Check
***************************************************************************/
struct   pubo_prcs_vhcl_no {
    unsigned char    c_plz_id[6+1]; /* 영업소ID */
    unsigned char    c_work_date[8+1]; /* 근무일자 */
    unsigned char    c_work_no[4+1]; /* 근무번호 */
    unsigned char    c_workr_no[6+1]; /* 근무자번호 */
    unsigned int     d_prcs_seq; /* 처리일련번호 */
    unsigned int     d_etcs_prcs_seq; /* ETCS 처리일련번호 */
    unsigned char    c_prcs_vhcl_no[30+1]; /* 처리차량번호 */
    unsigned char    c_last_prcs_vhcl_no[30+1]; /* 최종처리차량번호 */
    unsigned char    c_note[100+1]; /* 비고 */
};

typedef struct pubo_prcs_vhcl_no   T_PUBO_PRCS_VHCL_NO;
#define SZ_PUBO_PRCS_VHCL_NO    sizeof(T_PUBO_PRCS_VHCL_NO)

/***************************************************************************
   PUBO_IN_WAY_PRCS : 입구처리데이터  Check
***************************************************************************/
struct   pubo_in_way_prcs {
    unsigned char    c_plz_id[6+1]; /* 영업소ID */
    unsigned char    c_work_date[8+1]; /* 근무일자 */
    unsigned char    c_work_no[4+1]; /* 근무번호 */
    unsigned int     d_trnm_seq; /* 전송일련번호 */
    unsigned int     d_prcs_seq; /* 처리일련번호 */
    unsigned char    c_workr_no[6+1]; /* 근무자번호 */
    unsigned char    c_lane_type[2+1]; /* 차로구분 */
    unsigned int     d_etcs_prcs_seq; /* ETCS 처리일련번호 */
    unsigned char    c_prcs_date_tm[14+1]; /* 처리일시 */
    unsigned char    c_vio_cd[2+1]; /* 위반코드 */
    unsigned char    c_rcpt_prcs_type[2+1]; /* 수납처리구분 */
    unsigned char    c_rcpt_prcs_type_dtl_cd[2+1]; /* 수납처리구분세부코드 */
    unsigned char    c_online_type[1+1]; /* 온라인 구분 */
    unsigned char    c_work_type[1+1]; /* 근무구분 */
    unsigned char    c_sens_vhcl_clss[1+1]; /* 감지차종 */
    unsigned char    c_prcs_vhcl_clss[1+1]; /* 처리차종 */
    unsigned char    c_img_vhcl_no[30+1]; /* 영상차량번호 */
    unsigned char    c_rcpt_type[1+1]; /* 수납구분 */
    unsigned char    c_tag_id[24+1]; /* TAG ID */
    unsigned char    c_iss_comp_cd[2+1]; /* 발행사코드 */
    unsigned char    c_iss_comp_cd_consns_yn[1+1]; /* 발행사 코드 일치여부 */
    unsigned char    c_tag_vhcl_clss[1+1]; /* TAG 차종 */
    unsigned char    c_tag_vhcl_clss_consns_yn[1+1]; /* TAG 차종 일치여부 */
    unsigned char    c_tag_atrb[1+1]; /* TAG 속성 */
    unsigned char    c_tag_atrb_consns_yn[1+1]; /* TAG 속성 일치여부 */
    unsigned char    c_tag_vhcl_no[10+1]; /* TAG 차량번호 */
    unsigned char    c_tag_vhcl_no_consns_yn[1+1]; /* TAG 차량번호 일치여부 */
    unsigned char    c_vald_term[8+1]; /* 유효기간 */
    unsigned char    c_tag_vald_term_yn[1+1]; /* TAG 유효기간 일치여부 */
    unsigned char    c_tag_crc[2+1]; /* TAG CRC */
    unsigned char    c_tag_crc_consns_yn[1+1]; /* TAG CRC 일치여부 */
    unsigned char    c_tag_sgnt[4+1]; /* TAG 서명값 */
    unsigned int     d_sens_seq; /* 감지일련번호 */
    unsigned char    c_many_tag_yn[1+1]; /* MANY TAG 여부 */
    unsigned char    c_vhcl_clss_modf_yn[1+1]; /* 차종수정여부 */
    unsigned char    c_vhcl_no_modf_yn[1+1]; /* 차량번호수정여부 */
    unsigned char    c_toll_modf_yn[1+1]; /* 통행요금수정여부 */
    unsigned char    c_audt_type[2+1]; /* 심사처리구분 */
    unsigned char    c_tag_info_modf_yn[1+1];
};

typedef struct pubo_in_way_prcs   T_PUBO_IN_WAY_PRCS;
#define SZ_PUBO_IN_WAY_PRCS    sizeof(T_PUBO_IN_WAY_PRCS)

/***************************************************************************
   TCSO_PERD_TAG_SALE : 기간TAG 판매 Check(몇일권인지 구분은?)
***************************************************************************/
struct   tcso_perd_tag_sale {
    unsigned char    c_plz_id[6+1]; /* 영업소번호 */
    unsigned char    c_work_date[8+1]; /* 근무일자 */
    unsigned char    c_work_no[4+1]; /* 근무번호 */
    unsigned char    c_workr_no[6+1]; /* 근무자번호 */
    unsigned int     n_prcs_seq; /* 처리일련번호 */
    unsigned char    c_tag_id[24+1]; /* TAG ID */
    unsigned char    c_iss_comp_cd[2+1]; /* 발행사코드 */
    unsigned char    c_tag_vhcl_clss[1+1]; /* TAG차종 */
    unsigned char    c_tag_atrb[1+1]; /* TAG속성 */
    unsigned char    c_vald_term[14+1]; /* 유효기간 */
    unsigned char    c_tag_crc[2+1]; /* TAG CRC */
    unsigned char    c_iss_date_tm[14+1]; /* 발행일시 */
    unsigned int     n_sale_amt; /* 판매금액 */
    unsigned char    c_isnc_vhcl_no[12+1]; /* 발급차량번호(영어+숫자) */
    unsigned char    c_tag_atrb_dtl_cd[2+1]; /* 세부코드 */
    unsigned char    c_tag_vhcl_no[8+1]; /* TAG차량번호 */
};

typedef struct tcso_perd_tag_sale   T_TCSO_PERD_TAG_SALE;
#define SZ_TCSO_PERD_TAG_SALE    sizeof(T_TCSO_PERD_TAG_SALE)

/***************************************************************************
   TCSO_RGSTR_TAG_CHRG : 기명TAG 충전
***************************************************************************/
struct   tcso_rgstr_tag_chrg {
    unsigned char    c_plz_id[6+1]; /* 영업소ID */
    unsigned char    c_work_date[8+1]; /* 근무일자 */
    unsigned char    c_work_no[4+1]; /* 근무번호 */
    unsigned char    c_workr_no[6+1]; /* 근무자번호 */
    unsigned int     d_prcs_seq; /* 처리일련번호 */
    unsigned char    c_iss_comp_cd[2+1]; /* 발행사코드 */
    unsigned char    c_tag_id[24+1]; /* TAG ID */
    unsigned char    c_tag_crc[2+1]; /* TAG CRC */
    unsigned char    c_tag_sgnt[4+1]; /* TAG 서명값 */
    unsigned char    c_chrg_tr_mean[2+1]; /* 충전거래수단 */
    unsigned char    c_tr_date_tm[14+1]; /* 거래 일시 */
    unsigned int     d_tr_amt; /* 거래 금액 */
    unsigned char    c_chrg_yn[1+1]; /* 충전여부 */
    unsigned char    c_prev_tr_date_tm[14+1]; /* 직전거래일시 */
};

typedef struct tcso_rgstr_tag_chrg   T_TCSO_RGSTR_TAG_CHRG;
#define SZ_TCSO_RGSTR_TAG_CHRG    sizeof(T_TCSO_RGSTR_TAG_CHRG)

/***************************************************************************
   PUBO_OUT_WAY_WORK_END : 출구근무종료
***************************************************************************/
struct   pubo_out_way_work_end {
    unsigned char    c_plz_id[6+1];        /* 영업소ID */
    unsigned char    c_work_date[8+1];     /* 근무일자 */
    unsigned char    c_work_no[4+1];       /* 근무번호 */
    unsigned char    c_work_strt_tm[14+1]; /* 근무개시일시 */
    unsigned char    c_work_end_tm[14+1];  /* 근무종료일시 */
    unsigned int     n_prcs_cnt;           /* 처리건수 */
    unsigned int     n_forwd_cnt;          /* 전진대수 */
    unsigned int     n_backwd_cnt;         /* 후진대수 */
};

typedef struct pubo_out_way_work_end   T_PUBO_OUT_WAY_WORK_END;
#define SZ_PUBO_OUT_WAY_WORK_END    sizeof(T_PUBO_OUT_WAY_WORK_END)

/***************************************************************************
   PUBO_IN_WAY_WORK_END : 입구근무종료
***************************************************************************/
struct   pubo_in_way_work_end {
    unsigned char    c_plz_id[6+1];          /* 영업소ID */
    unsigned char    c_work_date[8+1];       /* 근무일자 */
    unsigned char    c_work_no[4+1];         /* 근무번호 */
    unsigned char    c_workr_no[6+1];        /* 근무자번호 */
    unsigned char    c_work_strt_tm[14+1];   /* 근무개시일시 */
    unsigned char    c_work_end_tm[14+1];    /* 근무종료일시 */
    unsigned int     n_prcs_cnt;             /* 처리건수 */
    unsigned int     n_forwd_cnt;            /* 전진대수 */
    unsigned int     n_backwd_cnt;           /* 후진대수 */
    unsigned int     n_vhcl_grnd_forwd_cnt;  /* 차판전진대수 */
    unsigned int     n_vhcl_grnd_backwd_cnt; /* 차판후진대수 */
};

typedef struct pubo_in_way_work_end   T_PUBO_IN_WAY_WORK_END;
#define SZ_PUBO_IN_WAY_WORK_END    sizeof(T_PUBO_IN_WAY_WORK_END)

/***************************************************************************
   TCSO_IN_WAY_SPCL : 특별처리명세_입구 Check
***************************************************************************/
struct   tcso_in_way_spcl {
    unsigned char    c_plz_id[6+1];             /* 영업소ID */
    unsigned char    c_work_date[8+1];          /* 근무일자 */
    unsigned char    c_work_no[4+1];            /* 근무번호 */
    unsigned char    c_workr_no[6+1];           /* 근무자번호 */
    unsigned int     d_prcs_seq;                /* 처리일련번호 */
    unsigned char    c_spcl_prcs_cd[2+1];       /* 특별처리코드대분류 */
    unsigned char    c_occrn_date_tm[14+1];     /* 발생일시 */
    unsigned char    c_tag_rgst_vhcl_clss[1+1]; /* TAG 등록차종 */
    unsigned char    c_dtrm_vhcl_clss[1+1];     /* 감지차종 */
    unsigned char    c_axle_cd[1+1];            /* 축수코드 */
    unsigned char    c_vhcl_no[12+1];           /* 차량번호 */
};

typedef struct tcso_in_way_spcl   T_TCSO_IN_WAY_SPCL;
#define SZ_TCSO_IN_WAY_SPCL    sizeof(T_TCSO_IN_WAY_SPCL)

/***************************************************************************
   TCSO_OFFICE : 사무실 발생 Check
***************************************************************************/
struct   tcso_office {
    unsigned char    c_plz_id[6+1]; /* 영업소ID */
    unsigned char    c_work_date[8+1]; /* 근무일자 */
    unsigned char    c_work_no[4+1]; /* 근무번호 */
    unsigned char    c_workr_no[6+1]; /* 근무자번호 */
    unsigned int     n_prcs_seq; /* 처리일련번호 */
    unsigned char    c_ofc_cd[2+1]; /* 사무실코드 */
    unsigned char    c_occrn_date_tm[14+1]; /* 발행일시 */
    unsigned char    c_sys_clss[2+1]; /* 시스템종별 */
    unsigned char    c_tag_rgst_vhcl_clss[1+1]; /* TAG 등록차종 */
    unsigned char    c_vhcl_clss[1+1]; /* 확정 차종 */
    unsigned char    c_bl_tag_id[16+1]; /* 무효 TAG ID */
    unsigned char    c_prcs_stat[1+1]; /* 처리상태 */
    unsigned char    c_prcs_vhcl_no[12+1]; /* 처리차량번호 */
};

typedef struct tcso_office   T_TCSO_OFFICE;
#define SZ_TCSO_OFFICE    sizeof(T_TCSO_OFFICE)

/***************************************************************************
   PUBO_IN_WAY_VIO : 입구위반데이터 Check
***************************************************************************/
struct   pubo_in_way_vio {
    unsigned char    c_plz_id[6+1]; /* 영업소ID */
    unsigned char    c_work_date[8+1]; /* 근무일자 */
    unsigned char    c_work_no[4+1]; /* 근무번호 */
    unsigned int     d_trnm_seq; /* 전송일련번호 */
    unsigned int     d_prcs_seq; /* 처리일련번호 */
    unsigned int     d_etcs_prcs_seq; /* ETCS 처리일련번호 */
    unsigned char    c_prcs_date_tm[14+1]; /* 처리일시 Check*/
    unsigned char    c_vio_cd[2+1]; /* 위반코드 */
    unsigned char    c_rcpt_prcs_type[2+1]; /* 수납처리구분 Check*/
    unsigned char    c_rcpt_prcs_type_dtl_cd[2+1]; /* 수납처리구분세부코드 Check*/
    unsigned char    c_pymt_prcs_type[2+1]; /* 지불처리구분 */
    unsigned char    c_tag_id[24+1]; /* TAG ID */
    unsigned char    c_tag_vhcl_clss[1+1]; /* TAG 차종 Check*/
    unsigned char    c_tag_vhcl_no[8+1]; /* TAG 차량번호 Check*/
    unsigned char    c_iss_comp_cd[2+1]; /* 발행사코드 */
    unsigned char    c_tag_clss[2+1]; /* TAG 속성 Check*/
    unsigned char    c_vald_term[10+1]; /* 유효기간 Check*/
    unsigned char    c_work_type[1+1]; /* 근무구분 */
    unsigned char    c_car_knd[1+1]; /* 차량종류 Check*/
    unsigned char    c_sens_vhcl_clss[1+1]; /* 감지차종 */
    unsigned char    c_prcs_vhcl_clss[1+1]; /* 처리차종 */
    unsigned char    c_prcs_vhcl_no[30+1]; /* 처리차량번호 */
    unsigned char    c_rcpt_type[1+1]; /* 수납구분 */
    unsigned char    c_online_yn[8+1]; /* 온라인조회일치여부 */
    unsigned int     d_sens_seq; /* 감지일련번호 */
    unsigned char    c_many_tag_yn[1+1]; /* MANY TAG 여부 Check*/
    unsigned char    c_vhcl_clss_modf_yn[1+1]; /* 차종수정여부 */
    unsigned char    c_vhcl_no_modf_yn[1+1]; /* 차량번호수정여부 */
    unsigned char    c_toll_modf_yn[1+1]; /* 통행요금수정여부 */
    unsigned char    c_polc_lnk_yn[1+1]; /* 경찰연계구분 */
    unsigned char    c_dpaymt_contrct_yn[1+1]; /* 후불약정여부 */
    unsigned char    c_audt_type[1+1]; /* 심사처리구분 */
};

typedef struct pubo_in_way_vio   T_PUBO_IN_WAY_VIO;
#define SZ_PUBO_IN_WAY_VIO    sizeof(T_PUBO_IN_WAY_VIO)

/***************************************************************************
   PUBO_OUT_WAY_VIO : 출구위반데이터 Check
***************************************************************************/
struct   pubo_out_way_vio {
    unsigned char    c_plz_id[6+1]; /* 영업소ID */
    unsigned char    c_work_date[8+1]; /* 근무일자 */
    unsigned char    c_work_no[4+1]; /* 근무번호 */
    unsigned int     d_trnm_seq; /* 전송일련번호 */
    unsigned int     d_prcs_seq; /* 처리일련번호 */
    unsigned int     d_etcs_prcs_seq; /* ETCS 처리일련번호 */
    unsigned char    c_workr_no[6+1]; /* 근무자번호 */
    unsigned char    c_in_way_plz_id[6+1]; /* 입구영업소ID */
    unsigned char    c_prcs_date_tm[14+1]; /* 처리일시 Check*/
    unsigned char    c_vio_cd[2+1]; /* 위반코드 */
    unsigned int     d_in_way_org_toll; /* 입구_원통행요금 */
    unsigned int     d_out_way_org_toll; /* 출구_원 통행요금 */
    unsigned int     d_in_way_toll; /* 입구_통행요금 */
    unsigned int     d_out_way_toll; /* 출구_통행요금 */
    unsigned int     n_in_way_comp_cd; /* 입구회사코드 */
    unsigned int     n_out_way_comp_cd; /* 출구회사코드 */
    unsigned int     n_in_way_pymt_dc_rate; /* 입구_지불할인율 */
    unsigned int     n_out_way_pymt_dc_rate; /* 출구_지불할인율 */
    unsigned int     d_in_way_rcpt_toll; /* 입구_수납금액 */
    unsigned int     d_out_way_rcpt_toll; /* 출구수납금액 */
    unsigned int     d_rcpt_prev_balc; /* 수납전잔액 */
    unsigned char    c_rcpt_prcs_type[2+1]; /* 수납처리구분 Check*/
    unsigned char    c_rcpt_prcs_type_dtl_cd[2+1]; /* 수납처리구분세부코드 Check*/
    unsigned char    c_prcs_vhcl_clss[1+1]; /* 처리차종 */
    unsigned char    c_tag_id[24+1]; /* TAG ID */
    unsigned char    c_tag_vhcl_clss[1+1]; /* TAG 차종 */
    unsigned char    c_tag_vhcl_no[8+1]; /* TAG 차량번호 Check*/
    unsigned char    c_iss_comp_cd[2+1]; /* 발행사코드 */
    unsigned char    c_tag_clss[2+1]; /* TAG 속성 Check*/
    unsigned char    c_vald_term[10+1]; /* 유효기간 */
    unsigned char    c_tag_crc[2+1]; /* TAG CRC Check*/
    unsigned char    c_tag_sgnt[4+1]; /* TAG 서명값 */
    unsigned char    c_work_type[1+1]; /* 근무구분 */
    unsigned char    c_sens_vhcl_clss[1+1]; /* 감지차종 */
    unsigned char    c_prcs_vhcl_no[30+1]; /* 처리차량번호 Check*/
    unsigned char    c_repr_rcpt_type[1+1]; /* 대표수납구분 */
    unsigned char    c_in_way_rcpt_type[1+1]; /* 입구수납구분 */
    unsigned char    c_out_way_rcpt_type[1+1]; /* 출구수납구분 */
    unsigned char    c_online_yn[8+1]; /* 온라인조회일치여부 Check*/
    unsigned int     d_sens_seq; /* 감지일련번호 */
    unsigned char    c_many_tag_yn[1+1]; /* MANY TAG 여부 Check*/
    unsigned char    c_car_modf_yn[1+1]; /* 차종수정여부 */
    unsigned char    c_car_no_modf_yn[1+1]; /* 차량번호수정여부 */
    unsigned char    c_fare_modf_yn[1+1]; /* 통행요금수정여부 */
    unsigned char    c_polc_lnk_yn[1+1]; /* 경찰연계구분 */
    unsigned char    c_dpaymt_contrct_yn[1+1]; /* 후불약정여부 */
    unsigned char    c_audt_type[1+1]; /* 심사처리구분 */
};

typedef struct pubo_out_way_vio   T_PUBO_OUT_WAY_VIO;
#define SZ_PUBO_OUT_WAY_VIO    sizeof(T_PUBO_OUT_WAY_VIO)

/***************************************************************************
   ETCO_OUT_WAY_VIO_RCPT : ETCS 출구위반 입구수납 Check
***************************************************************************/
struct   etco_out_way_vio_rcpt {
    unsigned char    c_plz_id[6+1]; /* 영업소ID */
    unsigned char    c_work_date[8+1]; /* 근무일자 */
    unsigned char    c_work_no[4+1]; /* 근무번호 */
    unsigned char    c_workr_no[6+1]; /* 근무자번호 */
    unsigned int     d_prcs_seq; /* 처리일련번호 */
    unsigned char    c_prcs_type[1+1]; /* 처리구분 */
    unsigned char    c_occrn_date_tm[14+1]; /* 발생일시 */
    unsigned int     d_rcpt_toll; /* 수납금액 */
    unsigned char    c_vhcl_no[30+1]; /* 차량번호 */
};

typedef struct etco_out_way_vio_rcpt   T_ETCO_OUT_WAY_VIO_RCPT;
#define SZ_ETCO_OUT_WAY_VIO_RCPT    sizeof(T_ETCO_OUT_WAY_VIO_RCPT)

/***************************************************************************
   LNKH_WEB_UNPAID_RCPT : 홈페이지 미납수납처리
***************************************************************************/
struct   lnkh_web_unpaid_rcpt {
    char plz_id[6+1];             /* 영업소ID    */
    char work_date[8+1];          /* 근무일자    */
    char work_no[4+1];            /* 근무번호    */
    int  prcs_seq;                /* 처리일련번호*/
    char tag_id[24+1];            /* TAG ID      */
    char iss_comp_cd[2+1];        /* 발행사코드  */
    int  rcpt_toll;               /* 수납통행료  */
    int  vat_toll;                /* 부가통행료  */
    char pymt_prcs_date_tm[14+1]; /* 수납처리일시*/
    char tag_crc[2+1];            /* TAG CRC     */
    char last_prcs_date_tm[14+1]; /* 최종처리일시*/
    char prcs_type[2+1];          /* 처리구분    */
    char tag_sgnt[4+1];           /* TAG 서명값  */
};

typedef struct lnkh_web_unpaid_rcpt   T_LNKH_WEB_UNPAID_RCPT;
#define SZ_LNKH_WEB_UNPAID_RCPT    sizeof(T_LNKH_WEB_UNPAID_RCPT)

/***************************************************************************
   OPRM_ISNC_INFO : 발급정보 마스터
***************************************************************************/
struct   oprm_isnc_info {
    char    c_iss_comp_cd[2+1]; /* 발행사코드 */
    char    c_tag_id[24+1]; /* TAG ID */
    char    c_tag_atrb[1+1]; /* TAG 속성 */
    char    c_tag_atrb_dtl_cd[2+1]; /* TAG 속성세부코드 */
    char    c_tag_vhcl_clss[1+1]; /* TAG 차종 */
    char    c_tag_vhcl_no[12+1]; /* TAG 차량번호 */
    char    c_cstm_vhcl_no[30+1]; /* 고객차량번호 */
    char    c_isnc_vhcl_no[8+1]; /* 발급차량번호(영문+숫자) */
    char    c_no_vhcl_no[8+1]; /* 차량번호(숫자) */
    char    c_tag_crc[2+1]; /* TAG CRC */
    char    c_bl_yn[1+1]; /* 무효여부 */
    char    c_bl_rgst_date_tm[14+1]; /* 무효등록일시 */
    char    c_isnc_date_tm[14+1]; /* 발급일시 */
    char    c_vald_term[14+1]; /* 유효기간 */
    char    c_last_prcs_date_tm[14+1]; /* 최종처리일시 */
};
typedef struct oprm_isnc_info   T_OPRM_ISNC_INFO;
#define SZ_OPRM_ISNC_INFO    sizeof(T_OPRM_ISNC_INFO)





#include "wrk_end_def.h"

/*------------------------------------------------------------------------------------------------
 * Global Variable.(전역 변수 정의 )
 *-----------------------------------------------------------------------------------------------*/

struct db_iss_info{
    int     tag_balc;
    char    tag_id[24+1];
    char    tag_iss[2+1];
    char    tag_vhcl_clss[1+1];
    char    tag_atrb[1+1];
    char    tag_dtl_code[2+1];
    char    tag_vhcl_no[12+1];
    char    tag_vald_term[10+1];
    char    tag_crc[2+1];
    char    in_plz_id[6+1];
    char    in_wrk_date[8+1];
    char    in_wrk_no[4+1];
    int     in_proc_no;
    char    in_sens_knd[1+1];
    char    in_proc_knd[1+1];
    char    datetime[14+1];
    char    chrg_div[1+1];
};


/* EXEC SQL INCLUDE SQLCA; */

struct hi_comm_ctrl hi_comm_ctrl;

/*
 *========================================================================
 *
 *   함 수 명 : proc_rpr_data()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 전송연번 Data를 처리.
 *========================================================================
*/

int proc_rq_snd_no(char *target, char *rep)
{
    struct rcv_lane_data   *rd;
    struct rq_seq_no_tbl   *pk_snd;

    struct opro_lane_stat  opro_lane_stat;
    char plz_id[6+1];
    char lane_no[2+1];
    char wrk_date[8+1];
    char day_chng[4+1];
    char day_end[4+1];
    int  snd_no, wrk_snd;


    memset((char *)&opro_lane_stat, 0, sizeof(opro_lane_stat));
    memset(plz_id, 0x00, sizeof(plz_id));
    memset(lane_no, 0x00, sizeof(lane_no));

    rd = (struct rcv_lane_data *)target;
    pk_snd = (struct rq_seq_no_tbl *)rep;
    memset(pk_snd, 0x00, sizeof(struct rq_seq_no_tbl));

    snprintf(plz_id, 6+1, "%6s", rd->plz_id);
    snprintf(lane_no, 2+1, "%2s", rd->lane_no);
    snprintf(wrk_date, 8+1, "%8s", rd->wrk_datetm);

printf("PLZ_ID[%.6s] LANE_NO[%.2s] WRK_DATE[%.8s]\n", plz_id, lane_no, wrk_date);
    /*  SELECT 
        NVL(MAX(LAST_RECV_TRNM_SEQ), 0), NVL(MAX(SUBSTR(WORK_NO,3,2)), 0)+1 
                           
    FROM OPRO_LANE_STAT 
    WHERE PLZ_ID = :plz_id 
    AND   LANE_NO = :lane_no 
    AND   WORK_DATE = :wrk_date; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[5];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 5;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT "
"        NVL(MAX(LAST_RECV_TRNM_SEQ), 0), NVL(MAX(SUBSTR(WORK_NO,3,2)), 0)+1 "
"                           "
"    FROM OPRO_LANE_STAT "
"    WHERE PLZ_ID = ?  "
"    AND   LANE_NO = ?  "
"    AND   WORK_DATE = ? ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)&(snd_no);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 2;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[0].mLen = 0;
    ulpSqlstmt.hostvalue[0].mMaxlen = 0;
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)&(wrk_snd);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 2;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[1].mLen = 0;
    ulpSqlstmt.hostvalue[1].mMaxlen = 0;
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(plz_id);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].isstruct = 0;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 6+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(plz_id);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(lane_no);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].isstruct = 0;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 2+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(lane_no);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)(wrk_date);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 6;
    ulpSqlstmt.hostvalue[4].isstruct = 0;
    ulpSqlstmt.hostvalue[4].mSizeof = 0;
    ulpSqlstmt.hostvalue[4].mLen = 8+1;
    ulpSqlstmt.hostvalue[4].mMaxlen = sizeof(wrk_date);
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("SQLCODE = %d OPRO_LANE_STAT 전송연번 wrk_date[%.8s] lane_no[%.2s]\n",
                SQLCODE, rd->wrk_datetm, rd->lane_no);
        return(-1);
    }

    /*  SELECT 
       LPAD(NVL(DAY_CHNG_TME, 0), 4, 0), 
       LPAD(NVL(DAYEND_DATE_TM, 0), 4, 0) 
                             
    FROM OPRM_BASIC_INFO 
    WHERE PLZ_ID = :plz_id; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[3];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 3;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT "
"       LPAD(NVL(DAY_CHNG_TME, 0), 4, 0), "
"       LPAD(NVL(DAYEND_DATE_TM, 0), 4, 0) "
"                             "
"    FROM OPRM_BASIC_INFO "
"    WHERE PLZ_ID = ? ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(day_chng);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 4+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(day_chng);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(day_end);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 4+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(day_end);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(plz_id);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].isstruct = 0;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 6+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(plz_id);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("SQLCODE = %d OPRM_BASIC_INFO 전송연번 wrk_date[%8s] lane_no[%.2s]\n",
                SQLCODE, wrk_date, lane_no);
        return(-1);
    }

    snprintf((char *)rd->wrk_no, 4+1, "%2s%02d", lane_no, wrk_snd);

    snprintf((char *)pk_snd->kind, 2+1, "%02x", AZN_SEQ_NO_DATA);
    if(snd_no == 0)
        snd_no = 1;
    snprintf((char *)pk_snd->rq_seq_no, 8+1, "%08d", snd_no);
    snprintf((char *)pk_snd->wrk_no,    4+1, "%4s" , rd->wrk_no);
    snprintf((char *)pk_snd->wrk_date,  8+1, "%8s" , wrk_date);
    snprintf((char *)pk_snd->lane_no,   2+1, "%2s" , lane_no);

    snprintf((char *)pk_snd->day_chng_hour, 2+1, "%2s", &day_chng[0]);
    snprintf((char *)pk_snd->day_chng_min,  2+1, "%2s", &day_chng[2]);
    snprintf((char *)pk_snd->day_end_hour,  2+1, "%2s", &day_end[0]);
    snprintf((char *)pk_snd->day_end_min,   2+1, "%2s", &day_end[2]);

    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_lane_stat_info()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 차로상태 Data를 처리.
 *========================================================================
*/

int proc_lane_stat_info(char *target)
{
    int iCrjb;
    struct rcv_lane_data   *rd;
    struct hi_lane_stat    *pk_in;
    char tmp[10];

    struct    opro_lane_stat  opro_lane_stat;


    rd = (struct rcv_lane_data *)target;
    /* 현차로상태 Check     */
    iCrjb = chk_lane_stat(rd);

    printf("proc_lane_stat_info Proc[%d][%.6s][%.2s]\n", iCrjb, rd->plz_id, rd->lane_no);
    memset(&opro_lane_stat, 0x00, sizeof(opro_lane_stat));

    e_memcpy(opro_lane_stat.c_plz_id, rd->plz_id);
    e_memcpy(opro_lane_stat.c_lane_no, rd->lane_no);
printf("차로상태[%d]\n", iCrjb);
    switch(iCrjb)
    {
        case 0:
        case 3:
            printf("proc_lane_stat_info DB Proc Start[%d]\n", iCrjb);
            pk_in = (struct hi_lane_stat *)rd->buf;

            sprintf((char *)opro_lane_stat.c_lane_clss, "%c%c", pk_in->opr_div[1], '\0');
            sprintf((char *)opro_lane_stat.c_insr_stat, "%.16s%c", pk_in->mchi_stat, '\0');

            sprintf((char *)opro_lane_stat.c_basc_stat, "%c%c", pk_in->tbl_stat[0].stat, '\0');
            opro_lane_stat.n_basc_rvs_no = lb_data2atoi((char *)pk_in->tbl_stat[0].rvs_no, 2);

            sprintf((char *)opro_lane_stat.c_workr_crd_stat, "%c%c", pk_in->tbl_stat[1].stat, '\0');
            opro_lane_stat.n_workr_crd_rvs_no = lb_data2atoi((char *)pk_in->tbl_stat[1].rvs_no, 2);

            sprintf((char *)opro_lane_stat.c_fare_stat, "%c%c", pk_in->tbl_stat[2].stat, '\0');
            opro_lane_stat.n_fare_rvs_no = lb_data2atoi((char *)pk_in->tbl_stat[2].rvs_no, 2);

            sprintf((char *)opro_lane_stat.c_rgstr_tag_bl_stat, "%c%c", pk_in->tbl_stat[3].stat, '\0');
            opro_lane_stat.n_rgstr_tag_bl_rvs_no = lb_data2atoi((char *)pk_in->tbl_stat[3].rvs_no, 2);

            sprintf((char *)opro_lane_stat.c_iss_comp_cd_stat, "%c%c", pk_in->tbl_stat[4].stat, '\0');
            opro_lane_stat.n_iss_comp_cd_rvs_no = lb_data2atoi((char *)pk_in->tbl_stat[4].rvs_no, 2);

            sprintf((char *)opro_lane_stat.c_perd_tag_pl_stat, "%c%c", pk_in->tbl_stat[5].stat, '\0');
            opro_lane_stat.n_perd_tag_pl_rvs_no = lb_data2atoi((char *)pk_in->tbl_stat[5].rvs_no, 2);

            sprintf((char *)opro_lane_stat.c_control_type,  "%.2s%c", pk_in->lane_ctrler_div, '\0');
            sprintf((char *)opro_lane_stat.c_fw_ver, "%.4s%c", pk_in->fw_ver, '\0');
            memset(tmp, 0x00, sizeof(tmp)); sprintf(tmp, "%.8s%c", pk_in->rgstr_bl_seq_no, '\0');
            opro_lane_stat.d_rgstr_tag_bl_last_seq = strtoul(tmp, NULL, 16);
            memset(tmp, 0x00, sizeof(tmp)); sprintf(tmp, "%.8s%c", pk_in->perd_pl_seq_no, '\0');
            opro_lane_stat.d_perd_tag_pl_last_seq =  strtoul(tmp, NULL, 16);

            sprintf((char *)opro_lane_stat.c_last_gthr_date_tm, "%.14s%c", rd->wrk_datetm, '\0');
            sprintf((char *)opro_lane_stat.c_work_date, "%.8s%c", rd->wrk_datetm, '\0');

            sprintf((char *)opro_lane_stat.c_comm_stat, "%c%c", rd->con_stat, '\0');
            sprintf((char *)opro_lane_stat.c_work_no, "%.4s%c", rd->wrk_no, '\0');

            if(memcmp(opro_lane_stat.c_work_no, "    ", 4) == 0)
                sprintf((char *)opro_lane_stat.c_work_no, "%.2s00%c", rd->lane_no, '\0');

            printf("Null End\n");
            opro_lane_stat.n_last_recv_trnm_seq = lb_data2atoi((char *)rd->rcv_snd_no, 8);
            break;
         case 1:
            printf("proc_lane_stat_info DB Connect Error");
            return(-1);
            break;
         case 2:
         case 4:
            printf("proc_lane_stat_info SKIP Proc");
            return(0);
            break;
         default :
            break;
    }

    if(iCrjb == 0)
    {
        /*  INSERT INTO OPRO_LANE_STAT VALUES (:opro_lane_stat); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[31];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 31;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO OPRO_LANE_STAT VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(opro_lane_stat.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(opro_lane_stat.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(opro_lane_stat.c_lane_no);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 2+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(opro_lane_stat.c_lane_no);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(opro_lane_stat.c_lane_clss);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 1+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(opro_lane_stat.c_lane_clss);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(opro_lane_stat.c_insr_stat);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 8+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(opro_lane_stat.c_insr_stat);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)(opro_lane_stat.c_basc_stat);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isstruct = 1;
    ulpSqlstmt.hostvalue[4].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 6;
    ulpSqlstmt.hostvalue[4].mSizeof = 0;
    ulpSqlstmt.hostvalue[4].mLen = 1+1;
    ulpSqlstmt.hostvalue[4].mMaxlen = sizeof(opro_lane_stat.c_basc_stat);
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)&(opro_lane_stat.n_basc_rvs_no);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isstruct = 1;
    ulpSqlstmt.hostvalue[5].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 2;
    ulpSqlstmt.hostvalue[5].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[5].mLen = 0;
    ulpSqlstmt.hostvalue[5].mMaxlen = 0;
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(opro_lane_stat.c_workr_crd_stat);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isstruct = 1;
    ulpSqlstmt.hostvalue[6].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 1+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(opro_lane_stat.c_workr_crd_stat);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)&(opro_lane_stat.n_workr_crd_rvs_no);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isstruct = 1;
    ulpSqlstmt.hostvalue[7].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 2;
    ulpSqlstmt.hostvalue[7].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[7].mLen = 0;
    ulpSqlstmt.hostvalue[7].mMaxlen = 0;
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)(opro_lane_stat.c_fare_stat);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isstruct = 1;
    ulpSqlstmt.hostvalue[8].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 6;
    ulpSqlstmt.hostvalue[8].mSizeof = 0;
    ulpSqlstmt.hostvalue[8].mLen = 1+1;
    ulpSqlstmt.hostvalue[8].mMaxlen = sizeof(opro_lane_stat.c_fare_stat);
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[9].mHostVar = (void*)&(opro_lane_stat.n_fare_rvs_no);
    ulpSqlstmt.hostvalue[9].mHostInd = NULL;
    ulpSqlstmt.hostvalue[9].isstruct = 1;
    ulpSqlstmt.hostvalue[9].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[9].isarr = 0;
    ulpSqlstmt.hostvalue[9].mType = 2;
    ulpSqlstmt.hostvalue[9].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[9].mLen = 0;
    ulpSqlstmt.hostvalue[9].mMaxlen = 0;
    ulpSqlstmt.hostvalue[9].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[9].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[9].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[10].mHostVar = (void*)(opro_lane_stat.c_rgstr_tag_bl_stat);
    ulpSqlstmt.hostvalue[10].mHostInd = NULL;
    ulpSqlstmt.hostvalue[10].isstruct = 1;
    ulpSqlstmt.hostvalue[10].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[10].isarr = 0;
    ulpSqlstmt.hostvalue[10].mType = 6;
    ulpSqlstmt.hostvalue[10].mSizeof = 0;
    ulpSqlstmt.hostvalue[10].mLen = 1+1;
    ulpSqlstmt.hostvalue[10].mMaxlen = sizeof(opro_lane_stat.c_rgstr_tag_bl_stat);
    ulpSqlstmt.hostvalue[10].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[10].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[10].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[11].mHostVar = (void*)&(opro_lane_stat.n_rgstr_tag_bl_rvs_no);
    ulpSqlstmt.hostvalue[11].mHostInd = NULL;
    ulpSqlstmt.hostvalue[11].isstruct = 1;
    ulpSqlstmt.hostvalue[11].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[11].isarr = 0;
    ulpSqlstmt.hostvalue[11].mType = 2;
    ulpSqlstmt.hostvalue[11].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[11].mLen = 0;
    ulpSqlstmt.hostvalue[11].mMaxlen = 0;
    ulpSqlstmt.hostvalue[11].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[11].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[11].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[12].mHostVar = (void*)(opro_lane_stat.c_iss_comp_cd_stat);
    ulpSqlstmt.hostvalue[12].mHostInd = NULL;
    ulpSqlstmt.hostvalue[12].isstruct = 1;
    ulpSqlstmt.hostvalue[12].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[12].isarr = 0;
    ulpSqlstmt.hostvalue[12].mType = 6;
    ulpSqlstmt.hostvalue[12].mSizeof = 0;
    ulpSqlstmt.hostvalue[12].mLen = 1+1;
    ulpSqlstmt.hostvalue[12].mMaxlen = sizeof(opro_lane_stat.c_iss_comp_cd_stat);
    ulpSqlstmt.hostvalue[12].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[12].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[12].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[13].mHostVar = (void*)&(opro_lane_stat.n_iss_comp_cd_rvs_no);
    ulpSqlstmt.hostvalue[13].mHostInd = NULL;
    ulpSqlstmt.hostvalue[13].isstruct = 1;
    ulpSqlstmt.hostvalue[13].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[13].isarr = 0;
    ulpSqlstmt.hostvalue[13].mType = 2;
    ulpSqlstmt.hostvalue[13].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[13].mLen = 0;
    ulpSqlstmt.hostvalue[13].mMaxlen = 0;
    ulpSqlstmt.hostvalue[13].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[13].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[13].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[14].mHostVar = (void*)(opro_lane_stat.c_perd_tag_pl_stat);
    ulpSqlstmt.hostvalue[14].mHostInd = NULL;
    ulpSqlstmt.hostvalue[14].isstruct = 1;
    ulpSqlstmt.hostvalue[14].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[14].isarr = 0;
    ulpSqlstmt.hostvalue[14].mType = 6;
    ulpSqlstmt.hostvalue[14].mSizeof = 0;
    ulpSqlstmt.hostvalue[14].mLen = 1+1;
    ulpSqlstmt.hostvalue[14].mMaxlen = sizeof(opro_lane_stat.c_perd_tag_pl_stat);
    ulpSqlstmt.hostvalue[14].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[14].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[14].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[15].mHostVar = (void*)&(opro_lane_stat.n_perd_tag_pl_rvs_no);
    ulpSqlstmt.hostvalue[15].mHostInd = NULL;
    ulpSqlstmt.hostvalue[15].isstruct = 1;
    ulpSqlstmt.hostvalue[15].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[15].isarr = 0;
    ulpSqlstmt.hostvalue[15].mType = 2;
    ulpSqlstmt.hostvalue[15].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[15].mLen = 0;
    ulpSqlstmt.hostvalue[15].mMaxlen = 0;
    ulpSqlstmt.hostvalue[15].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[15].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[15].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[16].mHostVar = (void*)(opro_lane_stat.c_control_type);
    ulpSqlstmt.hostvalue[16].mHostInd = NULL;
    ulpSqlstmt.hostvalue[16].isstruct = 1;
    ulpSqlstmt.hostvalue[16].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[16].isarr = 0;
    ulpSqlstmt.hostvalue[16].mType = 6;
    ulpSqlstmt.hostvalue[16].mSizeof = 0;
    ulpSqlstmt.hostvalue[16].mLen = 2+1;
    ulpSqlstmt.hostvalue[16].mMaxlen = sizeof(opro_lane_stat.c_control_type);
    ulpSqlstmt.hostvalue[16].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[16].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[16].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[17].mHostVar = (void*)(opro_lane_stat.c_comm_stat);
    ulpSqlstmt.hostvalue[17].mHostInd = NULL;
    ulpSqlstmt.hostvalue[17].isstruct = 1;
    ulpSqlstmt.hostvalue[17].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[17].isarr = 0;
    ulpSqlstmt.hostvalue[17].mType = 6;
    ulpSqlstmt.hostvalue[17].mSizeof = 0;
    ulpSqlstmt.hostvalue[17].mLen = 1+1;
    ulpSqlstmt.hostvalue[17].mMaxlen = sizeof(opro_lane_stat.c_comm_stat);
    ulpSqlstmt.hostvalue[17].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[17].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[17].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[18].mHostVar = (void*)(opro_lane_stat.c_fw_ver);
    ulpSqlstmt.hostvalue[18].mHostInd = NULL;
    ulpSqlstmt.hostvalue[18].isstruct = 1;
    ulpSqlstmt.hostvalue[18].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[18].isarr = 0;
    ulpSqlstmt.hostvalue[18].mType = 6;
    ulpSqlstmt.hostvalue[18].mSizeof = 0;
    ulpSqlstmt.hostvalue[18].mLen = 4+1;
    ulpSqlstmt.hostvalue[18].mMaxlen = sizeof(opro_lane_stat.c_fw_ver);
    ulpSqlstmt.hostvalue[18].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[18].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[18].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[19].mHostVar = (void*)&(opro_lane_stat.d_rgstr_tag_bl_last_seq);
    ulpSqlstmt.hostvalue[19].mHostInd = NULL;
    ulpSqlstmt.hostvalue[19].isstruct = 1;
    ulpSqlstmt.hostvalue[19].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[19].isarr = 0;
    ulpSqlstmt.hostvalue[19].mType = 2;
    ulpSqlstmt.hostvalue[19].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[19].mLen = 0;
    ulpSqlstmt.hostvalue[19].mMaxlen = 0;
    ulpSqlstmt.hostvalue[19].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[19].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[19].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[20].mHostVar = (void*)&(opro_lane_stat.d_perd_tag_pl_last_seq);
    ulpSqlstmt.hostvalue[20].mHostInd = NULL;
    ulpSqlstmt.hostvalue[20].isstruct = 1;
    ulpSqlstmt.hostvalue[20].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[20].isarr = 0;
    ulpSqlstmt.hostvalue[20].mType = 2;
    ulpSqlstmt.hostvalue[20].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[20].mLen = 0;
    ulpSqlstmt.hostvalue[20].mMaxlen = 0;
    ulpSqlstmt.hostvalue[20].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[20].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[20].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[21].mHostVar = (void*)(opro_lane_stat.c_last_gthr_date_tm);
    ulpSqlstmt.hostvalue[21].mHostInd = NULL;
    ulpSqlstmt.hostvalue[21].isstruct = 1;
    ulpSqlstmt.hostvalue[21].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[21].isarr = 0;
    ulpSqlstmt.hostvalue[21].mType = 6;
    ulpSqlstmt.hostvalue[21].mSizeof = 0;
    ulpSqlstmt.hostvalue[21].mLen = 14+1;
    ulpSqlstmt.hostvalue[21].mMaxlen = sizeof(opro_lane_stat.c_last_gthr_date_tm);
    ulpSqlstmt.hostvalue[21].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[21].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[21].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[22].mHostVar = (void*)(opro_lane_stat.c_work_date);
    ulpSqlstmt.hostvalue[22].mHostInd = NULL;
    ulpSqlstmt.hostvalue[22].isstruct = 1;
    ulpSqlstmt.hostvalue[22].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[22].isarr = 0;
    ulpSqlstmt.hostvalue[22].mType = 6;
    ulpSqlstmt.hostvalue[22].mSizeof = 0;
    ulpSqlstmt.hostvalue[22].mLen = 8+1;
    ulpSqlstmt.hostvalue[22].mMaxlen = sizeof(opro_lane_stat.c_work_date);
    ulpSqlstmt.hostvalue[22].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[22].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[22].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[23].mHostVar = (void*)(opro_lane_stat.c_work_no);
    ulpSqlstmt.hostvalue[23].mHostInd = NULL;
    ulpSqlstmt.hostvalue[23].isstruct = 1;
    ulpSqlstmt.hostvalue[23].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[23].isarr = 0;
    ulpSqlstmt.hostvalue[23].mType = 6;
    ulpSqlstmt.hostvalue[23].mSizeof = 0;
    ulpSqlstmt.hostvalue[23].mLen = 4+1;
    ulpSqlstmt.hostvalue[23].mMaxlen = sizeof(opro_lane_stat.c_work_no);
    ulpSqlstmt.hostvalue[23].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[23].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[23].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[24].mHostVar = (void*)&(opro_lane_stat.n_last_recv_trnm_seq);
    ulpSqlstmt.hostvalue[24].mHostInd = NULL;
    ulpSqlstmt.hostvalue[24].isstruct = 1;
    ulpSqlstmt.hostvalue[24].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[24].isarr = 0;
    ulpSqlstmt.hostvalue[24].mType = 2;
    ulpSqlstmt.hostvalue[24].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[24].mLen = 0;
    ulpSqlstmt.hostvalue[24].mMaxlen = 0;
    ulpSqlstmt.hostvalue[24].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[24].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[24].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[25].mHostVar = (void*)&(opro_lane_stat.n_grt_trnm_seq);
    ulpSqlstmt.hostvalue[25].mHostInd = NULL;
    ulpSqlstmt.hostvalue[25].isstruct = 1;
    ulpSqlstmt.hostvalue[25].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[25].isarr = 0;
    ulpSqlstmt.hostvalue[25].mType = 2;
    ulpSqlstmt.hostvalue[25].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[25].mLen = 0;
    ulpSqlstmt.hostvalue[25].mMaxlen = 0;
    ulpSqlstmt.hostvalue[25].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[25].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[25].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[26].mHostVar = (void*)(opro_lane_stat.c_dayend_recv_date_tm);
    ulpSqlstmt.hostvalue[26].mHostInd = NULL;
    ulpSqlstmt.hostvalue[26].isstruct = 1;
    ulpSqlstmt.hostvalue[26].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[26].isarr = 0;
    ulpSqlstmt.hostvalue[26].mType = 6;
    ulpSqlstmt.hostvalue[26].mSizeof = 0;
    ulpSqlstmt.hostvalue[26].mLen = 14+1;
    ulpSqlstmt.hostvalue[26].mMaxlen = sizeof(opro_lane_stat.c_dayend_recv_date_tm);
    ulpSqlstmt.hostvalue[26].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[26].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[26].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[27].mHostVar = (void*)(opro_lane_stat.c_work_strt_date_tm);
    ulpSqlstmt.hostvalue[27].mHostInd = NULL;
    ulpSqlstmt.hostvalue[27].isstruct = 1;
    ulpSqlstmt.hostvalue[27].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[27].isarr = 0;
    ulpSqlstmt.hostvalue[27].mType = 6;
    ulpSqlstmt.hostvalue[27].mSizeof = 0;
    ulpSqlstmt.hostvalue[27].mLen = 14+1;
    ulpSqlstmt.hostvalue[27].mMaxlen = sizeof(opro_lane_stat.c_work_strt_date_tm);
    ulpSqlstmt.hostvalue[27].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[27].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[27].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[28].mHostVar = (void*)(opro_lane_stat.c_work_end_date_tm);
    ulpSqlstmt.hostvalue[28].mHostInd = NULL;
    ulpSqlstmt.hostvalue[28].isstruct = 1;
    ulpSqlstmt.hostvalue[28].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[28].isarr = 0;
    ulpSqlstmt.hostvalue[28].mType = 6;
    ulpSqlstmt.hostvalue[28].mSizeof = 0;
    ulpSqlstmt.hostvalue[28].mLen = 14+1;
    ulpSqlstmt.hostvalue[28].mMaxlen = sizeof(opro_lane_stat.c_work_end_date_tm);
    ulpSqlstmt.hostvalue[28].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[28].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[28].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[29].mHostVar = (void*)(opro_lane_stat.c_strt_trnm_seq);
    ulpSqlstmt.hostvalue[29].mHostInd = NULL;
    ulpSqlstmt.hostvalue[29].isstruct = 1;
    ulpSqlstmt.hostvalue[29].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[29].isarr = 0;
    ulpSqlstmt.hostvalue[29].mType = 6;
    ulpSqlstmt.hostvalue[29].mSizeof = 0;
    ulpSqlstmt.hostvalue[29].mLen = 8+1;
    ulpSqlstmt.hostvalue[29].mMaxlen = sizeof(opro_lane_stat.c_strt_trnm_seq);
    ulpSqlstmt.hostvalue[29].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[29].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[29].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[30].mHostVar = (void*)(opro_lane_stat.c_end_trnm_seq);
    ulpSqlstmt.hostvalue[30].mHostInd = NULL;
    ulpSqlstmt.hostvalue[30].isstruct = 1;
    ulpSqlstmt.hostvalue[30].structsize = sizeof(opro_lane_stat);
    ulpSqlstmt.hostvalue[30].isarr = 0;
    ulpSqlstmt.hostvalue[30].mType = 6;
    ulpSqlstmt.hostvalue[30].mSizeof = 0;
    ulpSqlstmt.hostvalue[30].mLen = 4+1;
    ulpSqlstmt.hostvalue[30].mMaxlen = sizeof(opro_lane_stat.c_end_trnm_seq);
    ulpSqlstmt.hostvalue[30].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[30].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[30].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}

    }else if(iCrjb == 3)
    {
        /*  
        UPDATE OPRO_LANE_STAT 
           SET LANE_CLSS             = NVL(:opro_lane_stat.c_lane_clss            , '') 
             , INSR_STAT             = NVL(:opro_lane_stat.c_insr_stat            , '') 
             , BASC_STAT             = NVL(:opro_lane_stat.c_basc_stat            , '') 
             , BASC_RVS_NO           = NVL(:opro_lane_stat.n_basc_rvs_no          , '') 
             , WORKR_CRD_STAT        = NVL(:opro_lane_stat.c_workr_crd_stat       , '') 
             , WORKR_CRD_RVS_NO      = NVL(:opro_lane_stat.n_workr_crd_rvs_no     , '') 
             , FARE_STAT             = NVL(:opro_lane_stat.c_fare_stat            , '') 
             , FARE_RVS_NO           = NVL(:opro_lane_stat.n_fare_rvs_no          , '') 
             , RGSTR_TAG_BL_STAT     = NVL(:opro_lane_stat.c_rgstr_tag_bl_stat    , '') 
             , RGSTR_TAG_BL_RVS_NO   = NVL(:opro_lane_stat.n_rgstr_tag_bl_rvs_no  , '') 
             , ISS_COMP_CD_STAT      = NVL(:opro_lane_stat.c_iss_comp_cd_stat     , '') 
             , ISS_COMP_CD_RVS_NO    = NVL(:opro_lane_stat.n_iss_comp_cd_rvs_no   , '') 
             , PERD_TAG_PL_STAT      = NVL(:opro_lane_stat.c_perd_tag_pl_stat     , '') 
             , PERD_TAG_PL_RVS_NO    = NVL(:opro_lane_stat.n_perd_tag_pl_rvs_no   , '') 
             , CONTROL_TYPE          = NVL(:opro_lane_stat.c_control_type         , '') 
             , FW_VER                = NVL(:opro_lane_stat.c_fw_ver               , '') 
             , RGSTR_TAG_BL_LAST_SEQ = NVL(:opro_lane_stat.d_rgstr_tag_bl_last_seq, '') 
             , LAST_GTHR_DATE_TM     = NVL(:opro_lane_stat.c_last_gthr_date_tm    , '') 
             , WORK_NO               = NVL(:opro_lane_stat.c_work_no              , '') 
             , LAST_RECV_TRNM_SEQ    = NVL(:opro_lane_stat.n_last_recv_trnm_seq   , '') 
             , COMM_STAT             = NVL(:opro_lane_stat.c_comm_stat            , '') 
             , PERD_TAG_PL_LAST_SEQ  = NVL(:opro_lane_stat.d_perd_tag_pl_last_seq , '') 
         WHERE PLZ_ID                = NVL(:opro_lane_stat.c_plz_id               , '') 
           AND LANE_NO               = NVL(:opro_lane_stat.c_lane_no              , '') 
         ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[24];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 24;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"UPDATE OPRO_LANE_STAT "
"           SET LANE_CLSS             = NVL(?             , '') "
"             , INSR_STAT             = NVL(?             , '') "
"             , BASC_STAT             = NVL(?             , '') "
"             , BASC_RVS_NO           = NVL(?           , '') "
"             , WORKR_CRD_STAT        = NVL(?        , '') "
"             , WORKR_CRD_RVS_NO      = NVL(?      , '') "
"             , FARE_STAT             = NVL(?             , '') "
"             , FARE_RVS_NO           = NVL(?           , '') "
"             , RGSTR_TAG_BL_STAT     = NVL(?     , '') "
"             , RGSTR_TAG_BL_RVS_NO   = NVL(?   , '') "
"             , ISS_COMP_CD_STAT      = NVL(?      , '') "
"             , ISS_COMP_CD_RVS_NO    = NVL(?    , '') "
"             , PERD_TAG_PL_STAT      = NVL(?      , '') "
"             , PERD_TAG_PL_RVS_NO    = NVL(?    , '') "
"             , CONTROL_TYPE          = NVL(?          , '') "
"             , FW_VER                = NVL(?                , '') "
"             , RGSTR_TAG_BL_LAST_SEQ = NVL(? , '') "
"             , LAST_GTHR_DATE_TM     = NVL(?     , '') "
"             , WORK_NO               = NVL(?               , '') "
"             , LAST_RECV_TRNM_SEQ    = NVL(?    , '') "
"             , COMM_STAT             = NVL(?             , '') "
"             , PERD_TAG_PL_LAST_SEQ  = NVL(?  , '') "
"         WHERE PLZ_ID                = NVL(?                , '') "
"           AND LANE_NO               = NVL(?               , '') "
"         ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(opro_lane_stat.c_lane_clss);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 1+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(opro_lane_stat.c_lane_clss);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(opro_lane_stat.c_insr_stat);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 8+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(opro_lane_stat.c_insr_stat);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(opro_lane_stat.c_basc_stat);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].isstruct = 0;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 1+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(opro_lane_stat.c_basc_stat);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)&(opro_lane_stat.n_basc_rvs_no);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 2;
    ulpSqlstmt.hostvalue[3].isstruct = 0;
    ulpSqlstmt.hostvalue[3].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[3].mLen = 0;
    ulpSqlstmt.hostvalue[3].mMaxlen = 0;
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)(opro_lane_stat.c_workr_crd_stat);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 6;
    ulpSqlstmt.hostvalue[4].isstruct = 0;
    ulpSqlstmt.hostvalue[4].mSizeof = 0;
    ulpSqlstmt.hostvalue[4].mLen = 1+1;
    ulpSqlstmt.hostvalue[4].mMaxlen = sizeof(opro_lane_stat.c_workr_crd_stat);
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)&(opro_lane_stat.n_workr_crd_rvs_no);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 2;
    ulpSqlstmt.hostvalue[5].isstruct = 0;
    ulpSqlstmt.hostvalue[5].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[5].mLen = 0;
    ulpSqlstmt.hostvalue[5].mMaxlen = 0;
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(opro_lane_stat.c_fare_stat);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].isstruct = 0;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 1+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(opro_lane_stat.c_fare_stat);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)&(opro_lane_stat.n_fare_rvs_no);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 2;
    ulpSqlstmt.hostvalue[7].isstruct = 0;
    ulpSqlstmt.hostvalue[7].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[7].mLen = 0;
    ulpSqlstmt.hostvalue[7].mMaxlen = 0;
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)(opro_lane_stat.c_rgstr_tag_bl_stat);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 6;
    ulpSqlstmt.hostvalue[8].isstruct = 0;
    ulpSqlstmt.hostvalue[8].mSizeof = 0;
    ulpSqlstmt.hostvalue[8].mLen = 1+1;
    ulpSqlstmt.hostvalue[8].mMaxlen = sizeof(opro_lane_stat.c_rgstr_tag_bl_stat);
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[9].mHostVar = (void*)&(opro_lane_stat.n_rgstr_tag_bl_rvs_no);
    ulpSqlstmt.hostvalue[9].mHostInd = NULL;
    ulpSqlstmt.hostvalue[9].isarr = 0;
    ulpSqlstmt.hostvalue[9].mType = 2;
    ulpSqlstmt.hostvalue[9].isstruct = 0;
    ulpSqlstmt.hostvalue[9].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[9].mLen = 0;
    ulpSqlstmt.hostvalue[9].mMaxlen = 0;
    ulpSqlstmt.hostvalue[9].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[9].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[9].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[10].mHostVar = (void*)(opro_lane_stat.c_iss_comp_cd_stat);
    ulpSqlstmt.hostvalue[10].mHostInd = NULL;
    ulpSqlstmt.hostvalue[10].isarr = 0;
    ulpSqlstmt.hostvalue[10].mType = 6;
    ulpSqlstmt.hostvalue[10].isstruct = 0;
    ulpSqlstmt.hostvalue[10].mSizeof = 0;
    ulpSqlstmt.hostvalue[10].mLen = 1+1;
    ulpSqlstmt.hostvalue[10].mMaxlen = sizeof(opro_lane_stat.c_iss_comp_cd_stat);
    ulpSqlstmt.hostvalue[10].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[10].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[10].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[11].mHostVar = (void*)&(opro_lane_stat.n_iss_comp_cd_rvs_no);
    ulpSqlstmt.hostvalue[11].mHostInd = NULL;
    ulpSqlstmt.hostvalue[11].isarr = 0;
    ulpSqlstmt.hostvalue[11].mType = 2;
    ulpSqlstmt.hostvalue[11].isstruct = 0;
    ulpSqlstmt.hostvalue[11].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[11].mLen = 0;
    ulpSqlstmt.hostvalue[11].mMaxlen = 0;
    ulpSqlstmt.hostvalue[11].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[11].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[11].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[12].mHostVar = (void*)(opro_lane_stat.c_perd_tag_pl_stat);
    ulpSqlstmt.hostvalue[12].mHostInd = NULL;
    ulpSqlstmt.hostvalue[12].isarr = 0;
    ulpSqlstmt.hostvalue[12].mType = 6;
    ulpSqlstmt.hostvalue[12].isstruct = 0;
    ulpSqlstmt.hostvalue[12].mSizeof = 0;
    ulpSqlstmt.hostvalue[12].mLen = 1+1;
    ulpSqlstmt.hostvalue[12].mMaxlen = sizeof(opro_lane_stat.c_perd_tag_pl_stat);
    ulpSqlstmt.hostvalue[12].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[12].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[12].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[13].mHostVar = (void*)&(opro_lane_stat.n_perd_tag_pl_rvs_no);
    ulpSqlstmt.hostvalue[13].mHostInd = NULL;
    ulpSqlstmt.hostvalue[13].isarr = 0;
    ulpSqlstmt.hostvalue[13].mType = 2;
    ulpSqlstmt.hostvalue[13].isstruct = 0;
    ulpSqlstmt.hostvalue[13].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[13].mLen = 0;
    ulpSqlstmt.hostvalue[13].mMaxlen = 0;
    ulpSqlstmt.hostvalue[13].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[13].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[13].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[14].mHostVar = (void*)(opro_lane_stat.c_control_type);
    ulpSqlstmt.hostvalue[14].mHostInd = NULL;
    ulpSqlstmt.hostvalue[14].isarr = 0;
    ulpSqlstmt.hostvalue[14].mType = 6;
    ulpSqlstmt.hostvalue[14].isstruct = 0;
    ulpSqlstmt.hostvalue[14].mSizeof = 0;
    ulpSqlstmt.hostvalue[14].mLen = 2+1;
    ulpSqlstmt.hostvalue[14].mMaxlen = sizeof(opro_lane_stat.c_control_type);
    ulpSqlstmt.hostvalue[14].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[14].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[14].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[15].mHostVar = (void*)(opro_lane_stat.c_fw_ver);
    ulpSqlstmt.hostvalue[15].mHostInd = NULL;
    ulpSqlstmt.hostvalue[15].isarr = 0;
    ulpSqlstmt.hostvalue[15].mType = 6;
    ulpSqlstmt.hostvalue[15].isstruct = 0;
    ulpSqlstmt.hostvalue[15].mSizeof = 0;
    ulpSqlstmt.hostvalue[15].mLen = 4+1;
    ulpSqlstmt.hostvalue[15].mMaxlen = sizeof(opro_lane_stat.c_fw_ver);
    ulpSqlstmt.hostvalue[15].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[15].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[15].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[16].mHostVar = (void*)&(opro_lane_stat.d_rgstr_tag_bl_last_seq);
    ulpSqlstmt.hostvalue[16].mHostInd = NULL;
    ulpSqlstmt.hostvalue[16].isarr = 0;
    ulpSqlstmt.hostvalue[16].mType = 2;
    ulpSqlstmt.hostvalue[16].isstruct = 0;
    ulpSqlstmt.hostvalue[16].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[16].mLen = 0;
    ulpSqlstmt.hostvalue[16].mMaxlen = 0;
    ulpSqlstmt.hostvalue[16].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[16].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[16].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[17].mHostVar = (void*)(opro_lane_stat.c_last_gthr_date_tm);
    ulpSqlstmt.hostvalue[17].mHostInd = NULL;
    ulpSqlstmt.hostvalue[17].isarr = 0;
    ulpSqlstmt.hostvalue[17].mType = 6;
    ulpSqlstmt.hostvalue[17].isstruct = 0;
    ulpSqlstmt.hostvalue[17].mSizeof = 0;
    ulpSqlstmt.hostvalue[17].mLen = 14+1;
    ulpSqlstmt.hostvalue[17].mMaxlen = sizeof(opro_lane_stat.c_last_gthr_date_tm);
    ulpSqlstmt.hostvalue[17].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[17].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[17].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[18].mHostVar = (void*)(opro_lane_stat.c_work_no);
    ulpSqlstmt.hostvalue[18].mHostInd = NULL;
    ulpSqlstmt.hostvalue[18].isarr = 0;
    ulpSqlstmt.hostvalue[18].mType = 6;
    ulpSqlstmt.hostvalue[18].isstruct = 0;
    ulpSqlstmt.hostvalue[18].mSizeof = 0;
    ulpSqlstmt.hostvalue[18].mLen = 4+1;
    ulpSqlstmt.hostvalue[18].mMaxlen = sizeof(opro_lane_stat.c_work_no);
    ulpSqlstmt.hostvalue[18].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[18].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[18].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[19].mHostVar = (void*)&(opro_lane_stat.n_last_recv_trnm_seq);
    ulpSqlstmt.hostvalue[19].mHostInd = NULL;
    ulpSqlstmt.hostvalue[19].isarr = 0;
    ulpSqlstmt.hostvalue[19].mType = 2;
    ulpSqlstmt.hostvalue[19].isstruct = 0;
    ulpSqlstmt.hostvalue[19].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[19].mLen = 0;
    ulpSqlstmt.hostvalue[19].mMaxlen = 0;
    ulpSqlstmt.hostvalue[19].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[19].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[19].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[20].mHostVar = (void*)(opro_lane_stat.c_comm_stat);
    ulpSqlstmt.hostvalue[20].mHostInd = NULL;
    ulpSqlstmt.hostvalue[20].isarr = 0;
    ulpSqlstmt.hostvalue[20].mType = 6;
    ulpSqlstmt.hostvalue[20].isstruct = 0;
    ulpSqlstmt.hostvalue[20].mSizeof = 0;
    ulpSqlstmt.hostvalue[20].mLen = 1+1;
    ulpSqlstmt.hostvalue[20].mMaxlen = sizeof(opro_lane_stat.c_comm_stat);
    ulpSqlstmt.hostvalue[20].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[20].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[20].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[21].mHostVar = (void*)&(opro_lane_stat.d_perd_tag_pl_last_seq);
    ulpSqlstmt.hostvalue[21].mHostInd = NULL;
    ulpSqlstmt.hostvalue[21].isarr = 0;
    ulpSqlstmt.hostvalue[21].mType = 2;
    ulpSqlstmt.hostvalue[21].isstruct = 0;
    ulpSqlstmt.hostvalue[21].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[21].mLen = 0;
    ulpSqlstmt.hostvalue[21].mMaxlen = 0;
    ulpSqlstmt.hostvalue[21].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[21].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[21].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[22].mHostVar = (void*)(opro_lane_stat.c_plz_id);
    ulpSqlstmt.hostvalue[22].mHostInd = NULL;
    ulpSqlstmt.hostvalue[22].isarr = 0;
    ulpSqlstmt.hostvalue[22].mType = 6;
    ulpSqlstmt.hostvalue[22].isstruct = 0;
    ulpSqlstmt.hostvalue[22].mSizeof = 0;
    ulpSqlstmt.hostvalue[22].mLen = 6+1;
    ulpSqlstmt.hostvalue[22].mMaxlen = sizeof(opro_lane_stat.c_plz_id);
    ulpSqlstmt.hostvalue[22].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[22].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[22].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[23].mHostVar = (void*)(opro_lane_stat.c_lane_no);
    ulpSqlstmt.hostvalue[23].mHostInd = NULL;
    ulpSqlstmt.hostvalue[23].isarr = 0;
    ulpSqlstmt.hostvalue[23].mType = 6;
    ulpSqlstmt.hostvalue[23].isstruct = 0;
    ulpSqlstmt.hostvalue[23].mSizeof = 0;
    ulpSqlstmt.hostvalue[23].mLen = 2+1;
    ulpSqlstmt.hostvalue[23].mMaxlen = sizeof(opro_lane_stat.c_lane_no);
    ulpSqlstmt.hostvalue[23].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[23].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[23].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}

    }

    if (SQLCODE < 0)
    {
        printf("SQLCODE = %d OPRO_LANE_STAT [%d] 차로상태 PLZ_ID[%s] lane_no[%s]\n",
                SQLCODE, iCrjb, opro_lane_stat.c_plz_id, opro_lane_stat.c_lane_no);
        return(-1);
    }

    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_rpr_data()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 보수정보 Data를 처리.
 *========================================================================
*/

int proc_rpr_data(char *target)
{
    struct rcv_lane_data  *rd;
    struct hi_rpr_data    *pk_in;

    struct    pubh_equip_stat  pubh_equip_stat;
    int       gseq = 0;

    memset((char *)&pubh_equip_stat, 0, sizeof(pubh_equip_stat));
    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_rpr_data *)rd->buf;
    e_memcpy(pubh_equip_stat.c_plz_id, rd->plz_id);
    e_memcpy(pubh_equip_stat.c_work_no, pk_in->wrk_no);

    sprintf((char *)pubh_equip_stat.c_occrn_date_tm, "%.4s%.2s%.2s%.2s%.2s%.2s",
                    pk_in->year, pk_in->month, pk_in->day, pk_in->hour, pk_in->min, pk_in->sec);
    sprintf((char *)pubh_equip_stat.c_lane_no, "%.2s", pk_in->wrk_no);

    /*  
    SELECT NVL(MAX(SEQ), 0) + 1 
                
    FROM  PUBH_EQUIP_STAT 
    WHERE PLZ_ID = :pubh_equip_stat.c_plz_id 
    AND   WORK_NO = :pubh_equip_stat.c_work_no 
    AND   LANE_NO = :pubh_equip_stat.c_lane_no; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[4];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 4;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT NVL(MAX(SEQ), 0) + 1 "
"                "
"    FROM  PUBH_EQUIP_STAT "
"    WHERE PLZ_ID = ?  "
"    AND   WORK_NO = ?  "
"    AND   LANE_NO = ? ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)&(gseq);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 2;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[0].mLen = 0;
    ulpSqlstmt.hostvalue[0].mMaxlen = 0;
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubh_equip_stat.c_plz_id);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 6+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubh_equip_stat.c_plz_id);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(pubh_equip_stat.c_work_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].isstruct = 0;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 4+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(pubh_equip_stat.c_work_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(pubh_equip_stat.c_lane_no);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].isstruct = 0;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 2+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(pubh_equip_stat.c_lane_no);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("SQLCODE = %d PUBH_EQUIP_STAT SELECT ERROR\n", SQLCODE);
        return(-1);
    }

    pubh_equip_stat.d_seq = gseq;
    sprintf((char *)pubh_equip_stat.c_work_stat, "%c", pk_in->wrk_stat);
    e_memcpy(pubh_equip_stat.c_knmc, pk_in->mchi_kind);
    sprintf((char *)pubh_equip_stat.c_recvr_tn, "%c", pk_in->occ_rest);
    e_memcpy(pubh_equip_stat.c_err_cd, pk_in->stat_code);

    /*  INSERT INTO PUBH_EQUIP_STAT VALUES (:pubh_equip_stat); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[9];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 9;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO PUBH_EQUIP_STAT VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubh_equip_stat.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(pubh_equip_stat);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubh_equip_stat.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)&(pubh_equip_stat.d_seq);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(pubh_equip_stat);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 2;
    ulpSqlstmt.hostvalue[1].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[1].mLen = 0;
    ulpSqlstmt.hostvalue[1].mMaxlen = 0;
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(pubh_equip_stat.c_work_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(pubh_equip_stat);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 4+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(pubh_equip_stat.c_work_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(pubh_equip_stat.c_occrn_date_tm);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(pubh_equip_stat);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 14+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(pubh_equip_stat.c_occrn_date_tm);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)(pubh_equip_stat.c_lane_no);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isstruct = 1;
    ulpSqlstmt.hostvalue[4].structsize = sizeof(pubh_equip_stat);
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 6;
    ulpSqlstmt.hostvalue[4].mSizeof = 0;
    ulpSqlstmt.hostvalue[4].mLen = 2+1;
    ulpSqlstmt.hostvalue[4].mMaxlen = sizeof(pubh_equip_stat.c_lane_no);
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(pubh_equip_stat.c_work_stat);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isstruct = 1;
    ulpSqlstmt.hostvalue[5].structsize = sizeof(pubh_equip_stat);
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 1+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(pubh_equip_stat.c_work_stat);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(pubh_equip_stat.c_knmc);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isstruct = 1;
    ulpSqlstmt.hostvalue[6].structsize = sizeof(pubh_equip_stat);
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 2+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(pubh_equip_stat.c_knmc);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)(pubh_equip_stat.c_recvr_tn);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isstruct = 1;
    ulpSqlstmt.hostvalue[7].structsize = sizeof(pubh_equip_stat);
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 6;
    ulpSqlstmt.hostvalue[7].mSizeof = 0;
    ulpSqlstmt.hostvalue[7].mLen = 1+1;
    ulpSqlstmt.hostvalue[7].mMaxlen = sizeof(pubh_equip_stat.c_recvr_tn);
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)(pubh_equip_stat.c_err_cd);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isstruct = 1;
    ulpSqlstmt.hostvalue[8].structsize = sizeof(pubh_equip_stat);
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 6;
    ulpSqlstmt.hostvalue[8].mSizeof = 0;
    ulpSqlstmt.hostvalue[8].mLen = 2+1;
    ulpSqlstmt.hostvalue[8].mMaxlen = sizeof(pubh_equip_stat.c_err_cd);
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("SQLCODE = %d PUBH_EQUIP_STAT 보수 wrk_date[%.4s%.2s%.2s%.2s%.2s%.2s] lane_no[%.2s]\n",
                SQLCODE, pk_in->year, pk_in->month, pk_in->day, pk_in->hour, pk_in->min, pk_in->sec, pk_in->wrk_no);
        return(-1);
    }

    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_cls_pass()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 폐쇄차로 Data를 처리.
 *========================================================================
*/

int proc_cls_pass(char *target)
{
    struct rcv_lane_data  *rd;
    struct    hi_close_lane_pass    *pk_in;

    struct    pubo_pass_close  pubo_pass_close;


    memset((char *)&pubo_pass_close, 0, sizeof(pubo_pass_close));
    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_close_lane_pass *)rd->buf;

    sprintf((char *)pubo_pass_close.c_plz_id, "%.6s", rd->plz_id);
    sprintf((char *)pubo_pass_close.c_lane_no,"%.2s", pk_in->lane_no);
    sprintf((char *)pubo_pass_close.c_work_date, "%.8s", pk_in->wrk_date);

    printf("Check c_plz_id[%s]\n", pubo_pass_close.c_plz_id);
    printf("Check c_lane_no[%s]\n", pubo_pass_close.c_lane_no);
    printf("Check c_work_date[%s]\n", pubo_pass_close.c_work_date);

    pubo_pass_close.d_seq = lb_data2atoi((char *)pk_in->serial_no, 8);

    printf("Check d_seq[%d][%.8s]\n", pubo_pass_close.d_seq, pk_in->serial_no);

    sprintf((char *)pubo_pass_close.c_occrn_date_tm, "%.4s%.2s%.2s%.2s%.2s%.2s",
            pk_in->year, pk_in->month, pk_in->day,
            pk_in->hour, pk_in->min, pk_in->sec);

    printf("Check c_occrn_date_tm[%s]\n", pubo_pass_close.c_occrn_date_tm);

    pubo_pass_close.n_forwd_backwd_type = pk_in->adv_rev-'0';
    printf("Check n_forwd_backwd_type[%d]\n", pubo_pass_close.n_forwd_backwd_type);
    pubo_pass_close.n_sens_vhcl_clss = pk_in->sens_vhcl_clss-'0';
    printf("Check n_sens_vhcl_clss[%d]\n", pubo_pass_close.n_sens_vhcl_clss);
    pubo_pass_close.n_img_no = lb_data2atoi((char *)pk_in->pctr_no, 4);
    printf("Check n_img_no[%d]\n", pubo_pass_close.n_img_no);
    pubo_pass_close.n_axle = lb_data2atoi((char *)pk_in->axle_code, 4);
    printf("Check n_axle[%d]\n", pubo_pass_close.n_axle);
    pubo_pass_close.n_trwdt = lb_data2atoi((char *)pk_in->trwdt, 4);
    printf("Check n_trwdt[%d]\n", pubo_pass_close.n_trwdt);
    pubo_pass_close.n_trtrd = lb_data2atoi((char *)pk_in->trtrd, 4);
    printf("Check n_trtrd[%d]\n", pubo_pass_close.n_trtrd);
    pubo_pass_close.n_breath = lb_data2atoi((char *)pk_in->breadth, 4);
    printf("Check n_breath[%d]\n", pubo_pass_close.n_breath);
    pubo_pass_close.n_cond = lb_data2atoi((char *)pk_in->car_length, 4);
    printf("Check n_cond[%d]\n", pubo_pass_close.n_cond);
    pubo_pass_close.n_garage = lb_data2atoi((char *)pk_in->car_height, 4);
    printf("Check n_garage[%d]\n", pubo_pass_close.n_garage);
    pubo_pass_close.n_point = lb_data2atoi((char *)pk_in->location, 4);
    printf("Check n_point[%d]\n", pubo_pass_close.n_point);
    pubo_pass_close.n_sped = lb_data2atoi((char *)pk_in->speed, 4);
    printf("Check speed[%d]\n", pubo_pass_close.n_sped);
    sprintf((char *)pubo_pass_close.c_prcs_stat, "0");
    printf("Check c_prcs_stat[%s]\n", pubo_pass_close.c_prcs_stat);
    /*  INSERT INTO PUBO_PASS_CLOSE VALUES (:pubo_pass_close); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[17];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 17;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO PUBO_PASS_CLOSE VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubo_pass_close.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubo_pass_close.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubo_pass_close.c_lane_no);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 2+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubo_pass_close.c_lane_no);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(pubo_pass_close.c_work_date);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 8+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(pubo_pass_close.c_work_date);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)&(pubo_pass_close.d_seq);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 2;
    ulpSqlstmt.hostvalue[3].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[3].mLen = 0;
    ulpSqlstmt.hostvalue[3].mMaxlen = 0;
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)(pubo_pass_close.c_occrn_date_tm);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isstruct = 1;
    ulpSqlstmt.hostvalue[4].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 6;
    ulpSqlstmt.hostvalue[4].mSizeof = 0;
    ulpSqlstmt.hostvalue[4].mLen = 14+1;
    ulpSqlstmt.hostvalue[4].mMaxlen = sizeof(pubo_pass_close.c_occrn_date_tm);
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)&(pubo_pass_close.n_forwd_backwd_type);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isstruct = 1;
    ulpSqlstmt.hostvalue[5].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 2;
    ulpSqlstmt.hostvalue[5].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[5].mLen = 0;
    ulpSqlstmt.hostvalue[5].mMaxlen = 0;
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)&(pubo_pass_close.n_sens_vhcl_clss);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isstruct = 1;
    ulpSqlstmt.hostvalue[6].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 2;
    ulpSqlstmt.hostvalue[6].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[6].mLen = 0;
    ulpSqlstmt.hostvalue[6].mMaxlen = 0;
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)&(pubo_pass_close.n_img_no);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isstruct = 1;
    ulpSqlstmt.hostvalue[7].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 2;
    ulpSqlstmt.hostvalue[7].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[7].mLen = 0;
    ulpSqlstmt.hostvalue[7].mMaxlen = 0;
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)&(pubo_pass_close.n_axle);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isstruct = 1;
    ulpSqlstmt.hostvalue[8].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 2;
    ulpSqlstmt.hostvalue[8].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[8].mLen = 0;
    ulpSqlstmt.hostvalue[8].mMaxlen = 0;
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[9].mHostVar = (void*)&(pubo_pass_close.n_trwdt);
    ulpSqlstmt.hostvalue[9].mHostInd = NULL;
    ulpSqlstmt.hostvalue[9].isstruct = 1;
    ulpSqlstmt.hostvalue[9].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[9].isarr = 0;
    ulpSqlstmt.hostvalue[9].mType = 2;
    ulpSqlstmt.hostvalue[9].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[9].mLen = 0;
    ulpSqlstmt.hostvalue[9].mMaxlen = 0;
    ulpSqlstmt.hostvalue[9].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[9].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[9].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[10].mHostVar = (void*)&(pubo_pass_close.n_trtrd);
    ulpSqlstmt.hostvalue[10].mHostInd = NULL;
    ulpSqlstmt.hostvalue[10].isstruct = 1;
    ulpSqlstmt.hostvalue[10].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[10].isarr = 0;
    ulpSqlstmt.hostvalue[10].mType = 2;
    ulpSqlstmt.hostvalue[10].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[10].mLen = 0;
    ulpSqlstmt.hostvalue[10].mMaxlen = 0;
    ulpSqlstmt.hostvalue[10].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[10].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[10].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[11].mHostVar = (void*)&(pubo_pass_close.n_breath);
    ulpSqlstmt.hostvalue[11].mHostInd = NULL;
    ulpSqlstmt.hostvalue[11].isstruct = 1;
    ulpSqlstmt.hostvalue[11].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[11].isarr = 0;
    ulpSqlstmt.hostvalue[11].mType = 2;
    ulpSqlstmt.hostvalue[11].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[11].mLen = 0;
    ulpSqlstmt.hostvalue[11].mMaxlen = 0;
    ulpSqlstmt.hostvalue[11].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[11].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[11].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[12].mHostVar = (void*)&(pubo_pass_close.n_cond);
    ulpSqlstmt.hostvalue[12].mHostInd = NULL;
    ulpSqlstmt.hostvalue[12].isstruct = 1;
    ulpSqlstmt.hostvalue[12].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[12].isarr = 0;
    ulpSqlstmt.hostvalue[12].mType = 2;
    ulpSqlstmt.hostvalue[12].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[12].mLen = 0;
    ulpSqlstmt.hostvalue[12].mMaxlen = 0;
    ulpSqlstmt.hostvalue[12].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[12].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[12].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[13].mHostVar = (void*)&(pubo_pass_close.n_garage);
    ulpSqlstmt.hostvalue[13].mHostInd = NULL;
    ulpSqlstmt.hostvalue[13].isstruct = 1;
    ulpSqlstmt.hostvalue[13].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[13].isarr = 0;
    ulpSqlstmt.hostvalue[13].mType = 2;
    ulpSqlstmt.hostvalue[13].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[13].mLen = 0;
    ulpSqlstmt.hostvalue[13].mMaxlen = 0;
    ulpSqlstmt.hostvalue[13].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[13].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[13].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[14].mHostVar = (void*)&(pubo_pass_close.n_point);
    ulpSqlstmt.hostvalue[14].mHostInd = NULL;
    ulpSqlstmt.hostvalue[14].isstruct = 1;
    ulpSqlstmt.hostvalue[14].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[14].isarr = 0;
    ulpSqlstmt.hostvalue[14].mType = 2;
    ulpSqlstmt.hostvalue[14].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[14].mLen = 0;
    ulpSqlstmt.hostvalue[14].mMaxlen = 0;
    ulpSqlstmt.hostvalue[14].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[14].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[14].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[15].mHostVar = (void*)&(pubo_pass_close.n_sped);
    ulpSqlstmt.hostvalue[15].mHostInd = NULL;
    ulpSqlstmt.hostvalue[15].isstruct = 1;
    ulpSqlstmt.hostvalue[15].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[15].isarr = 0;
    ulpSqlstmt.hostvalue[15].mType = 2;
    ulpSqlstmt.hostvalue[15].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[15].mLen = 0;
    ulpSqlstmt.hostvalue[15].mMaxlen = 0;
    ulpSqlstmt.hostvalue[15].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[15].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[15].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[16].mHostVar = (void*)(pubo_pass_close.c_prcs_stat);
    ulpSqlstmt.hostvalue[16].mHostInd = NULL;
    ulpSqlstmt.hostvalue[16].isstruct = 1;
    ulpSqlstmt.hostvalue[16].structsize = sizeof(pubo_pass_close);
    ulpSqlstmt.hostvalue[16].isarr = 0;
    ulpSqlstmt.hostvalue[16].mType = 6;
    ulpSqlstmt.hostvalue[16].mSizeof = 0;
    ulpSqlstmt.hostvalue[16].mLen = 1+1;
    ulpSqlstmt.hostvalue[16].mMaxlen = sizeof(pubo_pass_close.c_prcs_stat);
    ulpSqlstmt.hostvalue[16].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[16].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[16].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("SQLCODE = %d PUBO_PASS_CLOSE 폐쇄 wrk_date[%.8s] lane_no[%.2s]\n",
                SQLCODE, pk_in->wrk_date, pk_in->lane_no);
        return(-1);
    }

    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_sens_data()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 감지 Data를 처리.
 *========================================================================
*/

int proc_sens_data(char *target)
{
    struct rcv_lane_data  *rd;
    struct    hi_sens_data    *pk_in;

    struct    pubo_sensing  pubo_sensing;


    memset((char *)&pubo_sensing, 0, sizeof(pubo_sensing));
    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_sens_data *)rd->buf;

    e_memcpy(pubo_sensing.c_plz_id,    rd->plz_id);
    e_memcpy(pubo_sensing.c_work_date, pk_in->wrk_date);
    e_memcpy(pubo_sensing.c_work_no,   pk_in->wrk_no);

    sprintf((char *)pubo_sensing.c_sens_date_tm, "%.4s%.2s%.2s%.2s%.2s%.2s%c",
            pk_in->sens_year, pk_in->sens_month, pk_in->sens_day,
            pk_in->sens_hour, pk_in->sens_min, pk_in->sens_sec, '\0');

    sprintf((char *)pubo_sensing.c_forwd_backwd_type, "%c", pk_in->adv_rev);
    sprintf((char *)pubo_sensing.c_sens_vhcl_clss   , "%c", pk_in->sens_vhcl_clss);

    pubo_sensing.n_axle   = lb_data2atoi((char *)pk_in->axle_code, 4);
    pubo_sensing.n_trwdt  = lb_data2atoi((char *)pk_in->trwdt, 4);
    pubo_sensing.n_trtrd  = lb_data2atoi((char *)pk_in->trtrd, 4);
    pubo_sensing.n_breath = lb_data2atoi((char *)pk_in->breadth, 4);
    pubo_sensing.n_cond   = lb_data2atoi((char *)pk_in->car_length, 4);
    pubo_sensing.n_garage = lb_data2atoi((char *)pk_in->car_height, 4);
    pubo_sensing.n_point  = lb_data2atoi((char *)pk_in->location, 4);
    pubo_sensing.n_sped   = lb_data2atoi((char *)pk_in->speed, 4);

    e_memcpy(pubo_sensing.c_prcs_yn, pk_in->hnd_yn);

    pubo_sensing.d_trnm_seq = lb_data2atoi((char *)pk_in->seq_no, 8);

    e_memcpy(pubo_sensing.c_vio_caus, pk_in->caus_code);

    e_memcpy(pubo_sensing.c_tag_id,   pk_in->tag_id);

    pubo_sensing.d_sens_seq = lb_data2atoi((char *)pk_in->sens_seq, 8);

    /*  INSERT INTO PUBO_SENSING VALUES (:pubo_sensing); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[19];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 19;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO PUBO_SENSING VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubo_sensing.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubo_sensing.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubo_sensing.c_work_date);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 8+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubo_sensing.c_work_date);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(pubo_sensing.c_work_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 4+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(pubo_sensing.c_work_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(pubo_sensing.c_sens_date_tm);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 14+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(pubo_sensing.c_sens_date_tm);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)&(pubo_sensing.d_sens_seq);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isstruct = 1;
    ulpSqlstmt.hostvalue[4].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 2;
    ulpSqlstmt.hostvalue[4].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[4].mLen = 0;
    ulpSqlstmt.hostvalue[4].mMaxlen = 0;
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(pubo_sensing.c_forwd_backwd_type);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isstruct = 1;
    ulpSqlstmt.hostvalue[5].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 1+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(pubo_sensing.c_forwd_backwd_type);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(pubo_sensing.c_sens_vhcl_clss);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isstruct = 1;
    ulpSqlstmt.hostvalue[6].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 1+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(pubo_sensing.c_sens_vhcl_clss);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)&(pubo_sensing.n_axle);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isstruct = 1;
    ulpSqlstmt.hostvalue[7].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 2;
    ulpSqlstmt.hostvalue[7].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[7].mLen = 0;
    ulpSqlstmt.hostvalue[7].mMaxlen = 0;
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)&(pubo_sensing.n_trwdt);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isstruct = 1;
    ulpSqlstmt.hostvalue[8].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 2;
    ulpSqlstmt.hostvalue[8].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[8].mLen = 0;
    ulpSqlstmt.hostvalue[8].mMaxlen = 0;
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[9].mHostVar = (void*)&(pubo_sensing.n_trtrd);
    ulpSqlstmt.hostvalue[9].mHostInd = NULL;
    ulpSqlstmt.hostvalue[9].isstruct = 1;
    ulpSqlstmt.hostvalue[9].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[9].isarr = 0;
    ulpSqlstmt.hostvalue[9].mType = 2;
    ulpSqlstmt.hostvalue[9].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[9].mLen = 0;
    ulpSqlstmt.hostvalue[9].mMaxlen = 0;
    ulpSqlstmt.hostvalue[9].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[9].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[9].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[10].mHostVar = (void*)&(pubo_sensing.n_breath);
    ulpSqlstmt.hostvalue[10].mHostInd = NULL;
    ulpSqlstmt.hostvalue[10].isstruct = 1;
    ulpSqlstmt.hostvalue[10].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[10].isarr = 0;
    ulpSqlstmt.hostvalue[10].mType = 2;
    ulpSqlstmt.hostvalue[10].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[10].mLen = 0;
    ulpSqlstmt.hostvalue[10].mMaxlen = 0;
    ulpSqlstmt.hostvalue[10].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[10].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[10].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[11].mHostVar = (void*)&(pubo_sensing.n_cond);
    ulpSqlstmt.hostvalue[11].mHostInd = NULL;
    ulpSqlstmt.hostvalue[11].isstruct = 1;
    ulpSqlstmt.hostvalue[11].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[11].isarr = 0;
    ulpSqlstmt.hostvalue[11].mType = 2;
    ulpSqlstmt.hostvalue[11].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[11].mLen = 0;
    ulpSqlstmt.hostvalue[11].mMaxlen = 0;
    ulpSqlstmt.hostvalue[11].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[11].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[11].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[12].mHostVar = (void*)&(pubo_sensing.n_garage);
    ulpSqlstmt.hostvalue[12].mHostInd = NULL;
    ulpSqlstmt.hostvalue[12].isstruct = 1;
    ulpSqlstmt.hostvalue[12].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[12].isarr = 0;
    ulpSqlstmt.hostvalue[12].mType = 2;
    ulpSqlstmt.hostvalue[12].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[12].mLen = 0;
    ulpSqlstmt.hostvalue[12].mMaxlen = 0;
    ulpSqlstmt.hostvalue[12].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[12].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[12].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[13].mHostVar = (void*)&(pubo_sensing.n_point);
    ulpSqlstmt.hostvalue[13].mHostInd = NULL;
    ulpSqlstmt.hostvalue[13].isstruct = 1;
    ulpSqlstmt.hostvalue[13].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[13].isarr = 0;
    ulpSqlstmt.hostvalue[13].mType = 2;
    ulpSqlstmt.hostvalue[13].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[13].mLen = 0;
    ulpSqlstmt.hostvalue[13].mMaxlen = 0;
    ulpSqlstmt.hostvalue[13].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[13].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[13].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[14].mHostVar = (void*)&(pubo_sensing.n_sped);
    ulpSqlstmt.hostvalue[14].mHostInd = NULL;
    ulpSqlstmt.hostvalue[14].isstruct = 1;
    ulpSqlstmt.hostvalue[14].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[14].isarr = 0;
    ulpSqlstmt.hostvalue[14].mType = 2;
    ulpSqlstmt.hostvalue[14].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[14].mLen = 0;
    ulpSqlstmt.hostvalue[14].mMaxlen = 0;
    ulpSqlstmt.hostvalue[14].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[14].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[14].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[15].mHostVar = (void*)(pubo_sensing.c_prcs_yn);
    ulpSqlstmt.hostvalue[15].mHostInd = NULL;
    ulpSqlstmt.hostvalue[15].isstruct = 1;
    ulpSqlstmt.hostvalue[15].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[15].isarr = 0;
    ulpSqlstmt.hostvalue[15].mType = 6;
    ulpSqlstmt.hostvalue[15].mSizeof = 0;
    ulpSqlstmt.hostvalue[15].mLen = 2+1;
    ulpSqlstmt.hostvalue[15].mMaxlen = sizeof(pubo_sensing.c_prcs_yn);
    ulpSqlstmt.hostvalue[15].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[15].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[15].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[16].mHostVar = (void*)&(pubo_sensing.d_trnm_seq);
    ulpSqlstmt.hostvalue[16].mHostInd = NULL;
    ulpSqlstmt.hostvalue[16].isstruct = 1;
    ulpSqlstmt.hostvalue[16].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[16].isarr = 0;
    ulpSqlstmt.hostvalue[16].mType = 2;
    ulpSqlstmt.hostvalue[16].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[16].mLen = 0;
    ulpSqlstmt.hostvalue[16].mMaxlen = 0;
    ulpSqlstmt.hostvalue[16].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[16].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[16].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[17].mHostVar = (void*)(pubo_sensing.c_vio_caus);
    ulpSqlstmt.hostvalue[17].mHostInd = NULL;
    ulpSqlstmt.hostvalue[17].isstruct = 1;
    ulpSqlstmt.hostvalue[17].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[17].isarr = 0;
    ulpSqlstmt.hostvalue[17].mType = 6;
    ulpSqlstmt.hostvalue[17].mSizeof = 0;
    ulpSqlstmt.hostvalue[17].mLen = 2+1;
    ulpSqlstmt.hostvalue[17].mMaxlen = sizeof(pubo_sensing.c_vio_caus);
    ulpSqlstmt.hostvalue[17].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[17].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[17].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[18].mHostVar = (void*)(pubo_sensing.c_tag_id);
    ulpSqlstmt.hostvalue[18].mHostInd = NULL;
    ulpSqlstmt.hostvalue[18].isstruct = 1;
    ulpSqlstmt.hostvalue[18].structsize = sizeof(pubo_sensing);
    ulpSqlstmt.hostvalue[18].isarr = 0;
    ulpSqlstmt.hostvalue[18].mType = 6;
    ulpSqlstmt.hostvalue[18].mSizeof = 0;
    ulpSqlstmt.hostvalue[18].mLen = 24+1;
    ulpSqlstmt.hostvalue[18].mMaxlen = sizeof(pubo_sensing.c_tag_id);
    ulpSqlstmt.hostvalue[18].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[18].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[18].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("SQLCODE = %d PUBO_SENSING 감지 wrk_date[%.8s] lane_no[%.2s]\n",
                SQLCODE, pk_in->wrk_date, pk_in->wrk_no);
        return(-1);
    }

    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : inst_day_chg()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 일변경 DATA 수신시 일별관리정보()테이블 일자 INSERT
 *
 *========================================================================
*/

int inst_day_chg(char *target)
{
    struct rcv_lane_data  *rd;
    struct hi_day_chng *pk_in;
    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_day_chng *)rd->buf;
    printf("일변경 수신[%.8s][%.6s]\n", pk_in->wrk_date, rd->plz_id);
    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : inst_day_end()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 차로시스템으로 부터 일마감 DATA 수신시 처리
 *              일마감 DATA를 근무상태정보에 INSERT or UPDATE
 *========================================================================
*/

int inst_day_end(char *target)
{
    struct rcv_lane_data  *rd;
    struct    tm    *pTm;
    struct hi_day_end *pk_in;
    long    Current;


    struct    pubh_dayend_flag    pubh_dayend_flag;


    Current = time(0);
    pTm = localtime(&Current);
    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_day_end *)rd->buf;
    memset((char *)&pubh_dayend_flag, 0, sizeof(pubh_dayend_flag));
    sprintf((char *)pubh_dayend_flag.c_plz_id, "%.6s", rd->plz_id);
    sprintf((char *)pubh_dayend_flag.c_work_date, "%.8s", pk_in->wrk_date);

    e_memcpy(pubh_dayend_flag.c_lane_no, rd->lane_no);

    sprintf((char *)pubh_dayend_flag.c_occrn_date_tm, "%04d%02d%02d%02d%02d%02d",
                pTm->tm_year+1900, pTm->tm_mon+1, pTm->tm_mday,
                pTm->tm_hour, pTm->tm_min,pTm->tm_sec);

    /*  INSERT INTO pubh_dayend_flag VALUES (:pubh_dayend_flag); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[4];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 4;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO pubh_dayend_flag VALUES (? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubh_dayend_flag.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(pubh_dayend_flag);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubh_dayend_flag.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubh_dayend_flag.c_work_date);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(pubh_dayend_flag);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 8+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubh_dayend_flag.c_work_date);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(pubh_dayend_flag.c_lane_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(pubh_dayend_flag);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 2+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(pubh_dayend_flag.c_lane_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(pubh_dayend_flag.c_occrn_date_tm);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(pubh_dayend_flag);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 14+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(pubh_dayend_flag.c_occrn_date_tm);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("SQLCODE = %d inst_day_end 일마감정보 pubm_dayendflag INSERT wrk_date[%.8s] lane_no[%.2s]\n",
                SQLCODE, pk_in->wrk_date, pk_in->lane_no);
        return(-1);
    }

    /*  
    UPDATE OPRO_LANE_STAT 
       SET DAYEND_RECV_DATE_TM   = :pubh_dayend_flag.c_occrn_date_tm 
     WHERE PLZ_ID                = :pubh_dayend_flag.c_plz_id 
       AND LANE_NO               = :pubh_dayend_flag.c_lane_no; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[3];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 3;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"UPDATE OPRO_LANE_STAT "
"       SET DAYEND_RECV_DATE_TM   = ?  "
"     WHERE PLZ_ID                = ?  "
"       AND LANE_NO               = ? ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubh_dayend_flag.c_occrn_date_tm);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 14+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubh_dayend_flag.c_occrn_date_tm);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubh_dayend_flag.c_plz_id);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 6+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubh_dayend_flag.c_plz_id);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(pubh_dayend_flag.c_lane_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].isstruct = 0;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 2+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(pubh_dayend_flag.c_lane_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("SQLCODE = %d inst_day_end 일마감정보 OPRO_LANE_STAT UPDATE wrk_date[%.8s] lane_no[%.2s]\n",
                SQLCODE, pk_in->wrk_date, pk_in->lane_no);
        return(-1);
    }
    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_wrk_start()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 근무 개시 처리
 *
 *========================================================================
*/

int proc_wrk_start(char *target)
{
    struct rcv_lane_data  *rd;
    struct  hi_wrk_start *pk_in;
    int     iCrjb;
    int     start_sno;


    struct  pubo_work_state    pubo_work_state;
    char    cDate[8+1], cKmbh[4+1];
    char    plz_id[6+1];
    char    wrkr_no[6+1], start_date[14+1];
    char    end_date[14+1], lane_no[2+1];


    memset((char *)&pubo_work_state, 0, sizeof(pubo_work_state));
    memset(cDate, 0x0, sizeof(cDate));
    memset(cKmbh, 0x0, sizeof(cKmbh));
    memset(plz_id, 0x0, sizeof(plz_id));
    memset(wrkr_no, 0x0, sizeof(wrkr_no));
    memset(start_date, 0x0, sizeof(start_date));
    memset(end_date, 0x0, sizeof(end_date));
    memset(lane_no, 0x0, sizeof(lane_no));

    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_wrk_start *)rd->buf;

    sprintf(plz_id, "%.6s", rd->plz_id);
    memcpy(lane_no, pk_in->wrk_no, 2);
    start_sno = lb_data2atoi((char *)pk_in->seq_no, 8);

    /* 현근무상태 Check     */
    iCrjb   = chk_wrk_endhnd_yn(rd);

    if(iCrjb != 0)
    {
        printf( " chk_wrk_endhnd_yn [%d] \n", iCrjb );
        return(-1);
    }

    e_memcpy(pubo_work_state.c_plz_id,    plz_id);
    e_memcpy(pubo_work_state.c_work_date, pk_in->wrk_date);
    e_memcpy(pubo_work_state.c_work_no,   pk_in->wrk_no);

    e_memcpy(pubo_work_state.c_lane_type,  pk_in->lane_typ);
    e_memcpy(pubo_work_state.c_workr_no,  pk_in->wrkr_no);

    sprintf((char *)pubo_work_state.c_strt_date_tm, "%.4s%.2s%.2s%.2s%.2s%.2s",
            pk_in->wrk_start_year, pk_in->wrk_start_month, pk_in->wrk_start_day,
            pk_in->wrk_start_hour, pk_in->wrk_start_min, pk_in->wrk_start_sec);

    sprintf((char *)pubo_work_state.c_end_tm, "00000000000000");
    sprintf((char *)pubo_work_state.c_end_type, "0");
    pubo_work_state.n_strt_trnm_seq = start_sno;
    pubo_work_state.n_end_trnm_seq =  0;

    sprintf((char *)pubo_work_state.c_work_type, "%c", pk_in->wrk_div);
    sprintf((char *)pubo_work_state.c_work_end_stat, "1");

    e_memcpy(cDate,      pubo_work_state.c_work_date   );
    e_memcpy(cKmbh,      pubo_work_state.c_work_no     );
    e_memcpy(wrkr_no,    pubo_work_state.c_workr_no    );
    e_memcpy(start_date, pubo_work_state.c_strt_date_tm);
    e_memcpy(end_date,   pubo_work_state.c_end_tm      );

    /*  INSERT INTO PUBO_WORK_STATE VALUES (:pubo_work_state); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[12];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 12;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO PUBO_WORK_STATE VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubo_work_state.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(pubo_work_state);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubo_work_state.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubo_work_state.c_work_date);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(pubo_work_state);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 8+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubo_work_state.c_work_date);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(pubo_work_state.c_work_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(pubo_work_state);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 4+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(pubo_work_state.c_work_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(pubo_work_state.c_lane_type);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(pubo_work_state);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 2+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(pubo_work_state.c_lane_type);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)(pubo_work_state.c_workr_no);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isstruct = 1;
    ulpSqlstmt.hostvalue[4].structsize = sizeof(pubo_work_state);
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 6;
    ulpSqlstmt.hostvalue[4].mSizeof = 0;
    ulpSqlstmt.hostvalue[4].mLen = 6+1;
    ulpSqlstmt.hostvalue[4].mMaxlen = sizeof(pubo_work_state.c_workr_no);
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(pubo_work_state.c_strt_date_tm);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isstruct = 1;
    ulpSqlstmt.hostvalue[5].structsize = sizeof(pubo_work_state);
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 14+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(pubo_work_state.c_strt_date_tm);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(pubo_work_state.c_end_tm);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isstruct = 1;
    ulpSqlstmt.hostvalue[6].structsize = sizeof(pubo_work_state);
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 14+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(pubo_work_state.c_end_tm);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)(pubo_work_state.c_end_type);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isstruct = 1;
    ulpSqlstmt.hostvalue[7].structsize = sizeof(pubo_work_state);
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 6;
    ulpSqlstmt.hostvalue[7].mSizeof = 0;
    ulpSqlstmt.hostvalue[7].mLen = 1+1;
    ulpSqlstmt.hostvalue[7].mMaxlen = sizeof(pubo_work_state.c_end_type);
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)&(pubo_work_state.n_strt_trnm_seq);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isstruct = 1;
    ulpSqlstmt.hostvalue[8].structsize = sizeof(pubo_work_state);
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 2;
    ulpSqlstmt.hostvalue[8].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[8].mLen = 0;
    ulpSqlstmt.hostvalue[8].mMaxlen = 0;
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[9].mHostVar = (void*)&(pubo_work_state.n_end_trnm_seq);
    ulpSqlstmt.hostvalue[9].mHostInd = NULL;
    ulpSqlstmt.hostvalue[9].isstruct = 1;
    ulpSqlstmt.hostvalue[9].structsize = sizeof(pubo_work_state);
    ulpSqlstmt.hostvalue[9].isarr = 0;
    ulpSqlstmt.hostvalue[9].mType = 2;
    ulpSqlstmt.hostvalue[9].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[9].mLen = 0;
    ulpSqlstmt.hostvalue[9].mMaxlen = 0;
    ulpSqlstmt.hostvalue[9].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[9].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[9].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[10].mHostVar = (void*)(pubo_work_state.c_work_type);
    ulpSqlstmt.hostvalue[10].mHostInd = NULL;
    ulpSqlstmt.hostvalue[10].isstruct = 1;
    ulpSqlstmt.hostvalue[10].structsize = sizeof(pubo_work_state);
    ulpSqlstmt.hostvalue[10].isarr = 0;
    ulpSqlstmt.hostvalue[10].mType = 6;
    ulpSqlstmt.hostvalue[10].mSizeof = 0;
    ulpSqlstmt.hostvalue[10].mLen = 1+1;
    ulpSqlstmt.hostvalue[10].mMaxlen = sizeof(pubo_work_state.c_work_type);
    ulpSqlstmt.hostvalue[10].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[10].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[10].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[11].mHostVar = (void*)(pubo_work_state.c_work_end_stat);
    ulpSqlstmt.hostvalue[11].mHostInd = NULL;
    ulpSqlstmt.hostvalue[11].isstruct = 1;
    ulpSqlstmt.hostvalue[11].structsize = sizeof(pubo_work_state);
    ulpSqlstmt.hostvalue[11].isarr = 0;
    ulpSqlstmt.hostvalue[11].mType = 6;
    ulpSqlstmt.hostvalue[11].mSizeof = 0;
    ulpSqlstmt.hostvalue[11].mLen = 1+1;
    ulpSqlstmt.hostvalue[11].mMaxlen = sizeof(pubo_work_state.c_work_end_stat);
    ulpSqlstmt.hostvalue[11].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[11].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[11].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("PUBO_WORK_STATE [%02x] INSERT FAIL", hi_comm_ctrl.write_info.knd);
        hi_comm_ctrl.write_info.return_code = HNDSTAT(J_DATA,S_TBL_ERR);
        return(-1);
    }

    printf( "근무개시 완료 [%d] \n", SQLCODE );
    return 0;    //근무 개시 0
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_outwrk_end()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 근무 출구 종료 처리
 *
 *========================================================================
*/

int proc_outwrk_end(char *target)
{
    struct rcv_lane_data  *rd;
    struct  hi_out_way_wrk_end *pk_in;
    int     iCrjb;
    int     start_sno;
    int     end_sno;


    struct  pubo_work_state    pubo_work_state;
    struct  pubo_out_way_work_end    pubo_out_way_work_end;


    memset((char *)&pubo_work_state, 0, sizeof(pubo_work_state));

    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_out_way_wrk_end *)rd->buf;
    start_sno = lb_data2atoi((char *)rd->st_snd_no, 8);
    end_sno = lb_data2atoi((char *)pk_in->seq_no, 8);

    /* 현근무상태 Check     */
    iCrjb   = chk_wrk_endhnd_yn(rd);

    if(iCrjb != 1)
    {
        printf( " chk_wrk_endhnd_yn [%d] \n", iCrjb );
        return(-1);
    }

    e_memcpy(pubo_work_state.c_plz_id,    rd->plz_id);
    e_memcpy(pubo_work_state.c_work_date, pk_in->wrk_date);
    e_memcpy(pubo_work_state.c_work_no,   pk_in->wrk_no);
    e_memcpy(pubo_work_state.c_workr_no,  "999999");

    sprintf((char *)pubo_work_state.c_strt_date_tm, "%.4s%.2s%.2s%.2s%.2s%.2s",
            pk_in->wrk_start_year, pk_in->wrk_start_month, pk_in->wrk_start_day,
            pk_in->wrk_start_hour, pk_in->wrk_start_min, pk_in->wrk_start_sec);
    sprintf((char *)pubo_work_state.c_end_tm, "%.4s%.2s%.2s%.2s%.2s%.2s",
            pk_in->wrk_end_year, pk_in->wrk_end_month, pk_in->wrk_end_day,
            pk_in->wrk_end_hour, pk_in->wrk_end_min, pk_in->wrk_end_sec);

    pubo_work_state.n_strt_trnm_seq = start_sno;
    pubo_work_state.n_end_trnm_seq =  end_sno;

    e_memcpy(pubo_out_way_work_end.c_plz_id,       rd->plz_id);
    e_memcpy(pubo_out_way_work_end.c_work_date,    pk_in->wrk_date);
    e_memcpy(pubo_out_way_work_end.c_work_no,      pk_in->wrk_no);
    sprintf((char *)pubo_out_way_work_end.c_work_strt_tm, "%.4s%.2s%.2s%.2s%.2s%.2s",
            pk_in->wrk_start_year, pk_in->wrk_start_month, pk_in->wrk_start_day,
            pk_in->wrk_start_hour, pk_in->wrk_start_min, pk_in->wrk_start_sec);
    sprintf((char *)pubo_out_way_work_end.c_work_end_tm, "%.4s%.2s%.2s%.2s%.2s%.2s",
            pk_in->wrk_end_year, pk_in->wrk_end_month, pk_in->wrk_end_day,
            pk_in->wrk_end_hour, pk_in->wrk_end_min, pk_in->wrk_end_sec);

    pubo_out_way_work_end.n_prcs_cnt =   lb_data2atoi((char *)pk_in->car_hnd_cnt, 8);
    pubo_out_way_work_end.n_forwd_cnt =  lb_data2atoi((char *)pk_in->car_adv_cnt, 8);
    pubo_out_way_work_end.n_backwd_cnt = lb_data2atoi((char *)pk_in->car_rev_cnt, 8);

    /*  INSERT INTO PUBO_OUT_WAY_WORK_END VALUES (:pubo_out_way_work_end); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[8];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 8;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO PUBO_OUT_WAY_WORK_END VALUES (? , ? , ? , ? , ? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubo_out_way_work_end.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(pubo_out_way_work_end);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubo_out_way_work_end.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubo_out_way_work_end.c_work_date);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(pubo_out_way_work_end);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 8+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubo_out_way_work_end.c_work_date);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(pubo_out_way_work_end.c_work_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(pubo_out_way_work_end);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 4+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(pubo_out_way_work_end.c_work_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(pubo_out_way_work_end.c_work_strt_tm);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(pubo_out_way_work_end);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 14+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(pubo_out_way_work_end.c_work_strt_tm);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)(pubo_out_way_work_end.c_work_end_tm);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isstruct = 1;
    ulpSqlstmt.hostvalue[4].structsize = sizeof(pubo_out_way_work_end);
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 6;
    ulpSqlstmt.hostvalue[4].mSizeof = 0;
    ulpSqlstmt.hostvalue[4].mLen = 14+1;
    ulpSqlstmt.hostvalue[4].mMaxlen = sizeof(pubo_out_way_work_end.c_work_end_tm);
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)&(pubo_out_way_work_end.n_prcs_cnt);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isstruct = 1;
    ulpSqlstmt.hostvalue[5].structsize = sizeof(pubo_out_way_work_end);
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 2;
    ulpSqlstmt.hostvalue[5].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[5].mLen = 0;
    ulpSqlstmt.hostvalue[5].mMaxlen = 0;
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)&(pubo_out_way_work_end.n_forwd_cnt);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isstruct = 1;
    ulpSqlstmt.hostvalue[6].structsize = sizeof(pubo_out_way_work_end);
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 2;
    ulpSqlstmt.hostvalue[6].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[6].mLen = 0;
    ulpSqlstmt.hostvalue[6].mMaxlen = 0;
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)&(pubo_out_way_work_end.n_backwd_cnt);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isstruct = 1;
    ulpSqlstmt.hostvalue[7].structsize = sizeof(pubo_out_way_work_end);
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 2;
    ulpSqlstmt.hostvalue[7].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[7].mLen = 0;
    ulpSqlstmt.hostvalue[7].mMaxlen = 0;
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE == -1)
    {
        /*  UPDATE PUBO_OUT_WAY_WORK_END 
                    SET WORK_STRT_TM = :pubo_out_way_work_end.c_work_strt_tm 
                      , WORK_END_TM =  :pubo_out_way_work_end.c_work_end_tm 
                      , PRCS_CNT =     :pubo_out_way_work_end.n_prcs_cnt 
                      , FORWD_CNT =    :pubo_out_way_work_end.n_forwd_cnt 
                      , BACKWD_CNT =   :pubo_out_way_work_end.n_backwd_cnt 
                  WHERE PLZ_ID =       :pubo_out_way_work_end.c_plz_id 
                    AND WORK_DATE =    :pubo_out_way_work_end.c_work_date 
                    AND WORK_NO =      :pubo_out_way_work_end.c_work_no; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[8];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 8;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"UPDATE PUBO_OUT_WAY_WORK_END "
"                    SET WORK_STRT_TM = ?  "
"                      , WORK_END_TM =  ?  "
"                      , PRCS_CNT =     ?  "
"                      , FORWD_CNT =    ?  "
"                      , BACKWD_CNT =   ?  "
"                  WHERE PLZ_ID =       ?  "
"                    AND WORK_DATE =    ?  "
"                    AND WORK_NO =      ? ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubo_out_way_work_end.c_work_strt_tm);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 14+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubo_out_way_work_end.c_work_strt_tm);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubo_out_way_work_end.c_work_end_tm);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 14+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubo_out_way_work_end.c_work_end_tm);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)&(pubo_out_way_work_end.n_prcs_cnt);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 2;
    ulpSqlstmt.hostvalue[2].isstruct = 0;
    ulpSqlstmt.hostvalue[2].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[2].mLen = 0;
    ulpSqlstmt.hostvalue[2].mMaxlen = 0;
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)&(pubo_out_way_work_end.n_forwd_cnt);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 2;
    ulpSqlstmt.hostvalue[3].isstruct = 0;
    ulpSqlstmt.hostvalue[3].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[3].mLen = 0;
    ulpSqlstmt.hostvalue[3].mMaxlen = 0;
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)&(pubo_out_way_work_end.n_backwd_cnt);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 2;
    ulpSqlstmt.hostvalue[4].isstruct = 0;
    ulpSqlstmt.hostvalue[4].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[4].mLen = 0;
    ulpSqlstmt.hostvalue[4].mMaxlen = 0;
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(pubo_out_way_work_end.c_plz_id);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].isstruct = 0;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 6+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(pubo_out_way_work_end.c_plz_id);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(pubo_out_way_work_end.c_work_date);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].isstruct = 0;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 8+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(pubo_out_way_work_end.c_work_date);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)(pubo_out_way_work_end.c_work_no);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 6;
    ulpSqlstmt.hostvalue[7].isstruct = 0;
    ulpSqlstmt.hostvalue[7].mSizeof = 0;
    ulpSqlstmt.hostvalue[7].mLen = 4+1;
    ulpSqlstmt.hostvalue[7].mMaxlen = sizeof(pubo_out_way_work_end.c_work_no);
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}

    }

    if (SQLCODE < 0)
    {
        printf("PUBO_OUT_WAY_WORK_END [%02x] INSERT FAIL[%d]", hi_comm_ctrl.write_info.knd, SQLCODE);
        hi_comm_ctrl.write_info.return_code = HNDSTAT(J_DATA,S_TBL_ERR);
        return(-1);
    }

    /*  UPDATE PUBO_WORK_STATE 
                SET STRT_DATE_TM =  :pubo_work_state.c_strt_date_tm 
                  , END_TM =        :pubo_work_state.c_end_tm 
                  , END_TYPE =      '1' 
                  , STRT_TRNM_SEQ = :pubo_work_state.n_strt_trnm_seq 
                  , END_TRNM_SEQ =  :pubo_work_state.n_end_trnm_seq 
                  , WORK_END_STAT = '3' 
              WHERE PLZ_ID =        :pubo_work_state.c_plz_id 
                AND WORK_DATE =     :pubo_work_state.c_work_date 
                AND WORK_NO =       :pubo_work_state.c_work_no; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[7];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 7;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"UPDATE PUBO_WORK_STATE "
"                SET STRT_DATE_TM =  ?  "
"                  , END_TM =        ?  "
"                  , END_TYPE =      '1' "
"                  , STRT_TRNM_SEQ = ?  "
"                  , END_TRNM_SEQ =  ?  "
"                  , WORK_END_STAT = '3' "
"              WHERE PLZ_ID =        ?  "
"                AND WORK_DATE =     ?  "
"                AND WORK_NO =       ? ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubo_work_state.c_strt_date_tm);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 14+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubo_work_state.c_strt_date_tm);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubo_work_state.c_end_tm);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 14+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubo_work_state.c_end_tm);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)&(pubo_work_state.n_strt_trnm_seq);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 2;
    ulpSqlstmt.hostvalue[2].isstruct = 0;
    ulpSqlstmt.hostvalue[2].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[2].mLen = 0;
    ulpSqlstmt.hostvalue[2].mMaxlen = 0;
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)&(pubo_work_state.n_end_trnm_seq);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 2;
    ulpSqlstmt.hostvalue[3].isstruct = 0;
    ulpSqlstmt.hostvalue[3].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[3].mLen = 0;
    ulpSqlstmt.hostvalue[3].mMaxlen = 0;
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)(pubo_work_state.c_plz_id);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 6;
    ulpSqlstmt.hostvalue[4].isstruct = 0;
    ulpSqlstmt.hostvalue[4].mSizeof = 0;
    ulpSqlstmt.hostvalue[4].mLen = 6+1;
    ulpSqlstmt.hostvalue[4].mMaxlen = sizeof(pubo_work_state.c_plz_id);
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(pubo_work_state.c_work_date);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].isstruct = 0;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 8+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(pubo_work_state.c_work_date);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(pubo_work_state.c_work_no);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].isstruct = 0;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 4+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(pubo_work_state.c_work_no);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        hi_comm_ctrl.write_info.return_code = HNDSTAT(J_DATA,S_TBL_ERR);
        return(-1);
    }
    printf("근무종료 [%02x] 처리완료", hi_comm_ctrl.write_info.knd);

    return 0;
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_inwrk_end()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 근무 입구 종료 처리
 *
 *========================================================================
*/

int proc_inwrk_end(char *target)
{
    struct rcv_lane_data  *rd;
    struct  hi_in_way_wrk_end  *pk_in;
    int     iCrjb;
    int     start_sno;
    int     end_sno;


    struct  pubo_work_state    pubo_work_state;
    struct  pubo_in_way_work_end    pubo_in_way_work_end;


    memset((char *)&pubo_work_state, 0, sizeof(pubo_work_state));

    rd = (struct rcv_lane_data *)target;
    start_sno = lb_data2atoi((char *)rd->st_snd_no, 8);
    end_sno = lb_data2atoi((char *)rd->ed_snd_no, 8);

    /* 현근무상태 Check     */
    iCrjb   = chk_wrk_endhnd_yn(rd);
    if(iCrjb != 1)
    {
        printf( " chk_wrk_endhnd_yn [%d] \n", iCrjb );
        return(-1);
    }

    pk_in = (struct hi_in_way_wrk_end *)rd->buf;

    e_memcpy(pubo_work_state.c_plz_id,    rd->plz_id);
    e_memcpy(pubo_work_state.c_work_date, pk_in->wrk_date);
    e_memcpy(pubo_work_state.c_work_no,   pk_in->wrk_no);
    e_memcpy(pubo_work_state.c_workr_no,  pk_in->wrkr_no);

    sprintf((char *)pubo_work_state.c_strt_date_tm,   "%.4s%.2s%.2s%.2s%.2s%.2s",
            pk_in->wrk_start_year, pk_in->wrk_start_month, pk_in->wrk_start_day,
            pk_in->wrk_start_hour, pk_in->wrk_start_min,   pk_in->wrk_start_sec);
    sprintf((char *)pubo_work_state.c_end_tm,         "%.4s%.2s%.2s%.2s%.2s%.2s",
            pk_in->wrk_end_year,   pk_in->wrk_end_month,   pk_in->wrk_end_day,
            pk_in->wrk_end_hour,   pk_in->wrk_end_min,     pk_in->wrk_end_sec);

    pubo_work_state.n_strt_trnm_seq = start_sno;
    pubo_work_state.n_end_trnm_seq =  end_sno;

    e_memcpy(pubo_in_way_work_end.c_plz_id,       rd->plz_id );
    e_memcpy(pubo_in_way_work_end.c_work_date,    pk_in->wrk_date );
    e_memcpy(pubo_in_way_work_end.c_work_no,      pk_in->wrk_no );
    e_memcpy(pubo_in_way_work_end.c_workr_no,     pk_in->wrkr_no );
    sprintf((char *)pubo_in_way_work_end.c_work_strt_tm,   "%.4s%.2s%.2s%.2s%.2s%.2s",
            pk_in->wrk_start_year, pk_in->wrk_start_month, pk_in->wrk_start_day,
            pk_in->wrk_start_hour, pk_in->wrk_start_min,   pk_in->wrk_start_sec);
    sprintf((char *)pubo_in_way_work_end.c_work_end_tm,  "%.4s%.2s%.2s%.2s%.2s%.2s",
            pk_in->wrk_end_year,   pk_in->wrk_end_month,   pk_in->wrk_end_day,
            pk_in->wrk_end_hour,   pk_in->wrk_end_min,     pk_in->wrk_end_sec);

    pubo_in_way_work_end.n_prcs_cnt =             lb_data2atoi((char *)pk_in->hnd_cnt      , 8);
    pubo_in_way_work_end.n_forwd_cnt =            lb_data2atoi((char *)pk_in->car_adv_cnt  , 8);
    pubo_in_way_work_end.n_backwd_cnt =           lb_data2atoi((char *)pk_in->car_rev_cnt  , 8);
    pubo_in_way_work_end.n_vhcl_grnd_forwd_cnt =  lb_data2atoi((char *)pk_in->adv_axle_code, 4);
    pubo_in_way_work_end.n_vhcl_grnd_backwd_cnt = lb_data2atoi((char *)pk_in->rev_axle_code, 4);

    /*  INSERT INTO PUBO_IN_WAY_WORK_END VALUES (:pubo_in_way_work_end); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[11];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 11;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO PUBO_IN_WAY_WORK_END VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubo_in_way_work_end.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(pubo_in_way_work_end);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubo_in_way_work_end.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubo_in_way_work_end.c_work_date);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(pubo_in_way_work_end);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 8+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubo_in_way_work_end.c_work_date);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(pubo_in_way_work_end.c_work_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(pubo_in_way_work_end);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 4+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(pubo_in_way_work_end.c_work_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(pubo_in_way_work_end.c_workr_no);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(pubo_in_way_work_end);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 6+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(pubo_in_way_work_end.c_workr_no);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)(pubo_in_way_work_end.c_work_strt_tm);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isstruct = 1;
    ulpSqlstmt.hostvalue[4].structsize = sizeof(pubo_in_way_work_end);
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 6;
    ulpSqlstmt.hostvalue[4].mSizeof = 0;
    ulpSqlstmt.hostvalue[4].mLen = 14+1;
    ulpSqlstmt.hostvalue[4].mMaxlen = sizeof(pubo_in_way_work_end.c_work_strt_tm);
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(pubo_in_way_work_end.c_work_end_tm);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isstruct = 1;
    ulpSqlstmt.hostvalue[5].structsize = sizeof(pubo_in_way_work_end);
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 14+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(pubo_in_way_work_end.c_work_end_tm);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)&(pubo_in_way_work_end.n_prcs_cnt);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isstruct = 1;
    ulpSqlstmt.hostvalue[6].structsize = sizeof(pubo_in_way_work_end);
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 2;
    ulpSqlstmt.hostvalue[6].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[6].mLen = 0;
    ulpSqlstmt.hostvalue[6].mMaxlen = 0;
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)&(pubo_in_way_work_end.n_forwd_cnt);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isstruct = 1;
    ulpSqlstmt.hostvalue[7].structsize = sizeof(pubo_in_way_work_end);
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 2;
    ulpSqlstmt.hostvalue[7].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[7].mLen = 0;
    ulpSqlstmt.hostvalue[7].mMaxlen = 0;
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)&(pubo_in_way_work_end.n_backwd_cnt);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isstruct = 1;
    ulpSqlstmt.hostvalue[8].structsize = sizeof(pubo_in_way_work_end);
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 2;
    ulpSqlstmt.hostvalue[8].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[8].mLen = 0;
    ulpSqlstmt.hostvalue[8].mMaxlen = 0;
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[9].mHostVar = (void*)&(pubo_in_way_work_end.n_vhcl_grnd_forwd_cnt);
    ulpSqlstmt.hostvalue[9].mHostInd = NULL;
    ulpSqlstmt.hostvalue[9].isstruct = 1;
    ulpSqlstmt.hostvalue[9].structsize = sizeof(pubo_in_way_work_end);
    ulpSqlstmt.hostvalue[9].isarr = 0;
    ulpSqlstmt.hostvalue[9].mType = 2;
    ulpSqlstmt.hostvalue[9].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[9].mLen = 0;
    ulpSqlstmt.hostvalue[9].mMaxlen = 0;
    ulpSqlstmt.hostvalue[9].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[9].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[9].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[10].mHostVar = (void*)&(pubo_in_way_work_end.n_vhcl_grnd_backwd_cnt);
    ulpSqlstmt.hostvalue[10].mHostInd = NULL;
    ulpSqlstmt.hostvalue[10].isstruct = 1;
    ulpSqlstmt.hostvalue[10].structsize = sizeof(pubo_in_way_work_end);
    ulpSqlstmt.hostvalue[10].isarr = 0;
    ulpSqlstmt.hostvalue[10].mType = 2;
    ulpSqlstmt.hostvalue[10].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[10].mLen = 0;
    ulpSqlstmt.hostvalue[10].mMaxlen = 0;
    ulpSqlstmt.hostvalue[10].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[10].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[10].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE == -1)
    {
        /*  UPDATE PUBO_IN_WAY_WORK_END 
                    SET WORK_STRT_TM =         :pubo_in_way_work_end.c_work_strt_tm 
                      , WORK_END_TM =          :pubo_in_way_work_end.c_work_end_tm 
                      , PRCS_CNT =             :pubo_in_way_work_end.n_prcs_cnt 
                      , FORWD_CNT =            :pubo_in_way_work_end.n_forwd_cnt 
                      , BACKWD_CNT =           :pubo_in_way_work_end.n_backwd_cnt 
                      , VHCL_GRND_FORWD_CNT =  :pubo_in_way_work_end.n_vhcl_grnd_forwd_cnt 
                      , VHCL_GRND_BACKWD_CNT = :pubo_in_way_work_end.n_vhcl_grnd_backwd_cnt 
                  WHERE PLZ_ID =               :pubo_in_way_work_end.c_plz_id 
                    AND WORK_DATE =            :pubo_in_way_work_end.c_work_date 
                    AND WORK_NO =              :pubo_in_way_work_end.c_work_no; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[10];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 10;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"UPDATE PUBO_IN_WAY_WORK_END "
"                    SET WORK_STRT_TM =         ?  "
"                      , WORK_END_TM =          ?  "
"                      , PRCS_CNT =             ?  "
"                      , FORWD_CNT =            ?  "
"                      , BACKWD_CNT =           ?  "
"                      , VHCL_GRND_FORWD_CNT =  ?  "
"                      , VHCL_GRND_BACKWD_CNT = ?  "
"                  WHERE PLZ_ID =               ?  "
"                    AND WORK_DATE =            ?  "
"                    AND WORK_NO =              ? ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubo_in_way_work_end.c_work_strt_tm);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 14+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubo_in_way_work_end.c_work_strt_tm);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubo_in_way_work_end.c_work_end_tm);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 14+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubo_in_way_work_end.c_work_end_tm);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)&(pubo_in_way_work_end.n_prcs_cnt);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 2;
    ulpSqlstmt.hostvalue[2].isstruct = 0;
    ulpSqlstmt.hostvalue[2].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[2].mLen = 0;
    ulpSqlstmt.hostvalue[2].mMaxlen = 0;
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)&(pubo_in_way_work_end.n_forwd_cnt);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 2;
    ulpSqlstmt.hostvalue[3].isstruct = 0;
    ulpSqlstmt.hostvalue[3].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[3].mLen = 0;
    ulpSqlstmt.hostvalue[3].mMaxlen = 0;
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)&(pubo_in_way_work_end.n_backwd_cnt);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 2;
    ulpSqlstmt.hostvalue[4].isstruct = 0;
    ulpSqlstmt.hostvalue[4].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[4].mLen = 0;
    ulpSqlstmt.hostvalue[4].mMaxlen = 0;
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)&(pubo_in_way_work_end.n_vhcl_grnd_forwd_cnt);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 2;
    ulpSqlstmt.hostvalue[5].isstruct = 0;
    ulpSqlstmt.hostvalue[5].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[5].mLen = 0;
    ulpSqlstmt.hostvalue[5].mMaxlen = 0;
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)&(pubo_in_way_work_end.n_vhcl_grnd_backwd_cnt);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 2;
    ulpSqlstmt.hostvalue[6].isstruct = 0;
    ulpSqlstmt.hostvalue[6].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[6].mLen = 0;
    ulpSqlstmt.hostvalue[6].mMaxlen = 0;
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)(pubo_in_way_work_end.c_plz_id);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 6;
    ulpSqlstmt.hostvalue[7].isstruct = 0;
    ulpSqlstmt.hostvalue[7].mSizeof = 0;
    ulpSqlstmt.hostvalue[7].mLen = 6+1;
    ulpSqlstmt.hostvalue[7].mMaxlen = sizeof(pubo_in_way_work_end.c_plz_id);
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)(pubo_in_way_work_end.c_work_date);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 6;
    ulpSqlstmt.hostvalue[8].isstruct = 0;
    ulpSqlstmt.hostvalue[8].mSizeof = 0;
    ulpSqlstmt.hostvalue[8].mLen = 8+1;
    ulpSqlstmt.hostvalue[8].mMaxlen = sizeof(pubo_in_way_work_end.c_work_date);
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[9].mHostVar = (void*)(pubo_in_way_work_end.c_work_no);
    ulpSqlstmt.hostvalue[9].mHostInd = NULL;
    ulpSqlstmt.hostvalue[9].isarr = 0;
    ulpSqlstmt.hostvalue[9].mType = 6;
    ulpSqlstmt.hostvalue[9].isstruct = 0;
    ulpSqlstmt.hostvalue[9].mSizeof = 0;
    ulpSqlstmt.hostvalue[9].mLen = 4+1;
    ulpSqlstmt.hostvalue[9].mMaxlen = sizeof(pubo_in_way_work_end.c_work_no);
    ulpSqlstmt.hostvalue[9].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[9].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[9].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}

    }

    if (SQLCODE < 0)
    {
        printf("PUBO_IN_WAY_WORK_END [%02x] INSERT FAIL[%d]", hi_comm_ctrl.write_info.knd, SQLCODE);
        hi_comm_ctrl.write_info.return_code = HNDSTAT(J_DATA,S_TBL_ERR);
        return(-1);
    }

    /*  UPDATE PUBO_WORK_STATE 
                SET STRT_DATE_TM =  :pubo_work_state.c_strt_date_tm 
                  , END_TM =        :pubo_work_state.c_end_tm 
                  , END_TYPE =      '1' 
                  , STRT_TRNM_SEQ = :pubo_work_state.n_strt_trnm_seq 
                  , END_TRNM_SEQ =  :pubo_work_state.n_end_trnm_seq 
                  , WORK_END_STAT = '3' 
              WHERE PLZ_ID =        :pubo_work_state.c_plz_id 
                AND WORK_DATE =     :pubo_work_state.c_work_date 
                AND WORK_NO =       :pubo_work_state.c_work_no; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[7];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 7;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"UPDATE PUBO_WORK_STATE "
"                SET STRT_DATE_TM =  ?  "
"                  , END_TM =        ?  "
"                  , END_TYPE =      '1' "
"                  , STRT_TRNM_SEQ = ?  "
"                  , END_TRNM_SEQ =  ?  "
"                  , WORK_END_STAT = '3' "
"              WHERE PLZ_ID =        ?  "
"                AND WORK_DATE =     ?  "
"                AND WORK_NO =       ? ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubo_work_state.c_strt_date_tm);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 14+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubo_work_state.c_strt_date_tm);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubo_work_state.c_end_tm);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 14+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubo_work_state.c_end_tm);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)&(pubo_work_state.n_strt_trnm_seq);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 2;
    ulpSqlstmt.hostvalue[2].isstruct = 0;
    ulpSqlstmt.hostvalue[2].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[2].mLen = 0;
    ulpSqlstmt.hostvalue[2].mMaxlen = 0;
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)&(pubo_work_state.n_end_trnm_seq);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 2;
    ulpSqlstmt.hostvalue[3].isstruct = 0;
    ulpSqlstmt.hostvalue[3].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[3].mLen = 0;
    ulpSqlstmt.hostvalue[3].mMaxlen = 0;
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)(pubo_work_state.c_plz_id);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 6;
    ulpSqlstmt.hostvalue[4].isstruct = 0;
    ulpSqlstmt.hostvalue[4].mSizeof = 0;
    ulpSqlstmt.hostvalue[4].mLen = 6+1;
    ulpSqlstmt.hostvalue[4].mMaxlen = sizeof(pubo_work_state.c_plz_id);
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(pubo_work_state.c_work_date);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].isstruct = 0;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 8+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(pubo_work_state.c_work_date);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(pubo_work_state.c_work_no);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].isstruct = 0;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 4+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(pubo_work_state.c_work_no);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("PUBO_WORK_STATE [%02x] UPDATE FAIL[%d]", hi_comm_ctrl.write_info.knd, SQLCODE);
        hi_comm_ctrl.write_info.return_code = HNDSTAT(J_DATA,S_TBL_ERR);
        return(-1);
    }
    printf("근무종료 [%02x] 처리완료", hi_comm_ctrl.write_info.knd);

    return 0;    //근무 개시 0
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_out_way()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 출구처리 Data를 처리.
 *========================================================================
*/

int proc_out_way(char *target)
{
    struct rcv_lane_data  *rd;
    struct    hi_out_way_hnd_data   *pk_in;

    struct    pubo_out_way_prcs  pubo_out_way_prcs;


    memset((char *)&pubo_out_way_prcs, 0, sizeof(pubo_out_way_prcs));
    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_out_way_hnd_data *)rd->buf;

    e_memcpy(pubo_out_way_prcs.c_plz_id,    rd->plz_id);
    e_memcpy(pubo_out_way_prcs.c_work_date, pk_in->wrk_date);
    e_memcpy(pubo_out_way_prcs.c_work_no,   pk_in->wrk_no);

    pubo_out_way_prcs.d_trnm_seq = lb_data2atoi((char *)pk_in->seq_no, 8);
    pubo_out_way_prcs.d_prcs_seq = lb_data2atoi((char *)pk_in->serial_no, 8);

    e_memcpy(pubo_out_way_prcs.c_lane_type, pk_in->lane_div);

    pubo_out_way_prcs.d_etcs_prcs_seq = lb_data2atoi((char *)pk_in->etc_hnd_seq_no, 8);

    sprintf((char *)pubo_out_way_prcs.c_in_way_prcs_date_tm, "%.4s%.2s%.2s%.2s%.2s%.2s",
            pk_in->in_way_hnd_info.hnd_year, pk_in->in_way_hnd_info.hnd_month, pk_in->in_way_hnd_info.hnd_day,
            pk_in->in_way_hnd_info.hnd_hour, pk_in->in_way_hnd_info.hnd_min,   pk_in->in_way_hnd_info.hnd_sec);

    if(strncmp((const char *)pk_in->in_way_hnd_info.plz_id, "000000", 6) == 0)
        sprintf((char *)pubo_out_way_prcs.c_in_way_plz_id, "999998");
    else
        e_memcpy(pubo_out_way_prcs.c_in_way_plz_id,    pk_in->in_way_hnd_info.plz_id);

    e_memcpy(pubo_out_way_prcs.c_in_way_work_date, pk_in->in_way_hnd_info.wrk_date);
    e_memcpy(pubo_out_way_prcs.c_in_way_work_no,   pk_in->in_way_hnd_info.wrk_no);

    pubo_out_way_prcs.d_in_way_prcs_seq = lb_data2atoi((char *)pk_in->in_way_hnd_info.seq_no, 8);
    sprintf((char *)pubo_out_way_prcs.c_in_way_sens_vhcl_clss, "%c", pk_in->in_way_hnd_info.sense_vhcl_clss);
    sprintf((char *)pubo_out_way_prcs.c_in_way_prcs_vhcl_clss, "%c",  pk_in->in_way_hnd_info.hnd_vhcl_clss);

    sprintf((char *)pubo_out_way_prcs.c_prcs_date_tm, "%.4s%.2s%.2s%.2s%.2s%.2s",
            pk_in->hnd_info.hnd_year, pk_in->hnd_info.hnd_month, pk_in->hnd_info.hnd_day,
            pk_in->hnd_info.hnd_hour, pk_in->hnd_info.hnd_min,   pk_in->hnd_info.hnd_sec);

    e_memcpy(pubo_out_way_prcs.c_vio_cd, pk_in->hnd_info.vio_code);

    pubo_out_way_prcs.d_org_toll = lb_data2atoi((char *)pk_in->hnd_info.org_pass_fare, 8);
    pubo_out_way_prcs.d_toll = lb_data2atoi((char *)pk_in->hnd_info.pass_fare, 8);
    pubo_out_way_prcs.n_pymt_dc_rate = lb_data2atoi((char *)pk_in->hnd_info.pymt_dc_rate, 6);
    pubo_out_way_prcs.d_rcpt_toll = lb_data2atoi((char *)pk_in->hnd_info.rcpt_money, 8);
    pubo_out_way_prcs.d_rcpt_prev_balc = lb_data2atoi((char *)pk_in->hnd_info.rcpt_balc, 8);

    e_memcpy(pubo_out_way_prcs.c_rcpt_prcs_type,        pk_in->hnd_info.rcpt_hnd_yn);
    e_memcpy(pubo_out_way_prcs.c_rcpt_prcs_type_dtl_cd, pk_in->hnd_info.rcpt_hnd_yn_code);
    sprintf((char *)pubo_out_way_prcs.c_work_type, "%c", pk_in->hnd_info.wrk_div);
    sprintf((char *)pubo_out_way_prcs.c_sens_vhcl_clss, "%c", pk_in->hnd_info.sens_vhcl_clss);
    sprintf((char *)pubo_out_way_prcs.c_prcs_vhcl_clss, "%c", pk_in->hnd_info.hnd_vhcl_clss);
    e_memcpy(pubo_out_way_prcs.c_img_vhcl_no,           pk_in->hnd_info.pctr_vhcl_no);
    sprintf((char *)pubo_out_way_prcs.c_rcpt_type, "%c", pk_in->hnd_info.rcpt_div);
    sprintf((char *)pubo_out_way_prcs.c_online_type, "%c", pk_in->hnd_info.online_div[1]);

    pubo_out_way_prcs.d_sens_seq = lb_data2atoi((char *)pk_in->sense_data_seq_no, 8);

    e_memcpy(pubo_out_way_prcs.c_tag_id                      , pk_in->tag_id           );
    e_memcpy(pubo_out_way_prcs.c_iss_comp_cd                 , pk_in->tag_iss          );
    sprintf((char *)pubo_out_way_prcs.c_rcpt_type,               "%c",pk_in->hnd_info.rcpt_div);
    sprintf((char *)pubo_out_way_prcs.c_iss_comp_cd_consns_yn,   "%c",pk_in->tag_iss_yn       );
    sprintf((char *)pubo_out_way_prcs.c_tag_vhcl_clss,           "%c",pk_in->tag_vhcl_clss    );
    sprintf((char *)pubo_out_way_prcs.c_tag_vhcl_clss_consns_yn, "%c",pk_in->tag_vhcl_clss_yn );
    sprintf((char *)pubo_out_way_prcs.c_tag_atrb,                "%c",pk_in->tag_atrb         );
    sprintf((char *)pubo_out_way_prcs.c_tag_atrb_consns_yn,      "%c",pk_in->tag_atrb_yn      );
    e_memcpy(pubo_out_way_prcs.c_tag_vhcl_no                 ,pk_in->tag_vhcl_no      );
    sprintf((char *)pubo_out_way_prcs.c_tag_vhcl_no_consns_yn,   "%c",pk_in->tag_vhcl_no_yn   );
    e_memcpy(pubo_out_way_prcs.c_vald_term                   ,pk_in->tag_vald_term    );
    sprintf((char *)pubo_out_way_prcs.c_tag_vald_term_yn,        "%c",pk_in->tag_vald_term_yn );
    e_memcpy(pubo_out_way_prcs.c_tag_crc                ,     pk_in->tag_crc          );
    sprintf((char *)pubo_out_way_prcs.c_tag_crc_consns_yn,       "%c",pk_in->tag_crc_yn       );
    e_memcpy(pubo_out_way_prcs.c_tag_sgnt                    ,pk_in->tag_sgnt_val     );
    sprintf((char *)pubo_out_way_prcs.c_many_tag_yn,             "%c",pk_in->many_tag_div     );

    /*  INSERT INTO PUBO_OUT_WAY_PRCS VALUES (:pubo_out_way_prcs); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[52];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 52;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO PUBO_OUT_WAY_PRCS VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubo_out_way_prcs.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubo_out_way_prcs.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubo_out_way_prcs.c_work_date);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 8+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubo_out_way_prcs.c_work_date);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(pubo_out_way_prcs.c_work_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 4+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(pubo_out_way_prcs.c_work_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)&(pubo_out_way_prcs.d_trnm_seq);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 2;
    ulpSqlstmt.hostvalue[3].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[3].mLen = 0;
    ulpSqlstmt.hostvalue[3].mMaxlen = 0;
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)&(pubo_out_way_prcs.d_prcs_seq);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isstruct = 1;
    ulpSqlstmt.hostvalue[4].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 2;
    ulpSqlstmt.hostvalue[4].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[4].mLen = 0;
    ulpSqlstmt.hostvalue[4].mMaxlen = 0;
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(pubo_out_way_prcs.c_lane_type);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isstruct = 1;
    ulpSqlstmt.hostvalue[5].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 2+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(pubo_out_way_prcs.c_lane_type);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)&(pubo_out_way_prcs.d_etcs_prcs_seq);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isstruct = 1;
    ulpSqlstmt.hostvalue[6].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 2;
    ulpSqlstmt.hostvalue[6].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[6].mLen = 0;
    ulpSqlstmt.hostvalue[6].mMaxlen = 0;
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)(pubo_out_way_prcs.c_in_way_prcs_date_tm);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isstruct = 1;
    ulpSqlstmt.hostvalue[7].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 6;
    ulpSqlstmt.hostvalue[7].mSizeof = 0;
    ulpSqlstmt.hostvalue[7].mLen = 14+1;
    ulpSqlstmt.hostvalue[7].mMaxlen = sizeof(pubo_out_way_prcs.c_in_way_prcs_date_tm);
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)(pubo_out_way_prcs.c_in_way_plz_id);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isstruct = 1;
    ulpSqlstmt.hostvalue[8].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 6;
    ulpSqlstmt.hostvalue[8].mSizeof = 0;
    ulpSqlstmt.hostvalue[8].mLen = 6+1;
    ulpSqlstmt.hostvalue[8].mMaxlen = sizeof(pubo_out_way_prcs.c_in_way_plz_id);
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[9].mHostVar = (void*)(pubo_out_way_prcs.c_in_way_work_date);
    ulpSqlstmt.hostvalue[9].mHostInd = NULL;
    ulpSqlstmt.hostvalue[9].isstruct = 1;
    ulpSqlstmt.hostvalue[9].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[9].isarr = 0;
    ulpSqlstmt.hostvalue[9].mType = 6;
    ulpSqlstmt.hostvalue[9].mSizeof = 0;
    ulpSqlstmt.hostvalue[9].mLen = 8+1;
    ulpSqlstmt.hostvalue[9].mMaxlen = sizeof(pubo_out_way_prcs.c_in_way_work_date);
    ulpSqlstmt.hostvalue[9].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[9].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[9].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[10].mHostVar = (void*)(pubo_out_way_prcs.c_in_way_work_no);
    ulpSqlstmt.hostvalue[10].mHostInd = NULL;
    ulpSqlstmt.hostvalue[10].isstruct = 1;
    ulpSqlstmt.hostvalue[10].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[10].isarr = 0;
    ulpSqlstmt.hostvalue[10].mType = 6;
    ulpSqlstmt.hostvalue[10].mSizeof = 0;
    ulpSqlstmt.hostvalue[10].mLen = 4+1;
    ulpSqlstmt.hostvalue[10].mMaxlen = sizeof(pubo_out_way_prcs.c_in_way_work_no);
    ulpSqlstmt.hostvalue[10].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[10].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[10].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[11].mHostVar = (void*)&(pubo_out_way_prcs.d_in_way_prcs_seq);
    ulpSqlstmt.hostvalue[11].mHostInd = NULL;
    ulpSqlstmt.hostvalue[11].isstruct = 1;
    ulpSqlstmt.hostvalue[11].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[11].isarr = 0;
    ulpSqlstmt.hostvalue[11].mType = 2;
    ulpSqlstmt.hostvalue[11].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[11].mLen = 0;
    ulpSqlstmt.hostvalue[11].mMaxlen = 0;
    ulpSqlstmt.hostvalue[11].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[11].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[11].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[12].mHostVar = (void*)(pubo_out_way_prcs.c_in_way_sens_vhcl_clss);
    ulpSqlstmt.hostvalue[12].mHostInd = NULL;
    ulpSqlstmt.hostvalue[12].isstruct = 1;
    ulpSqlstmt.hostvalue[12].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[12].isarr = 0;
    ulpSqlstmt.hostvalue[12].mType = 6;
    ulpSqlstmt.hostvalue[12].mSizeof = 0;
    ulpSqlstmt.hostvalue[12].mLen = 1+1;
    ulpSqlstmt.hostvalue[12].mMaxlen = sizeof(pubo_out_way_prcs.c_in_way_sens_vhcl_clss);
    ulpSqlstmt.hostvalue[12].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[12].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[12].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[13].mHostVar = (void*)(pubo_out_way_prcs.c_in_way_prcs_vhcl_clss);
    ulpSqlstmt.hostvalue[13].mHostInd = NULL;
    ulpSqlstmt.hostvalue[13].isstruct = 1;
    ulpSqlstmt.hostvalue[13].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[13].isarr = 0;
    ulpSqlstmt.hostvalue[13].mType = 6;
    ulpSqlstmt.hostvalue[13].mSizeof = 0;
    ulpSqlstmt.hostvalue[13].mLen = 1+1;
    ulpSqlstmt.hostvalue[13].mMaxlen = sizeof(pubo_out_way_prcs.c_in_way_prcs_vhcl_clss);
    ulpSqlstmt.hostvalue[13].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[13].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[13].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[14].mHostVar = (void*)(pubo_out_way_prcs.c_prcs_date_tm);
    ulpSqlstmt.hostvalue[14].mHostInd = NULL;
    ulpSqlstmt.hostvalue[14].isstruct = 1;
    ulpSqlstmt.hostvalue[14].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[14].isarr = 0;
    ulpSqlstmt.hostvalue[14].mType = 6;
    ulpSqlstmt.hostvalue[14].mSizeof = 0;
    ulpSqlstmt.hostvalue[14].mLen = 14+1;
    ulpSqlstmt.hostvalue[14].mMaxlen = sizeof(pubo_out_way_prcs.c_prcs_date_tm);
    ulpSqlstmt.hostvalue[14].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[14].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[14].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[15].mHostVar = (void*)(pubo_out_way_prcs.c_vio_cd);
    ulpSqlstmt.hostvalue[15].mHostInd = NULL;
    ulpSqlstmt.hostvalue[15].isstruct = 1;
    ulpSqlstmt.hostvalue[15].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[15].isarr = 0;
    ulpSqlstmt.hostvalue[15].mType = 6;
    ulpSqlstmt.hostvalue[15].mSizeof = 0;
    ulpSqlstmt.hostvalue[15].mLen = 2+1;
    ulpSqlstmt.hostvalue[15].mMaxlen = sizeof(pubo_out_way_prcs.c_vio_cd);
    ulpSqlstmt.hostvalue[15].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[15].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[15].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[16].mHostVar = (void*)&(pubo_out_way_prcs.d_org_toll);
    ulpSqlstmt.hostvalue[16].mHostInd = NULL;
    ulpSqlstmt.hostvalue[16].isstruct = 1;
    ulpSqlstmt.hostvalue[16].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[16].isarr = 0;
    ulpSqlstmt.hostvalue[16].mType = 2;
    ulpSqlstmt.hostvalue[16].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[16].mLen = 0;
    ulpSqlstmt.hostvalue[16].mMaxlen = 0;
    ulpSqlstmt.hostvalue[16].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[16].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[16].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[17].mHostVar = (void*)&(pubo_out_way_prcs.d_toll);
    ulpSqlstmt.hostvalue[17].mHostInd = NULL;
    ulpSqlstmt.hostvalue[17].isstruct = 1;
    ulpSqlstmt.hostvalue[17].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[17].isarr = 0;
    ulpSqlstmt.hostvalue[17].mType = 2;
    ulpSqlstmt.hostvalue[17].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[17].mLen = 0;
    ulpSqlstmt.hostvalue[17].mMaxlen = 0;
    ulpSqlstmt.hostvalue[17].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[17].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[17].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[18].mHostVar = (void*)&(pubo_out_way_prcs.n_pymt_dc_rate);
    ulpSqlstmt.hostvalue[18].mHostInd = NULL;
    ulpSqlstmt.hostvalue[18].isstruct = 1;
    ulpSqlstmt.hostvalue[18].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[18].isarr = 0;
    ulpSqlstmt.hostvalue[18].mType = 2;
    ulpSqlstmt.hostvalue[18].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[18].mLen = 0;
    ulpSqlstmt.hostvalue[18].mMaxlen = 0;
    ulpSqlstmt.hostvalue[18].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[18].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[18].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[19].mHostVar = (void*)&(pubo_out_way_prcs.d_rcpt_toll);
    ulpSqlstmt.hostvalue[19].mHostInd = NULL;
    ulpSqlstmt.hostvalue[19].isstruct = 1;
    ulpSqlstmt.hostvalue[19].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[19].isarr = 0;
    ulpSqlstmt.hostvalue[19].mType = 2;
    ulpSqlstmt.hostvalue[19].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[19].mLen = 0;
    ulpSqlstmt.hostvalue[19].mMaxlen = 0;
    ulpSqlstmt.hostvalue[19].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[19].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[19].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[20].mHostVar = (void*)&(pubo_out_way_prcs.d_rcpt_prev_balc);
    ulpSqlstmt.hostvalue[20].mHostInd = NULL;
    ulpSqlstmt.hostvalue[20].isstruct = 1;
    ulpSqlstmt.hostvalue[20].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[20].isarr = 0;
    ulpSqlstmt.hostvalue[20].mType = 2;
    ulpSqlstmt.hostvalue[20].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[20].mLen = 0;
    ulpSqlstmt.hostvalue[20].mMaxlen = 0;
    ulpSqlstmt.hostvalue[20].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[20].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[20].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[21].mHostVar = (void*)(pubo_out_way_prcs.c_rcpt_prcs_type);
    ulpSqlstmt.hostvalue[21].mHostInd = NULL;
    ulpSqlstmt.hostvalue[21].isstruct = 1;
    ulpSqlstmt.hostvalue[21].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[21].isarr = 0;
    ulpSqlstmt.hostvalue[21].mType = 6;
    ulpSqlstmt.hostvalue[21].mSizeof = 0;
    ulpSqlstmt.hostvalue[21].mLen = 2+1;
    ulpSqlstmt.hostvalue[21].mMaxlen = sizeof(pubo_out_way_prcs.c_rcpt_prcs_type);
    ulpSqlstmt.hostvalue[21].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[21].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[21].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[22].mHostVar = (void*)(pubo_out_way_prcs.c_rcpt_prcs_type_dtl_cd);
    ulpSqlstmt.hostvalue[22].mHostInd = NULL;
    ulpSqlstmt.hostvalue[22].isstruct = 1;
    ulpSqlstmt.hostvalue[22].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[22].isarr = 0;
    ulpSqlstmt.hostvalue[22].mType = 6;
    ulpSqlstmt.hostvalue[22].mSizeof = 0;
    ulpSqlstmt.hostvalue[22].mLen = 2+1;
    ulpSqlstmt.hostvalue[22].mMaxlen = sizeof(pubo_out_way_prcs.c_rcpt_prcs_type_dtl_cd);
    ulpSqlstmt.hostvalue[22].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[22].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[22].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[23].mHostVar = (void*)(pubo_out_way_prcs.c_work_type);
    ulpSqlstmt.hostvalue[23].mHostInd = NULL;
    ulpSqlstmt.hostvalue[23].isstruct = 1;
    ulpSqlstmt.hostvalue[23].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[23].isarr = 0;
    ulpSqlstmt.hostvalue[23].mType = 6;
    ulpSqlstmt.hostvalue[23].mSizeof = 0;
    ulpSqlstmt.hostvalue[23].mLen = 1+1;
    ulpSqlstmt.hostvalue[23].mMaxlen = sizeof(pubo_out_way_prcs.c_work_type);
    ulpSqlstmt.hostvalue[23].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[23].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[23].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[24].mHostVar = (void*)(pubo_out_way_prcs.c_sens_vhcl_clss);
    ulpSqlstmt.hostvalue[24].mHostInd = NULL;
    ulpSqlstmt.hostvalue[24].isstruct = 1;
    ulpSqlstmt.hostvalue[24].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[24].isarr = 0;
    ulpSqlstmt.hostvalue[24].mType = 6;
    ulpSqlstmt.hostvalue[24].mSizeof = 0;
    ulpSqlstmt.hostvalue[24].mLen = 1+1;
    ulpSqlstmt.hostvalue[24].mMaxlen = sizeof(pubo_out_way_prcs.c_sens_vhcl_clss);
    ulpSqlstmt.hostvalue[24].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[24].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[24].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[25].mHostVar = (void*)(pubo_out_way_prcs.c_prcs_vhcl_clss);
    ulpSqlstmt.hostvalue[25].mHostInd = NULL;
    ulpSqlstmt.hostvalue[25].isstruct = 1;
    ulpSqlstmt.hostvalue[25].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[25].isarr = 0;
    ulpSqlstmt.hostvalue[25].mType = 6;
    ulpSqlstmt.hostvalue[25].mSizeof = 0;
    ulpSqlstmt.hostvalue[25].mLen = 1+1;
    ulpSqlstmt.hostvalue[25].mMaxlen = sizeof(pubo_out_way_prcs.c_prcs_vhcl_clss);
    ulpSqlstmt.hostvalue[25].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[25].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[25].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[26].mHostVar = (void*)(pubo_out_way_prcs.c_img_vhcl_no);
    ulpSqlstmt.hostvalue[26].mHostInd = NULL;
    ulpSqlstmt.hostvalue[26].isstruct = 1;
    ulpSqlstmt.hostvalue[26].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[26].isarr = 0;
    ulpSqlstmt.hostvalue[26].mType = 6;
    ulpSqlstmt.hostvalue[26].mSizeof = 0;
    ulpSqlstmt.hostvalue[26].mLen = 24+1;
    ulpSqlstmt.hostvalue[26].mMaxlen = sizeof(pubo_out_way_prcs.c_img_vhcl_no);
    ulpSqlstmt.hostvalue[26].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[26].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[26].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[27].mHostVar = (void*)(pubo_out_way_prcs.c_rcpt_type);
    ulpSqlstmt.hostvalue[27].mHostInd = NULL;
    ulpSqlstmt.hostvalue[27].isstruct = 1;
    ulpSqlstmt.hostvalue[27].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[27].isarr = 0;
    ulpSqlstmt.hostvalue[27].mType = 6;
    ulpSqlstmt.hostvalue[27].mSizeof = 0;
    ulpSqlstmt.hostvalue[27].mLen = 1+1;
    ulpSqlstmt.hostvalue[27].mMaxlen = sizeof(pubo_out_way_prcs.c_rcpt_type);
    ulpSqlstmt.hostvalue[27].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[27].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[27].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[28].mHostVar = (void*)(pubo_out_way_prcs.c_online_type);
    ulpSqlstmt.hostvalue[28].mHostInd = NULL;
    ulpSqlstmt.hostvalue[28].isstruct = 1;
    ulpSqlstmt.hostvalue[28].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[28].isarr = 0;
    ulpSqlstmt.hostvalue[28].mType = 6;
    ulpSqlstmt.hostvalue[28].mSizeof = 0;
    ulpSqlstmt.hostvalue[28].mLen = 1+1;
    ulpSqlstmt.hostvalue[28].mMaxlen = sizeof(pubo_out_way_prcs.c_online_type);
    ulpSqlstmt.hostvalue[28].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[28].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[28].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[29].mHostVar = (void*)&(pubo_out_way_prcs.d_sens_seq);
    ulpSqlstmt.hostvalue[29].mHostInd = NULL;
    ulpSqlstmt.hostvalue[29].isstruct = 1;
    ulpSqlstmt.hostvalue[29].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[29].isarr = 0;
    ulpSqlstmt.hostvalue[29].mType = 2;
    ulpSqlstmt.hostvalue[29].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[29].mLen = 0;
    ulpSqlstmt.hostvalue[29].mMaxlen = 0;
    ulpSqlstmt.hostvalue[29].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[29].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[29].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[30].mHostVar = (void*)(pubo_out_way_prcs.c_tag_id);
    ulpSqlstmt.hostvalue[30].mHostInd = NULL;
    ulpSqlstmt.hostvalue[30].isstruct = 1;
    ulpSqlstmt.hostvalue[30].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[30].isarr = 0;
    ulpSqlstmt.hostvalue[30].mType = 6;
    ulpSqlstmt.hostvalue[30].mSizeof = 0;
    ulpSqlstmt.hostvalue[30].mLen = 24+1;
    ulpSqlstmt.hostvalue[30].mMaxlen = sizeof(pubo_out_way_prcs.c_tag_id);
    ulpSqlstmt.hostvalue[30].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[30].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[30].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[31].mHostVar = (void*)(pubo_out_way_prcs.c_iss_comp_cd);
    ulpSqlstmt.hostvalue[31].mHostInd = NULL;
    ulpSqlstmt.hostvalue[31].isstruct = 1;
    ulpSqlstmt.hostvalue[31].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[31].isarr = 0;
    ulpSqlstmt.hostvalue[31].mType = 6;
    ulpSqlstmt.hostvalue[31].mSizeof = 0;
    ulpSqlstmt.hostvalue[31].mLen = 2+1;
    ulpSqlstmt.hostvalue[31].mMaxlen = sizeof(pubo_out_way_prcs.c_iss_comp_cd);
    ulpSqlstmt.hostvalue[31].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[31].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[31].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[32].mHostVar = (void*)(pubo_out_way_prcs.c_iss_comp_cd_consns_yn);
    ulpSqlstmt.hostvalue[32].mHostInd = NULL;
    ulpSqlstmt.hostvalue[32].isstruct = 1;
    ulpSqlstmt.hostvalue[32].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[32].isarr = 0;
    ulpSqlstmt.hostvalue[32].mType = 6;
    ulpSqlstmt.hostvalue[32].mSizeof = 0;
    ulpSqlstmt.hostvalue[32].mLen = 1+1;
    ulpSqlstmt.hostvalue[32].mMaxlen = sizeof(pubo_out_way_prcs.c_iss_comp_cd_consns_yn);
    ulpSqlstmt.hostvalue[32].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[32].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[32].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[33].mHostVar = (void*)(pubo_out_way_prcs.c_tag_vhcl_clss);
    ulpSqlstmt.hostvalue[33].mHostInd = NULL;
    ulpSqlstmt.hostvalue[33].isstruct = 1;
    ulpSqlstmt.hostvalue[33].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[33].isarr = 0;
    ulpSqlstmt.hostvalue[33].mType = 6;
    ulpSqlstmt.hostvalue[33].mSizeof = 0;
    ulpSqlstmt.hostvalue[33].mLen = 1+1;
    ulpSqlstmt.hostvalue[33].mMaxlen = sizeof(pubo_out_way_prcs.c_tag_vhcl_clss);
    ulpSqlstmt.hostvalue[33].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[33].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[33].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[34].mHostVar = (void*)(pubo_out_way_prcs.c_tag_vhcl_clss_consns_yn);
    ulpSqlstmt.hostvalue[34].mHostInd = NULL;
    ulpSqlstmt.hostvalue[34].isstruct = 1;
    ulpSqlstmt.hostvalue[34].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[34].isarr = 0;
    ulpSqlstmt.hostvalue[34].mType = 6;
    ulpSqlstmt.hostvalue[34].mSizeof = 0;
    ulpSqlstmt.hostvalue[34].mLen = 1+1;
    ulpSqlstmt.hostvalue[34].mMaxlen = sizeof(pubo_out_way_prcs.c_tag_vhcl_clss_consns_yn);
    ulpSqlstmt.hostvalue[34].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[34].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[34].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[35].mHostVar = (void*)(pubo_out_way_prcs.c_tag_atrb);
    ulpSqlstmt.hostvalue[35].mHostInd = NULL;
    ulpSqlstmt.hostvalue[35].isstruct = 1;
    ulpSqlstmt.hostvalue[35].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[35].isarr = 0;
    ulpSqlstmt.hostvalue[35].mType = 6;
    ulpSqlstmt.hostvalue[35].mSizeof = 0;
    ulpSqlstmt.hostvalue[35].mLen = 1+1;
    ulpSqlstmt.hostvalue[35].mMaxlen = sizeof(pubo_out_way_prcs.c_tag_atrb);
    ulpSqlstmt.hostvalue[35].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[35].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[35].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[36].mHostVar = (void*)(pubo_out_way_prcs.c_tag_atrb_consns_yn);
    ulpSqlstmt.hostvalue[36].mHostInd = NULL;
    ulpSqlstmt.hostvalue[36].isstruct = 1;
    ulpSqlstmt.hostvalue[36].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[36].isarr = 0;
    ulpSqlstmt.hostvalue[36].mType = 6;
    ulpSqlstmt.hostvalue[36].mSizeof = 0;
    ulpSqlstmt.hostvalue[36].mLen = 1+1;
    ulpSqlstmt.hostvalue[36].mMaxlen = sizeof(pubo_out_way_prcs.c_tag_atrb_consns_yn);
    ulpSqlstmt.hostvalue[36].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[36].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[36].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[37].mHostVar = (void*)(pubo_out_way_prcs.c_tag_vhcl_no);
    ulpSqlstmt.hostvalue[37].mHostInd = NULL;
    ulpSqlstmt.hostvalue[37].isstruct = 1;
    ulpSqlstmt.hostvalue[37].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[37].isarr = 0;
    ulpSqlstmt.hostvalue[37].mType = 6;
    ulpSqlstmt.hostvalue[37].mSizeof = 0;
    ulpSqlstmt.hostvalue[37].mLen = 10+1;
    ulpSqlstmt.hostvalue[37].mMaxlen = sizeof(pubo_out_way_prcs.c_tag_vhcl_no);
    ulpSqlstmt.hostvalue[37].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[37].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[37].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[38].mHostVar = (void*)(pubo_out_way_prcs.c_tag_vhcl_no_consns_yn);
    ulpSqlstmt.hostvalue[38].mHostInd = NULL;
    ulpSqlstmt.hostvalue[38].isstruct = 1;
    ulpSqlstmt.hostvalue[38].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[38].isarr = 0;
    ulpSqlstmt.hostvalue[38].mType = 6;
    ulpSqlstmt.hostvalue[38].mSizeof = 0;
    ulpSqlstmt.hostvalue[38].mLen = 1+1;
    ulpSqlstmt.hostvalue[38].mMaxlen = sizeof(pubo_out_way_prcs.c_tag_vhcl_no_consns_yn);
    ulpSqlstmt.hostvalue[38].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[38].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[38].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[39].mHostVar = (void*)(pubo_out_way_prcs.c_vald_term);
    ulpSqlstmt.hostvalue[39].mHostInd = NULL;
    ulpSqlstmt.hostvalue[39].isstruct = 1;
    ulpSqlstmt.hostvalue[39].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[39].isarr = 0;
    ulpSqlstmt.hostvalue[39].mType = 6;
    ulpSqlstmt.hostvalue[39].mSizeof = 0;
    ulpSqlstmt.hostvalue[39].mLen = 8+1;
    ulpSqlstmt.hostvalue[39].mMaxlen = sizeof(pubo_out_way_prcs.c_vald_term);
    ulpSqlstmt.hostvalue[39].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[39].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[39].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[40].mHostVar = (void*)(pubo_out_way_prcs.c_tag_vald_term_yn);
    ulpSqlstmt.hostvalue[40].mHostInd = NULL;
    ulpSqlstmt.hostvalue[40].isstruct = 1;
    ulpSqlstmt.hostvalue[40].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[40].isarr = 0;
    ulpSqlstmt.hostvalue[40].mType = 6;
    ulpSqlstmt.hostvalue[40].mSizeof = 0;
    ulpSqlstmt.hostvalue[40].mLen = 1+1;
    ulpSqlstmt.hostvalue[40].mMaxlen = sizeof(pubo_out_way_prcs.c_tag_vald_term_yn);
    ulpSqlstmt.hostvalue[40].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[40].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[40].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[41].mHostVar = (void*)(pubo_out_way_prcs.c_tag_crc);
    ulpSqlstmt.hostvalue[41].mHostInd = NULL;
    ulpSqlstmt.hostvalue[41].isstruct = 1;
    ulpSqlstmt.hostvalue[41].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[41].isarr = 0;
    ulpSqlstmt.hostvalue[41].mType = 6;
    ulpSqlstmt.hostvalue[41].mSizeof = 0;
    ulpSqlstmt.hostvalue[41].mLen = 2+1;
    ulpSqlstmt.hostvalue[41].mMaxlen = sizeof(pubo_out_way_prcs.c_tag_crc);
    ulpSqlstmt.hostvalue[41].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[41].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[41].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[42].mHostVar = (void*)(pubo_out_way_prcs.c_tag_crc_consns_yn);
    ulpSqlstmt.hostvalue[42].mHostInd = NULL;
    ulpSqlstmt.hostvalue[42].isstruct = 1;
    ulpSqlstmt.hostvalue[42].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[42].isarr = 0;
    ulpSqlstmt.hostvalue[42].mType = 6;
    ulpSqlstmt.hostvalue[42].mSizeof = 0;
    ulpSqlstmt.hostvalue[42].mLen = 1+1;
    ulpSqlstmt.hostvalue[42].mMaxlen = sizeof(pubo_out_way_prcs.c_tag_crc_consns_yn);
    ulpSqlstmt.hostvalue[42].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[42].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[42].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[43].mHostVar = (void*)(pubo_out_way_prcs.c_tag_sgnt);
    ulpSqlstmt.hostvalue[43].mHostInd = NULL;
    ulpSqlstmt.hostvalue[43].isstruct = 1;
    ulpSqlstmt.hostvalue[43].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[43].isarr = 0;
    ulpSqlstmt.hostvalue[43].mType = 6;
    ulpSqlstmt.hostvalue[43].mSizeof = 0;
    ulpSqlstmt.hostvalue[43].mLen = 4+1;
    ulpSqlstmt.hostvalue[43].mMaxlen = sizeof(pubo_out_way_prcs.c_tag_sgnt);
    ulpSqlstmt.hostvalue[43].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[43].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[43].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[44].mHostVar = (void*)(pubo_out_way_prcs.c_many_tag_yn);
    ulpSqlstmt.hostvalue[44].mHostInd = NULL;
    ulpSqlstmt.hostvalue[44].isstruct = 1;
    ulpSqlstmt.hostvalue[44].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[44].isarr = 0;
    ulpSqlstmt.hostvalue[44].mType = 6;
    ulpSqlstmt.hostvalue[44].mSizeof = 0;
    ulpSqlstmt.hostvalue[44].mLen = 1+1;
    ulpSqlstmt.hostvalue[44].mMaxlen = sizeof(pubo_out_way_prcs.c_many_tag_yn);
    ulpSqlstmt.hostvalue[44].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[44].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[44].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[45].mHostVar = (void*)(pubo_out_way_prcs.c_vhcl_clss_modf_yn);
    ulpSqlstmt.hostvalue[45].mHostInd = NULL;
    ulpSqlstmt.hostvalue[45].isstruct = 1;
    ulpSqlstmt.hostvalue[45].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[45].isarr = 0;
    ulpSqlstmt.hostvalue[45].mType = 6;
    ulpSqlstmt.hostvalue[45].mSizeof = 0;
    ulpSqlstmt.hostvalue[45].mLen = 1+1;
    ulpSqlstmt.hostvalue[45].mMaxlen = sizeof(pubo_out_way_prcs.c_vhcl_clss_modf_yn);
    ulpSqlstmt.hostvalue[45].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[45].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[45].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[46].mHostVar = (void*)(pubo_out_way_prcs.c_vhcl_no_modf_yn);
    ulpSqlstmt.hostvalue[46].mHostInd = NULL;
    ulpSqlstmt.hostvalue[46].isstruct = 1;
    ulpSqlstmt.hostvalue[46].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[46].isarr = 0;
    ulpSqlstmt.hostvalue[46].mType = 6;
    ulpSqlstmt.hostvalue[46].mSizeof = 0;
    ulpSqlstmt.hostvalue[46].mLen = 1+1;
    ulpSqlstmt.hostvalue[46].mMaxlen = sizeof(pubo_out_way_prcs.c_vhcl_no_modf_yn);
    ulpSqlstmt.hostvalue[46].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[46].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[46].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[47].mHostVar = (void*)(pubo_out_way_prcs.c_toll_modf_yn);
    ulpSqlstmt.hostvalue[47].mHostInd = NULL;
    ulpSqlstmt.hostvalue[47].isstruct = 1;
    ulpSqlstmt.hostvalue[47].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[47].isarr = 0;
    ulpSqlstmt.hostvalue[47].mType = 6;
    ulpSqlstmt.hostvalue[47].mSizeof = 0;
    ulpSqlstmt.hostvalue[47].mLen = 1+1;
    ulpSqlstmt.hostvalue[47].mMaxlen = sizeof(pubo_out_way_prcs.c_toll_modf_yn);
    ulpSqlstmt.hostvalue[47].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[47].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[47].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[48].mHostVar = (void*)(pubo_out_way_prcs.c_vhcl_no_info_yn);
    ulpSqlstmt.hostvalue[48].mHostInd = NULL;
    ulpSqlstmt.hostvalue[48].isstruct = 1;
    ulpSqlstmt.hostvalue[48].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[48].isarr = 0;
    ulpSqlstmt.hostvalue[48].mType = 6;
    ulpSqlstmt.hostvalue[48].mSizeof = 0;
    ulpSqlstmt.hostvalue[48].mLen = 1+1;
    ulpSqlstmt.hostvalue[48].mMaxlen = sizeof(pubo_out_way_prcs.c_vhcl_no_info_yn);
    ulpSqlstmt.hostvalue[48].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[48].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[48].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[49].mHostVar = (void*)(pubo_out_way_prcs.c_dpaymt_contrct_yn);
    ulpSqlstmt.hostvalue[49].mHostInd = NULL;
    ulpSqlstmt.hostvalue[49].isstruct = 1;
    ulpSqlstmt.hostvalue[49].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[49].isarr = 0;
    ulpSqlstmt.hostvalue[49].mType = 6;
    ulpSqlstmt.hostvalue[49].mSizeof = 0;
    ulpSqlstmt.hostvalue[49].mLen = 1+1;
    ulpSqlstmt.hostvalue[49].mMaxlen = sizeof(pubo_out_way_prcs.c_dpaymt_contrct_yn);
    ulpSqlstmt.hostvalue[49].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[49].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[49].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[50].mHostVar = (void*)(pubo_out_way_prcs.c_audt_type);
    ulpSqlstmt.hostvalue[50].mHostInd = NULL;
    ulpSqlstmt.hostvalue[50].isstruct = 1;
    ulpSqlstmt.hostvalue[50].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[50].isarr = 0;
    ulpSqlstmt.hostvalue[50].mType = 6;
    ulpSqlstmt.hostvalue[50].mSizeof = 0;
    ulpSqlstmt.hostvalue[50].mLen = 1+1;
    ulpSqlstmt.hostvalue[50].mMaxlen = sizeof(pubo_out_way_prcs.c_audt_type);
    ulpSqlstmt.hostvalue[50].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[50].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[50].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[51].mHostVar = (void*)(pubo_out_way_prcs.c_in_way_info_modf_yn);
    ulpSqlstmt.hostvalue[51].mHostInd = NULL;
    ulpSqlstmt.hostvalue[51].isstruct = 1;
    ulpSqlstmt.hostvalue[51].structsize = sizeof(pubo_out_way_prcs);
    ulpSqlstmt.hostvalue[51].isarr = 0;
    ulpSqlstmt.hostvalue[51].mType = 6;
    ulpSqlstmt.hostvalue[51].mSizeof = 0;
    ulpSqlstmt.hostvalue[51].mLen = 1+1;
    ulpSqlstmt.hostvalue[51].mMaxlen = sizeof(pubo_out_way_prcs.c_in_way_info_modf_yn);
    ulpSqlstmt.hostvalue[51].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[51].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[51].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("SQLCODE = %d PUBO_OUT_WAY_PRCS 출구처리 wrk_date[%.8s] lane_no[%.2s]\n",
                SQLCODE, pk_in->wrk_date, pk_in->wrk_no);
        return(-1);
    }

    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_car_no()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 처리차량번호 Data를 처리.
 *========================================================================
*/

int proc_car_no(char *target)
{
    struct rcv_lane_data  *rd;
    struct    hi_hnd_vhcl_no_data   *pk_in;

    struct    pubo_prcs_vhcl_no  pubo_prcs_vhcl_no;


    memset((char *)&pubo_prcs_vhcl_no, 0, sizeof(pubo_prcs_vhcl_no));
    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_hnd_vhcl_no_data *)rd->buf;

    e_memcpy(pubo_prcs_vhcl_no.c_plz_id,       rd->plz_id);
    e_memcpy(pubo_prcs_vhcl_no.c_work_date,    pk_in->wrk_date     );
    e_memcpy(pubo_prcs_vhcl_no.c_work_no,      pk_in->wrk_no       );
    e_memcpy(pubo_prcs_vhcl_no.c_workr_no,     "999999");

    pubo_prcs_vhcl_no.d_prcs_seq = lb_data2atoi((char *)pk_in->serial_no, 8);
    pubo_prcs_vhcl_no.d_etcs_prcs_seq = lb_data2atoi((char *)pk_in->etc_hnd_seq_no, 8);

    sprintf((char *)pubo_prcs_vhcl_no.c_prcs_vhcl_no, "%.12s", pk_in->hnd_vhcl_no);

    if(memcmp(pk_in->inout_hnd_div, "00", 2) == 0)
        /*  INSERT INTO PUBO_IN_WAY_PRCS_VHCL_NO VALUES (:pubo_prcs_vhcl_no); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[9];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 9;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO PUBO_IN_WAY_PRCS_VHCL_NO VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubo_prcs_vhcl_no.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubo_prcs_vhcl_no.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubo_prcs_vhcl_no.c_work_date);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 8+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubo_prcs_vhcl_no.c_work_date);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(pubo_prcs_vhcl_no.c_work_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 4+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(pubo_prcs_vhcl_no.c_work_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(pubo_prcs_vhcl_no.c_workr_no);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 6+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(pubo_prcs_vhcl_no.c_workr_no);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)&(pubo_prcs_vhcl_no.d_prcs_seq);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isstruct = 1;
    ulpSqlstmt.hostvalue[4].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 2;
    ulpSqlstmt.hostvalue[4].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[4].mLen = 0;
    ulpSqlstmt.hostvalue[4].mMaxlen = 0;
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)&(pubo_prcs_vhcl_no.d_etcs_prcs_seq);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isstruct = 1;
    ulpSqlstmt.hostvalue[5].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 2;
    ulpSqlstmt.hostvalue[5].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[5].mLen = 0;
    ulpSqlstmt.hostvalue[5].mMaxlen = 0;
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(pubo_prcs_vhcl_no.c_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isstruct = 1;
    ulpSqlstmt.hostvalue[6].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 30+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(pubo_prcs_vhcl_no.c_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)(pubo_prcs_vhcl_no.c_last_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isstruct = 1;
    ulpSqlstmt.hostvalue[7].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 6;
    ulpSqlstmt.hostvalue[7].mSizeof = 0;
    ulpSqlstmt.hostvalue[7].mLen = 30+1;
    ulpSqlstmt.hostvalue[7].mMaxlen = sizeof(pubo_prcs_vhcl_no.c_last_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)(pubo_prcs_vhcl_no.c_note);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isstruct = 1;
    ulpSqlstmt.hostvalue[8].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 6;
    ulpSqlstmt.hostvalue[8].mSizeof = 0;
    ulpSqlstmt.hostvalue[8].mLen = 100+1;
    ulpSqlstmt.hostvalue[8].mMaxlen = sizeof(pubo_prcs_vhcl_no.c_note);
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}

    else if(memcmp(pk_in->inout_hnd_div, "01", 2) == 0)
        /*  INSERT INTO PUBO_OUT_WAY_PRCS_VHCL_NO VALUES (:pubo_prcs_vhcl_no); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[9];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 9;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO PUBO_OUT_WAY_PRCS_VHCL_NO VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubo_prcs_vhcl_no.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubo_prcs_vhcl_no.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubo_prcs_vhcl_no.c_work_date);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 8+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubo_prcs_vhcl_no.c_work_date);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(pubo_prcs_vhcl_no.c_work_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 4+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(pubo_prcs_vhcl_no.c_work_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(pubo_prcs_vhcl_no.c_workr_no);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 6+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(pubo_prcs_vhcl_no.c_workr_no);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)&(pubo_prcs_vhcl_no.d_prcs_seq);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isstruct = 1;
    ulpSqlstmt.hostvalue[4].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 2;
    ulpSqlstmt.hostvalue[4].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[4].mLen = 0;
    ulpSqlstmt.hostvalue[4].mMaxlen = 0;
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)&(pubo_prcs_vhcl_no.d_etcs_prcs_seq);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isstruct = 1;
    ulpSqlstmt.hostvalue[5].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 2;
    ulpSqlstmt.hostvalue[5].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[5].mLen = 0;
    ulpSqlstmt.hostvalue[5].mMaxlen = 0;
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(pubo_prcs_vhcl_no.c_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isstruct = 1;
    ulpSqlstmt.hostvalue[6].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 30+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(pubo_prcs_vhcl_no.c_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)(pubo_prcs_vhcl_no.c_last_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isstruct = 1;
    ulpSqlstmt.hostvalue[7].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 6;
    ulpSqlstmt.hostvalue[7].mSizeof = 0;
    ulpSqlstmt.hostvalue[7].mLen = 30+1;
    ulpSqlstmt.hostvalue[7].mMaxlen = sizeof(pubo_prcs_vhcl_no.c_last_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)(pubo_prcs_vhcl_no.c_note);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isstruct = 1;
    ulpSqlstmt.hostvalue[8].structsize = sizeof(pubo_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 6;
    ulpSqlstmt.hostvalue[8].mSizeof = 0;
    ulpSqlstmt.hostvalue[8].mLen = 100+1;
    ulpSqlstmt.hostvalue[8].mMaxlen = sizeof(pubo_prcs_vhcl_no.c_note);
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("SQLCODE = %d PUBO_PRCS_VHCL_NO 처리차량번호 wrk_date[%s] lane_no[%.2s]\n",
                SQLCODE, pubo_prcs_vhcl_no.c_work_date, pk_in->wrk_no);
        return(-1);
    }

    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_in_way()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 입구처리 Data를 처리.
 *========================================================================
*/

int proc_in_way(char *target)
{
    struct rcv_lane_data  *rd;
    struct    hi_in_way_hnd_data *pk_in;

    struct    pubo_in_way_prcs   pubo_in_way_prcs;


    memset((char *)&pubo_in_way_prcs, 0, sizeof(pubo_in_way_prcs));
    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_in_way_hnd_data *)rd->buf;

    e_memcpy(pubo_in_way_prcs.c_plz_id,    rd->plz_id);
    e_memcpy(pubo_in_way_prcs.c_work_date, pk_in->wrk_date);
    e_memcpy(pubo_in_way_prcs.c_work_no,   pk_in->wrk_no);

    pubo_in_way_prcs.d_trnm_seq = lb_data2atoi((char *)pk_in->seq_no, 8);
    pubo_in_way_prcs.d_prcs_seq = lb_data2atoi((char *)pk_in->serial_no, 8);

    e_memcpy(pubo_in_way_prcs.c_workr_no,   pk_in->wrkr_no);
    e_memcpy(pubo_in_way_prcs.c_lane_type,  pk_in->lane_div);

    pubo_in_way_prcs.d_etcs_prcs_seq = lb_data2atoi((char *)pk_in->etc_hnd_seq_no, 8);

    sprintf((char *)pubo_in_way_prcs.c_prcs_date_tm, "%.4s%.2s%.2s%.2s%.2s%.2s",
            pk_in->hnd_info.hnd_year, pk_in->hnd_info.hnd_month, pk_in->hnd_info.hnd_day,
            pk_in->hnd_info.hnd_hour, pk_in->hnd_info.hnd_min,   pk_in->hnd_info.hnd_sec);

    e_memcpy(pubo_in_way_prcs.c_vio_cd,                pk_in->hnd_info.vio_code);
    e_memcpy(pubo_in_way_prcs.c_rcpt_prcs_type,        pk_in->hnd_info.rcpt_hnd_div);
    e_memcpy(pubo_in_way_prcs.c_rcpt_prcs_type_dtl_cd, pk_in->hnd_info.rcpt_hnd_code);
    sprintf((char *)pubo_in_way_prcs.c_online_type, "%c", pk_in->hnd_info.online_div[1]);
    sprintf((char *)pubo_in_way_prcs.c_work_type, "%c", pk_in->hnd_info.wrk_div);
    sprintf((char *)pubo_in_way_prcs.c_sens_vhcl_clss, "%c", pk_in->hnd_info.sens_vhcl_clss);
    sprintf((char *)pubo_in_way_prcs.c_prcs_vhcl_clss, "%c", pk_in->hnd_info.hnd_vhcl_clss);
    e_memcpy(pubo_in_way_prcs.c_img_vhcl_no,          pk_in->hnd_info.hnd_vhcl_no);
    sprintf((char *)pubo_in_way_prcs.c_rcpt_type, "%c", pk_in->hnd_info.rcpt_div);

    e_memcpy(pubo_in_way_prcs.c_tag_id,                  pk_in->tag_id);
    e_memcpy(pubo_in_way_prcs.c_iss_comp_cd,             pk_in->tag_iss);
    sprintf((char *)pubo_in_way_prcs.c_iss_comp_cd_consns_yn, "%c", pk_in->tag_iss_yn);
    sprintf((char *)pubo_in_way_prcs.c_tag_vhcl_clss, "%c", pk_in->tag_vhcl_clss);
    sprintf((char *)pubo_in_way_prcs.c_tag_vhcl_clss_consns_yn, "%c", pk_in->tag_vhcl_clss_yn);
    sprintf((char *)pubo_in_way_prcs.c_tag_atrb, "%c", pk_in->tag_atrb);
    sprintf((char *)pubo_in_way_prcs.c_tag_atrb_consns_yn, "%c", pk_in->tag_atrb_yn);
    e_memcpy(pubo_in_way_prcs.c_tag_vhcl_no,             pk_in->tag_vhcl_no);
    sprintf((char *)pubo_in_way_prcs.c_tag_vhcl_no_consns_yn, "%c", pk_in->tag_vhcl_no_yn);
    e_memcpy(pubo_in_way_prcs.c_vald_term,               pk_in->tag_vald_term);
    sprintf((char *)pubo_in_way_prcs.c_tag_vald_term_yn, "%c", pk_in->tag_vald_term_yn);
    e_memcpy(pubo_in_way_prcs.c_tag_crc,                 pk_in->tag_crc);
    sprintf((char *)pubo_in_way_prcs.c_tag_crc_consns_yn, "%c", pk_in->tag_crc_yn);
    e_memcpy(pubo_in_way_prcs.c_tag_sgnt,                pk_in->tag_sgnt_val);

    pubo_in_way_prcs.d_sens_seq = lb_data2atoi((char *)pk_in->sense_data_seq_no, 8);
    
    sprintf((char *)pubo_in_way_prcs.c_many_tag_yn, "%c%c", pk_in->many_tag_div, '\0');

    /*  INSERT INTO PUBO_IN_WAY_PRCS VALUES (:pubo_in_way_prcs); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[39];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 39;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO PUBO_IN_WAY_PRCS VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(pubo_in_way_prcs.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(pubo_in_way_prcs.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(pubo_in_way_prcs.c_work_date);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 8+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(pubo_in_way_prcs.c_work_date);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(pubo_in_way_prcs.c_work_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 4+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(pubo_in_way_prcs.c_work_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)&(pubo_in_way_prcs.d_trnm_seq);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 2;
    ulpSqlstmt.hostvalue[3].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[3].mLen = 0;
    ulpSqlstmt.hostvalue[3].mMaxlen = 0;
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)&(pubo_in_way_prcs.d_prcs_seq);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isstruct = 1;
    ulpSqlstmt.hostvalue[4].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 2;
    ulpSqlstmt.hostvalue[4].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[4].mLen = 0;
    ulpSqlstmt.hostvalue[4].mMaxlen = 0;
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(pubo_in_way_prcs.c_workr_no);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isstruct = 1;
    ulpSqlstmt.hostvalue[5].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 6+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(pubo_in_way_prcs.c_workr_no);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(pubo_in_way_prcs.c_lane_type);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isstruct = 1;
    ulpSqlstmt.hostvalue[6].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 2+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(pubo_in_way_prcs.c_lane_type);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)&(pubo_in_way_prcs.d_etcs_prcs_seq);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isstruct = 1;
    ulpSqlstmt.hostvalue[7].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 2;
    ulpSqlstmt.hostvalue[7].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[7].mLen = 0;
    ulpSqlstmt.hostvalue[7].mMaxlen = 0;
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)(pubo_in_way_prcs.c_prcs_date_tm);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isstruct = 1;
    ulpSqlstmt.hostvalue[8].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 6;
    ulpSqlstmt.hostvalue[8].mSizeof = 0;
    ulpSqlstmt.hostvalue[8].mLen = 14+1;
    ulpSqlstmt.hostvalue[8].mMaxlen = sizeof(pubo_in_way_prcs.c_prcs_date_tm);
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[9].mHostVar = (void*)(pubo_in_way_prcs.c_vio_cd);
    ulpSqlstmt.hostvalue[9].mHostInd = NULL;
    ulpSqlstmt.hostvalue[9].isstruct = 1;
    ulpSqlstmt.hostvalue[9].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[9].isarr = 0;
    ulpSqlstmt.hostvalue[9].mType = 6;
    ulpSqlstmt.hostvalue[9].mSizeof = 0;
    ulpSqlstmt.hostvalue[9].mLen = 2+1;
    ulpSqlstmt.hostvalue[9].mMaxlen = sizeof(pubo_in_way_prcs.c_vio_cd);
    ulpSqlstmt.hostvalue[9].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[9].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[9].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[10].mHostVar = (void*)(pubo_in_way_prcs.c_rcpt_prcs_type);
    ulpSqlstmt.hostvalue[10].mHostInd = NULL;
    ulpSqlstmt.hostvalue[10].isstruct = 1;
    ulpSqlstmt.hostvalue[10].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[10].isarr = 0;
    ulpSqlstmt.hostvalue[10].mType = 6;
    ulpSqlstmt.hostvalue[10].mSizeof = 0;
    ulpSqlstmt.hostvalue[10].mLen = 2+1;
    ulpSqlstmt.hostvalue[10].mMaxlen = sizeof(pubo_in_way_prcs.c_rcpt_prcs_type);
    ulpSqlstmt.hostvalue[10].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[10].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[10].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[11].mHostVar = (void*)(pubo_in_way_prcs.c_rcpt_prcs_type_dtl_cd);
    ulpSqlstmt.hostvalue[11].mHostInd = NULL;
    ulpSqlstmt.hostvalue[11].isstruct = 1;
    ulpSqlstmt.hostvalue[11].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[11].isarr = 0;
    ulpSqlstmt.hostvalue[11].mType = 6;
    ulpSqlstmt.hostvalue[11].mSizeof = 0;
    ulpSqlstmt.hostvalue[11].mLen = 2+1;
    ulpSqlstmt.hostvalue[11].mMaxlen = sizeof(pubo_in_way_prcs.c_rcpt_prcs_type_dtl_cd);
    ulpSqlstmt.hostvalue[11].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[11].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[11].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[12].mHostVar = (void*)(pubo_in_way_prcs.c_online_type);
    ulpSqlstmt.hostvalue[12].mHostInd = NULL;
    ulpSqlstmt.hostvalue[12].isstruct = 1;
    ulpSqlstmt.hostvalue[12].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[12].isarr = 0;
    ulpSqlstmt.hostvalue[12].mType = 6;
    ulpSqlstmt.hostvalue[12].mSizeof = 0;
    ulpSqlstmt.hostvalue[12].mLen = 1+1;
    ulpSqlstmt.hostvalue[12].mMaxlen = sizeof(pubo_in_way_prcs.c_online_type);
    ulpSqlstmt.hostvalue[12].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[12].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[12].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[13].mHostVar = (void*)(pubo_in_way_prcs.c_work_type);
    ulpSqlstmt.hostvalue[13].mHostInd = NULL;
    ulpSqlstmt.hostvalue[13].isstruct = 1;
    ulpSqlstmt.hostvalue[13].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[13].isarr = 0;
    ulpSqlstmt.hostvalue[13].mType = 6;
    ulpSqlstmt.hostvalue[13].mSizeof = 0;
    ulpSqlstmt.hostvalue[13].mLen = 1+1;
    ulpSqlstmt.hostvalue[13].mMaxlen = sizeof(pubo_in_way_prcs.c_work_type);
    ulpSqlstmt.hostvalue[13].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[13].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[13].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[14].mHostVar = (void*)(pubo_in_way_prcs.c_sens_vhcl_clss);
    ulpSqlstmt.hostvalue[14].mHostInd = NULL;
    ulpSqlstmt.hostvalue[14].isstruct = 1;
    ulpSqlstmt.hostvalue[14].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[14].isarr = 0;
    ulpSqlstmt.hostvalue[14].mType = 6;
    ulpSqlstmt.hostvalue[14].mSizeof = 0;
    ulpSqlstmt.hostvalue[14].mLen = 1+1;
    ulpSqlstmt.hostvalue[14].mMaxlen = sizeof(pubo_in_way_prcs.c_sens_vhcl_clss);
    ulpSqlstmt.hostvalue[14].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[14].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[14].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[15].mHostVar = (void*)(pubo_in_way_prcs.c_prcs_vhcl_clss);
    ulpSqlstmt.hostvalue[15].mHostInd = NULL;
    ulpSqlstmt.hostvalue[15].isstruct = 1;
    ulpSqlstmt.hostvalue[15].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[15].isarr = 0;
    ulpSqlstmt.hostvalue[15].mType = 6;
    ulpSqlstmt.hostvalue[15].mSizeof = 0;
    ulpSqlstmt.hostvalue[15].mLen = 1+1;
    ulpSqlstmt.hostvalue[15].mMaxlen = sizeof(pubo_in_way_prcs.c_prcs_vhcl_clss);
    ulpSqlstmt.hostvalue[15].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[15].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[15].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[16].mHostVar = (void*)(pubo_in_way_prcs.c_img_vhcl_no);
    ulpSqlstmt.hostvalue[16].mHostInd = NULL;
    ulpSqlstmt.hostvalue[16].isstruct = 1;
    ulpSqlstmt.hostvalue[16].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[16].isarr = 0;
    ulpSqlstmt.hostvalue[16].mType = 6;
    ulpSqlstmt.hostvalue[16].mSizeof = 0;
    ulpSqlstmt.hostvalue[16].mLen = 30+1;
    ulpSqlstmt.hostvalue[16].mMaxlen = sizeof(pubo_in_way_prcs.c_img_vhcl_no);
    ulpSqlstmt.hostvalue[16].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[16].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[16].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[17].mHostVar = (void*)(pubo_in_way_prcs.c_rcpt_type);
    ulpSqlstmt.hostvalue[17].mHostInd = NULL;
    ulpSqlstmt.hostvalue[17].isstruct = 1;
    ulpSqlstmt.hostvalue[17].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[17].isarr = 0;
    ulpSqlstmt.hostvalue[17].mType = 6;
    ulpSqlstmt.hostvalue[17].mSizeof = 0;
    ulpSqlstmt.hostvalue[17].mLen = 1+1;
    ulpSqlstmt.hostvalue[17].mMaxlen = sizeof(pubo_in_way_prcs.c_rcpt_type);
    ulpSqlstmt.hostvalue[17].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[17].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[17].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[18].mHostVar = (void*)(pubo_in_way_prcs.c_tag_id);
    ulpSqlstmt.hostvalue[18].mHostInd = NULL;
    ulpSqlstmt.hostvalue[18].isstruct = 1;
    ulpSqlstmt.hostvalue[18].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[18].isarr = 0;
    ulpSqlstmt.hostvalue[18].mType = 6;
    ulpSqlstmt.hostvalue[18].mSizeof = 0;
    ulpSqlstmt.hostvalue[18].mLen = 24+1;
    ulpSqlstmt.hostvalue[18].mMaxlen = sizeof(pubo_in_way_prcs.c_tag_id);
    ulpSqlstmt.hostvalue[18].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[18].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[18].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[19].mHostVar = (void*)(pubo_in_way_prcs.c_iss_comp_cd);
    ulpSqlstmt.hostvalue[19].mHostInd = NULL;
    ulpSqlstmt.hostvalue[19].isstruct = 1;
    ulpSqlstmt.hostvalue[19].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[19].isarr = 0;
    ulpSqlstmt.hostvalue[19].mType = 6;
    ulpSqlstmt.hostvalue[19].mSizeof = 0;
    ulpSqlstmt.hostvalue[19].mLen = 2+1;
    ulpSqlstmt.hostvalue[19].mMaxlen = sizeof(pubo_in_way_prcs.c_iss_comp_cd);
    ulpSqlstmt.hostvalue[19].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[19].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[19].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[20].mHostVar = (void*)(pubo_in_way_prcs.c_iss_comp_cd_consns_yn);
    ulpSqlstmt.hostvalue[20].mHostInd = NULL;
    ulpSqlstmt.hostvalue[20].isstruct = 1;
    ulpSqlstmt.hostvalue[20].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[20].isarr = 0;
    ulpSqlstmt.hostvalue[20].mType = 6;
    ulpSqlstmt.hostvalue[20].mSizeof = 0;
    ulpSqlstmt.hostvalue[20].mLen = 1+1;
    ulpSqlstmt.hostvalue[20].mMaxlen = sizeof(pubo_in_way_prcs.c_iss_comp_cd_consns_yn);
    ulpSqlstmt.hostvalue[20].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[20].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[20].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[21].mHostVar = (void*)(pubo_in_way_prcs.c_tag_vhcl_clss);
    ulpSqlstmt.hostvalue[21].mHostInd = NULL;
    ulpSqlstmt.hostvalue[21].isstruct = 1;
    ulpSqlstmt.hostvalue[21].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[21].isarr = 0;
    ulpSqlstmt.hostvalue[21].mType = 6;
    ulpSqlstmt.hostvalue[21].mSizeof = 0;
    ulpSqlstmt.hostvalue[21].mLen = 1+1;
    ulpSqlstmt.hostvalue[21].mMaxlen = sizeof(pubo_in_way_prcs.c_tag_vhcl_clss);
    ulpSqlstmt.hostvalue[21].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[21].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[21].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[22].mHostVar = (void*)(pubo_in_way_prcs.c_tag_vhcl_clss_consns_yn);
    ulpSqlstmt.hostvalue[22].mHostInd = NULL;
    ulpSqlstmt.hostvalue[22].isstruct = 1;
    ulpSqlstmt.hostvalue[22].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[22].isarr = 0;
    ulpSqlstmt.hostvalue[22].mType = 6;
    ulpSqlstmt.hostvalue[22].mSizeof = 0;
    ulpSqlstmt.hostvalue[22].mLen = 1+1;
    ulpSqlstmt.hostvalue[22].mMaxlen = sizeof(pubo_in_way_prcs.c_tag_vhcl_clss_consns_yn);
    ulpSqlstmt.hostvalue[22].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[22].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[22].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[23].mHostVar = (void*)(pubo_in_way_prcs.c_tag_atrb);
    ulpSqlstmt.hostvalue[23].mHostInd = NULL;
    ulpSqlstmt.hostvalue[23].isstruct = 1;
    ulpSqlstmt.hostvalue[23].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[23].isarr = 0;
    ulpSqlstmt.hostvalue[23].mType = 6;
    ulpSqlstmt.hostvalue[23].mSizeof = 0;
    ulpSqlstmt.hostvalue[23].mLen = 1+1;
    ulpSqlstmt.hostvalue[23].mMaxlen = sizeof(pubo_in_way_prcs.c_tag_atrb);
    ulpSqlstmt.hostvalue[23].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[23].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[23].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[24].mHostVar = (void*)(pubo_in_way_prcs.c_tag_atrb_consns_yn);
    ulpSqlstmt.hostvalue[24].mHostInd = NULL;
    ulpSqlstmt.hostvalue[24].isstruct = 1;
    ulpSqlstmt.hostvalue[24].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[24].isarr = 0;
    ulpSqlstmt.hostvalue[24].mType = 6;
    ulpSqlstmt.hostvalue[24].mSizeof = 0;
    ulpSqlstmt.hostvalue[24].mLen = 1+1;
    ulpSqlstmt.hostvalue[24].mMaxlen = sizeof(pubo_in_way_prcs.c_tag_atrb_consns_yn);
    ulpSqlstmt.hostvalue[24].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[24].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[24].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[25].mHostVar = (void*)(pubo_in_way_prcs.c_tag_vhcl_no);
    ulpSqlstmt.hostvalue[25].mHostInd = NULL;
    ulpSqlstmt.hostvalue[25].isstruct = 1;
    ulpSqlstmt.hostvalue[25].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[25].isarr = 0;
    ulpSqlstmt.hostvalue[25].mType = 6;
    ulpSqlstmt.hostvalue[25].mSizeof = 0;
    ulpSqlstmt.hostvalue[25].mLen = 10+1;
    ulpSqlstmt.hostvalue[25].mMaxlen = sizeof(pubo_in_way_prcs.c_tag_vhcl_no);
    ulpSqlstmt.hostvalue[25].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[25].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[25].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[26].mHostVar = (void*)(pubo_in_way_prcs.c_tag_vhcl_no_consns_yn);
    ulpSqlstmt.hostvalue[26].mHostInd = NULL;
    ulpSqlstmt.hostvalue[26].isstruct = 1;
    ulpSqlstmt.hostvalue[26].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[26].isarr = 0;
    ulpSqlstmt.hostvalue[26].mType = 6;
    ulpSqlstmt.hostvalue[26].mSizeof = 0;
    ulpSqlstmt.hostvalue[26].mLen = 1+1;
    ulpSqlstmt.hostvalue[26].mMaxlen = sizeof(pubo_in_way_prcs.c_tag_vhcl_no_consns_yn);
    ulpSqlstmt.hostvalue[26].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[26].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[26].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[27].mHostVar = (void*)(pubo_in_way_prcs.c_vald_term);
    ulpSqlstmt.hostvalue[27].mHostInd = NULL;
    ulpSqlstmt.hostvalue[27].isstruct = 1;
    ulpSqlstmt.hostvalue[27].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[27].isarr = 0;
    ulpSqlstmt.hostvalue[27].mType = 6;
    ulpSqlstmt.hostvalue[27].mSizeof = 0;
    ulpSqlstmt.hostvalue[27].mLen = 8+1;
    ulpSqlstmt.hostvalue[27].mMaxlen = sizeof(pubo_in_way_prcs.c_vald_term);
    ulpSqlstmt.hostvalue[27].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[27].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[27].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[28].mHostVar = (void*)(pubo_in_way_prcs.c_tag_vald_term_yn);
    ulpSqlstmt.hostvalue[28].mHostInd = NULL;
    ulpSqlstmt.hostvalue[28].isstruct = 1;
    ulpSqlstmt.hostvalue[28].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[28].isarr = 0;
    ulpSqlstmt.hostvalue[28].mType = 6;
    ulpSqlstmt.hostvalue[28].mSizeof = 0;
    ulpSqlstmt.hostvalue[28].mLen = 1+1;
    ulpSqlstmt.hostvalue[28].mMaxlen = sizeof(pubo_in_way_prcs.c_tag_vald_term_yn);
    ulpSqlstmt.hostvalue[28].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[28].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[28].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[29].mHostVar = (void*)(pubo_in_way_prcs.c_tag_crc);
    ulpSqlstmt.hostvalue[29].mHostInd = NULL;
    ulpSqlstmt.hostvalue[29].isstruct = 1;
    ulpSqlstmt.hostvalue[29].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[29].isarr = 0;
    ulpSqlstmt.hostvalue[29].mType = 6;
    ulpSqlstmt.hostvalue[29].mSizeof = 0;
    ulpSqlstmt.hostvalue[29].mLen = 2+1;
    ulpSqlstmt.hostvalue[29].mMaxlen = sizeof(pubo_in_way_prcs.c_tag_crc);
    ulpSqlstmt.hostvalue[29].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[29].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[29].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[30].mHostVar = (void*)(pubo_in_way_prcs.c_tag_crc_consns_yn);
    ulpSqlstmt.hostvalue[30].mHostInd = NULL;
    ulpSqlstmt.hostvalue[30].isstruct = 1;
    ulpSqlstmt.hostvalue[30].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[30].isarr = 0;
    ulpSqlstmt.hostvalue[30].mType = 6;
    ulpSqlstmt.hostvalue[30].mSizeof = 0;
    ulpSqlstmt.hostvalue[30].mLen = 1+1;
    ulpSqlstmt.hostvalue[30].mMaxlen = sizeof(pubo_in_way_prcs.c_tag_crc_consns_yn);
    ulpSqlstmt.hostvalue[30].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[30].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[30].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[31].mHostVar = (void*)(pubo_in_way_prcs.c_tag_sgnt);
    ulpSqlstmt.hostvalue[31].mHostInd = NULL;
    ulpSqlstmt.hostvalue[31].isstruct = 1;
    ulpSqlstmt.hostvalue[31].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[31].isarr = 0;
    ulpSqlstmt.hostvalue[31].mType = 6;
    ulpSqlstmt.hostvalue[31].mSizeof = 0;
    ulpSqlstmt.hostvalue[31].mLen = 4+1;
    ulpSqlstmt.hostvalue[31].mMaxlen = sizeof(pubo_in_way_prcs.c_tag_sgnt);
    ulpSqlstmt.hostvalue[31].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[31].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[31].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[32].mHostVar = (void*)&(pubo_in_way_prcs.d_sens_seq);
    ulpSqlstmt.hostvalue[32].mHostInd = NULL;
    ulpSqlstmt.hostvalue[32].isstruct = 1;
    ulpSqlstmt.hostvalue[32].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[32].isarr = 0;
    ulpSqlstmt.hostvalue[32].mType = 2;
    ulpSqlstmt.hostvalue[32].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[32].mLen = 0;
    ulpSqlstmt.hostvalue[32].mMaxlen = 0;
    ulpSqlstmt.hostvalue[32].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[32].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[32].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[33].mHostVar = (void*)(pubo_in_way_prcs.c_many_tag_yn);
    ulpSqlstmt.hostvalue[33].mHostInd = NULL;
    ulpSqlstmt.hostvalue[33].isstruct = 1;
    ulpSqlstmt.hostvalue[33].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[33].isarr = 0;
    ulpSqlstmt.hostvalue[33].mType = 6;
    ulpSqlstmt.hostvalue[33].mSizeof = 0;
    ulpSqlstmt.hostvalue[33].mLen = 1+1;
    ulpSqlstmt.hostvalue[33].mMaxlen = sizeof(pubo_in_way_prcs.c_many_tag_yn);
    ulpSqlstmt.hostvalue[33].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[33].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[33].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[34].mHostVar = (void*)(pubo_in_way_prcs.c_vhcl_clss_modf_yn);
    ulpSqlstmt.hostvalue[34].mHostInd = NULL;
    ulpSqlstmt.hostvalue[34].isstruct = 1;
    ulpSqlstmt.hostvalue[34].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[34].isarr = 0;
    ulpSqlstmt.hostvalue[34].mType = 6;
    ulpSqlstmt.hostvalue[34].mSizeof = 0;
    ulpSqlstmt.hostvalue[34].mLen = 1+1;
    ulpSqlstmt.hostvalue[34].mMaxlen = sizeof(pubo_in_way_prcs.c_vhcl_clss_modf_yn);
    ulpSqlstmt.hostvalue[34].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[34].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[34].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[35].mHostVar = (void*)(pubo_in_way_prcs.c_vhcl_no_modf_yn);
    ulpSqlstmt.hostvalue[35].mHostInd = NULL;
    ulpSqlstmt.hostvalue[35].isstruct = 1;
    ulpSqlstmt.hostvalue[35].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[35].isarr = 0;
    ulpSqlstmt.hostvalue[35].mType = 6;
    ulpSqlstmt.hostvalue[35].mSizeof = 0;
    ulpSqlstmt.hostvalue[35].mLen = 1+1;
    ulpSqlstmt.hostvalue[35].mMaxlen = sizeof(pubo_in_way_prcs.c_vhcl_no_modf_yn);
    ulpSqlstmt.hostvalue[35].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[35].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[35].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[36].mHostVar = (void*)(pubo_in_way_prcs.c_toll_modf_yn);
    ulpSqlstmt.hostvalue[36].mHostInd = NULL;
    ulpSqlstmt.hostvalue[36].isstruct = 1;
    ulpSqlstmt.hostvalue[36].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[36].isarr = 0;
    ulpSqlstmt.hostvalue[36].mType = 6;
    ulpSqlstmt.hostvalue[36].mSizeof = 0;
    ulpSqlstmt.hostvalue[36].mLen = 1+1;
    ulpSqlstmt.hostvalue[36].mMaxlen = sizeof(pubo_in_way_prcs.c_toll_modf_yn);
    ulpSqlstmt.hostvalue[36].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[36].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[36].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[37].mHostVar = (void*)(pubo_in_way_prcs.c_audt_type);
    ulpSqlstmt.hostvalue[37].mHostInd = NULL;
    ulpSqlstmt.hostvalue[37].isstruct = 1;
    ulpSqlstmt.hostvalue[37].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[37].isarr = 0;
    ulpSqlstmt.hostvalue[37].mType = 6;
    ulpSqlstmt.hostvalue[37].mSizeof = 0;
    ulpSqlstmt.hostvalue[37].mLen = 2+1;
    ulpSqlstmt.hostvalue[37].mMaxlen = sizeof(pubo_in_way_prcs.c_audt_type);
    ulpSqlstmt.hostvalue[37].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[37].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[37].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[38].mHostVar = (void*)(pubo_in_way_prcs.c_tag_info_modf_yn);
    ulpSqlstmt.hostvalue[38].mHostInd = NULL;
    ulpSqlstmt.hostvalue[38].isstruct = 1;
    ulpSqlstmt.hostvalue[38].structsize = sizeof(pubo_in_way_prcs);
    ulpSqlstmt.hostvalue[38].isarr = 0;
    ulpSqlstmt.hostvalue[38].mType = 6;
    ulpSqlstmt.hostvalue[38].mSizeof = 0;
    ulpSqlstmt.hostvalue[38].mLen = 1+1;
    ulpSqlstmt.hostvalue[38].mMaxlen = sizeof(pubo_in_way_prcs.c_tag_info_modf_yn);
    ulpSqlstmt.hostvalue[38].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[38].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[38].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("SQLCODE = %d PUBO_IN_WAY_PRCS 입구처리 wrk_date[%.8s] lane_no[%.2s]\n",
                SQLCODE, pk_in->wrk_date, pk_in->wrk_no);
        return(-1);
    }

    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_iss_info()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 발행정보 Data를 조회.
 *========================================================================
*/

int proc_iss_info(char *target, char *rep)
{
    struct rcv_lane_data  *rd;
    struct    hi_iss_info_srch  *pk_in;
    struct    rq_iss_info_tbl   *pk_snd;
    int  i, rowcnt = 0, sndcnt = 0;

    struct  db_iss_info dbinfo;
    char carno[12+1];
    char tagid[24+1];
    int  rqseq, blnc, tagcnt = 0;


    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_iss_info_srch *)rd->buf;
    memset(carno, 0x00, sizeof(carno));
    pk_snd = (struct rq_iss_info_tbl *)rep;
    memset(pk_snd, 0x00, sizeof(struct rq_iss_info_tbl));
    e_memcpy(carno, pk_in->carno);
    rqseq = lb_data2atoi((char *)pk_in->req_seq, 4);
printf("1[%.8s][%.12s][%s]\n", pk_in->seq_no, pk_in->carno, carno);
    if(memcmp(pk_in->req_kind, "01", 2) == 0)
    {
        /*  
        SELECT COUNT(TAG_ID) 
                     
        FROM  OPRM_ISNC_INFO 
        WHERE ISNC_VHCL_NO = :carno 
        ORDER BY TAG_ID 
        ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT COUNT(TAG_ID) "
"                     "
"        FROM  OPRM_ISNC_INFO "
"        WHERE ISNC_VHCL_NO = ?  "
"        ORDER BY TAG_ID "
"        ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)&(tagcnt);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 2;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[0].mLen = 0;
    ulpSqlstmt.hostvalue[0].mMaxlen = 0;
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(carno);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 12+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(carno);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


        if (SQLCODE < 0)
        {
            sprintf((char *)pk_snd->kind, "%02x", AZN_ISS_INFO_RSPNS);
            sprintf((char *)pk_snd->rslt, "03");
            sprintf((char *)pk_snd->rs_cnt, "%04d", tagcnt);
            sprintf((char *)pk_snd->snd_cnt, "0000");
            printf("SQLCODE = %d OPRM_ISNC_INFO [%.2s] Count Fail\n", SQLCODE, pk_in->req_kind);
            return(-1);
        }

        /*  DECLARE OPRM_ISNC_INFO_S CURSOR FOR 
        SELECT 
              TAG_ID 
        FROM  OPRM_ISNC_INFO 
        WHERE ISNC_VHCL_NO = :carno 
        AND   ROWNUM >= :rqseq 
        ORDER BY TAG_ID 
        ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 12;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.curname = (char*) "OPRM_ISNC_INFO_S";
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT "
"              TAG_ID "
"        FROM  OPRM_ISNC_INFO "
"        WHERE ISNC_VHCL_NO = ?  "
"        AND   ROWNUM >= ?  "
"        ORDER BY TAG_ID "
"        ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(carno);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 12+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(carno);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)&(rqseq);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 2;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[1].mLen = 0;
    ulpSqlstmt.hostvalue[1].mMaxlen = 0;
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


        /*  OPEN OPRM_ISNC_INFO_S; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpSqlstmt.stmttype = 13;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.curname = (char*) "OPRM_ISNC_INFO_S";
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 0;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}

        if (SQLCODE < 0)
        {
            sprintf((char *)pk_snd->kind, "%02x", AZN_ISS_INFO_RSPNS);
            sprintf((char *)pk_snd->rslt, "03");
            sprintf((char *)pk_snd->rs_cnt, "%04d", tagcnt);
            sprintf((char *)pk_snd->snd_cnt, "0000");
            printf("SQLCODE = %d OPRM_ISNC_INFO [%.2s]Select Fail\n", SQLCODE, pk_in->req_kind);
            return(-1);
        }

    }else if(memcmp(pk_in->req_kind, "02", 2) == 0)
    {
        /*  
        SELECT COUNT(TAG_ID) 
                     
        FROM  OPRM_ISNC_INFO 
        WHERE NO_VHCL_NO = :carno 
        ORDER BY TAG_ID 
        ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT COUNT(TAG_ID) "
"                     "
"        FROM  OPRM_ISNC_INFO "
"        WHERE NO_VHCL_NO = ?  "
"        ORDER BY TAG_ID "
"        ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)&(tagcnt);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 2;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[0].mLen = 0;
    ulpSqlstmt.hostvalue[0].mMaxlen = 0;
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(carno);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 12+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(carno);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


        if (SQLCODE < 0)
        {
            sprintf((char *)pk_snd->kind, "%02x", AZN_ISS_INFO_RSPNS);
            sprintf((char *)pk_snd->rslt, "03");
            sprintf((char *)pk_snd->rs_cnt, "%04d", tagcnt);
            sprintf((char *)pk_snd->snd_cnt, "0000");
            printf("SQLCODE = %d OPRM_ISNC_INFO [%.2s] Count Fail\n", SQLCODE, pk_in->req_kind);
            return(-1);
        }

        /*  DECLARE OPRM_ISNC_INFO_S CURSOR FOR 
        SELECT 
              TAG_ID 
        FROM  OPRM_ISNC_INFO 
        WHERE NO_VHCL_NO = :carno 
        AND   ROWNUM >= :rqseq 
        ORDER BY TAG_ID 
        ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 12;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.curname = (char*) "OPRM_ISNC_INFO_S";
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT "
"              TAG_ID "
"        FROM  OPRM_ISNC_INFO "
"        WHERE NO_VHCL_NO = ?  "
"        AND   ROWNUM >= ?  "
"        ORDER BY TAG_ID "
"        ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(carno);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 12+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(carno);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)&(rqseq);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 2;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[1].mLen = 0;
    ulpSqlstmt.hostvalue[1].mMaxlen = 0;
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


        /*  OPEN OPRM_ISNC_INFO_S; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpSqlstmt.stmttype = 13;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.curname = (char*) "OPRM_ISNC_INFO_S";
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 0;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}

        if (SQLCODE < 0)
        {
            sprintf((char *)pk_snd->kind, "%02x", AZN_ISS_INFO_RSPNS);
            sprintf((char *)pk_snd->rslt, "03");
            sprintf((char *)pk_snd->rs_cnt, "%04d", tagcnt);
            sprintf((char *)pk_snd->snd_cnt, "0000");
            printf("SQLCODE = %d OPRM_ISNC_INFO [%.2s]Select Fail\n", SQLCODE, pk_in->req_kind);
            return(-1);
        }

    }else
        return(-1);
    printf("발행정보 조회 결과 TAG CNT[%d]\n", tagcnt);
    if(tagcnt == 0)
    {
        sprintf((char *)pk_snd->kind, "%02x", AZN_ISS_INFO);
        sprintf((char *)pk_snd->rslt, "02");
        sprintf((char *)pk_snd->rs_cnt, "%04d", tagcnt);
        sprintf((char *)pk_snd->snd_cnt, "0000");
        return(0);
    }

    if(tagcnt >= 25) sndcnt = 25;
    else sndcnt = tagcnt;
    
    sprintf((char *)pk_snd->kind, "%02x", AZN_ISS_INFO);
    sprintf((char *)pk_snd->rslt, "00");
    sprintf((char *)pk_snd->rs_cnt, "%04d", tagcnt);
    sprintf((char *)pk_snd->snd_cnt, "%04d", sndcnt);
printf("발행정보 조회 송신[%.2s]\n", pk_snd->kind);
    for(i = 0; i<sndcnt; i++)
    {
        memset(&tagid, 0x00, sizeof(tagid));

        /*  FETCH OPRM_ISNC_INFO_S INTO       ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[1];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 14;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.curname = (char*) "OPRM_ISNC_INFO_S";
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 1;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(tagid);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 24+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(tagid);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


        if( sqlca.sqlcode != 0  && sqlca.sqlcode != 100)
        {
            printf( "FETCH OPRM_ISNC_INFO_S failed [%d]\n", sqlca.sqlcode );
            return(-1);
        }

        /*  
        SELECT COUNT(BLNC) 
                   
        FROM OPRC_BLNC_INFO 
        WHERE TAG_ID = :tagid 
        ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT COUNT(BLNC) "
"                   "
"        FROM OPRC_BLNC_INFO "
"        WHERE TAG_ID = ?  "
"        ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)&(blnc);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 2;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[0].mLen = 0;
    ulpSqlstmt.hostvalue[0].mMaxlen = 0;
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(tagid);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 24+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(tagid);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}

        if (SQLCODE < 0)
        {
            sprintf((char *)pk_snd->rslt, "03");
            printf("SQLCODE = %d OPRC_BLNC_INFO [%.24s]Count Fail\n", SQLCODE, tagid);
            return(-1);
        }

        if(blnc == 0)
        {
            /*  
            SELECT COUNT(BLNC) 
                       
            FROM OPRM_BLNC_INFO 
            WHERE TAG_ID = :tagid 
            ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT COUNT(BLNC) "
"                       "
"            FROM OPRM_BLNC_INFO "
"            WHERE TAG_ID = ?  "
"            ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)&(blnc);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 2;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[0].mLen = 0;
    ulpSqlstmt.hostvalue[0].mMaxlen = 0;
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(tagid);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 24+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(tagid);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}

            if (SQLCODE < 0)
            {
                sprintf((char *)pk_snd->rslt, "03");
                printf("SQLCODE = %d OPRM_BLNC_INFO [%.24s]Count Fail\n", SQLCODE, tagid);
                return(-1);
            }
        }

        sprintf((char *)pk_snd->iss_info[i].tag_balc, "%08d", blnc);
        memset(&dbinfo, 0x00, sizeof(dbinfo));
        /*  
        SELECT 
            RPAD(NVL(TAG_ID         , ' '), 24, ' '), 
            LPAD(NVL(ISS_COMP_CD    , ' '),  2, ' '), 
            LPAD(NVL(TAG_VHCL_CLSS  , ' '),  1, ' '), 
            LPAD(NVL(TAG_ATRB       , ' '),  1, ' '), 
            LPAD(NVL(TAG_ATRB_DTL_CD, ' '),  2, ' '), 
            RPAD(NVL(ISNC_VHCL_NO   , ' '), 12, ' '), 
            RPAD(NVL(VALD_TERM      , ' '), 10, ' '), 
            RPAD(NVL(TAG_CRC        , ' '),  2, ' ') 
                                                                                                             
                                                                         
        FROM  OPRM_ISNC_INFO 
        WHERE TAG_ID = :tagid 
        ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[9];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 9;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT "
"            RPAD(NVL(TAG_ID         , ' '), 24, ' '), "
"            LPAD(NVL(ISS_COMP_CD    , ' '),  2, ' '), "
"            LPAD(NVL(TAG_VHCL_CLSS  , ' '),  1, ' '), "
"            LPAD(NVL(TAG_ATRB       , ' '),  1, ' '), "
"            LPAD(NVL(TAG_ATRB_DTL_CD, ' '),  2, ' '), "
"            RPAD(NVL(ISNC_VHCL_NO   , ' '), 12, ' '), "
"            RPAD(NVL(VALD_TERM      , ' '), 10, ' '), "
"            RPAD(NVL(TAG_CRC        , ' '),  2, ' ') "
"                                                                                                             "
"                                                                         "
"        FROM  OPRM_ISNC_INFO "
"        WHERE TAG_ID = ?  "
"        ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(dbinfo.tag_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 24+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(dbinfo.tag_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(dbinfo.tag_iss);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 2+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(dbinfo.tag_iss);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(dbinfo.tag_vhcl_clss);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].isstruct = 0;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 1+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(dbinfo.tag_vhcl_clss);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(dbinfo.tag_atrb);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].isstruct = 0;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 1+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(dbinfo.tag_atrb);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)(dbinfo.tag_dtl_code);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 6;
    ulpSqlstmt.hostvalue[4].isstruct = 0;
    ulpSqlstmt.hostvalue[4].mSizeof = 0;
    ulpSqlstmt.hostvalue[4].mLen = 2+1;
    ulpSqlstmt.hostvalue[4].mMaxlen = sizeof(dbinfo.tag_dtl_code);
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(dbinfo.tag_vhcl_no);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].isstruct = 0;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 12+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(dbinfo.tag_vhcl_no);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(dbinfo.tag_vald_term);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].isstruct = 0;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 10+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(dbinfo.tag_vald_term);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)(dbinfo.tag_crc);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 6;
    ulpSqlstmt.hostvalue[7].isstruct = 0;
    ulpSqlstmt.hostvalue[7].mSizeof = 0;
    ulpSqlstmt.hostvalue[7].mLen = 2+1;
    ulpSqlstmt.hostvalue[7].mMaxlen = sizeof(dbinfo.tag_crc);
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)(tagid);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 6;
    ulpSqlstmt.hostvalue[8].isstruct = 0;
    ulpSqlstmt.hostvalue[8].mSizeof = 0;
    ulpSqlstmt.hostvalue[8].mLen = 24+1;
    ulpSqlstmt.hostvalue[8].mMaxlen = sizeof(tagid);
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


        if (SQLCODE < 0)
        {
            sprintf((char *)pk_snd->rslt, "03");
            printf("SQLCODE = %d OPRM_ISNC_INFO [%.24s]Select Fail\n", SQLCODE, tagid);
            return(-1);
        }

        sprintf((char *)pk_snd->iss_info[i].tag_id, "%.24s", dbinfo.tag_id);
        sprintf((char *)pk_snd->iss_info[i].tag_iss, "%.2s", dbinfo.tag_iss);

        pk_snd->iss_info[i].tag_vhcl_clss = dbinfo.tag_vhcl_clss[0];
        pk_snd->iss_info[i].tag_atrb = dbinfo.tag_atrb[0];

        sprintf((char *)pk_snd->iss_info[i].tag_dtl_code, "%.2s", dbinfo.tag_dtl_code);
        sprintf((char *)pk_snd->iss_info[i].tag_vhcl_no, "%.12s", dbinfo.tag_vhcl_no);
        sprintf((char *)pk_snd->iss_info[i].tag_vald_term, "%.10s", dbinfo.tag_vald_term);
        sprintf((char *)pk_snd->iss_info[i].tag_crc, "%.2s", dbinfo.tag_crc);

        rowcnt++;
    }
    printf("발행정보 조회결과 SND CNT[%d]\n", rowcnt);
printf("결과1[%s]\n", pk_snd);
//    sprintf((char *)pk_snd->snd_cnt, "%04d", rowcnt);
//printf("결과2[%s]\n", pk_snd);
    printf("END\n");
    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_tag_sale()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.12.27
 *   수 정 일 :
 *   설    명 : 기간권 TAG 판매 등록 요청
 *========================================================================
*/

int proc_tag_sale(char *target, char *rep)
{
    struct  rcv_lane_data         *rd;
    struct  hi_perd_sale_rgst_rq  *pk_in;
    struct  tag_iss_sale_rq       *pk_snd;
    struct  rq_lnk_rslt           *pk_fail;
    int  i, rowcnt = 0, sndcnt = 0;

    struct  tcso_perd_tag_sale dbinfo;


    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_perd_sale_rgst_rq *)rd->buf;
    
    memset(&dbinfo, 0x00, sizeof(dbinfo));

    sprintf((char *)dbinfo.c_plz_id         , "%.6s",   rd->plz_id);
    sprintf((char *)dbinfo.c_work_date      , "%.8s",   pk_in->wrk_date);
    sprintf((char *)dbinfo.c_work_no        , "%.4s",   pk_in->wrk_no);
    sprintf((char *)dbinfo.c_workr_no       , "%.6s",   pk_in->wrkr_no);
    dbinfo.n_prcs_seq =    lb_data2atoi((char *)pk_in->serial_no, 8);
    sprintf((char *)dbinfo.c_tag_id         , "%.24s",  pk_in->tag_id);
    sprintf((char *)dbinfo.c_iss_comp_cd    , "%.2s",   pk_in->iss_code);
    sprintf((char *)dbinfo.c_tag_vhcl_clss  , "%c",     pk_in->iss_vhcl_clss);
    sprintf((char *)dbinfo.c_tag_atrb       , "1"); 
    sprintf((char *)dbinfo.c_vald_term      , "20%.8s", pk_in->vald_term);
    sprintf((char *)dbinfo.c_tag_crc        , "%.2s",   pk_in->crc);
    sprintf((char *)dbinfo.c_iss_date_tm    , "%.4s%.2s%.2s%.2s%.2s%02d",
            pk_in->year, pk_in->month, pk_in->day, pk_in->hour, pk_in->min, hi_comm_ctrl.cday.tm_sec);
    dbinfo.n_sale_amt =    lb_data2atoi((char *)pk_in->sale_mny, 8);
    sprintf((char *)dbinfo.c_isnc_vhcl_no   , "%.12s",   pk_in->vhcl_no);
    sprintf((char *)dbinfo.c_tag_atrb_dtl_cd, "%.2s",   pk_in->perd_kind);
    sprintf((char *)dbinfo.c_tag_vhcl_no    , "%.8s",  pk_in->tag_vhcl_no);

    /*  INSERT INTO TCSO_PERD_TAG_SALE VALUES (:dbinfo); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[16];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 16;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO TCSO_PERD_TAG_SALE VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(dbinfo.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(dbinfo.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(dbinfo.c_work_date);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 8+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(dbinfo.c_work_date);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(dbinfo.c_work_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 4+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(dbinfo.c_work_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(dbinfo.c_workr_no);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 6+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(dbinfo.c_workr_no);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)&(dbinfo.n_prcs_seq);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isstruct = 1;
    ulpSqlstmt.hostvalue[4].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 2;
    ulpSqlstmt.hostvalue[4].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[4].mLen = 0;
    ulpSqlstmt.hostvalue[4].mMaxlen = 0;
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(dbinfo.c_tag_id);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isstruct = 1;
    ulpSqlstmt.hostvalue[5].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 24+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(dbinfo.c_tag_id);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(dbinfo.c_iss_comp_cd);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isstruct = 1;
    ulpSqlstmt.hostvalue[6].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 2+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(dbinfo.c_iss_comp_cd);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)(dbinfo.c_tag_vhcl_clss);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isstruct = 1;
    ulpSqlstmt.hostvalue[7].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 6;
    ulpSqlstmt.hostvalue[7].mSizeof = 0;
    ulpSqlstmt.hostvalue[7].mLen = 1+1;
    ulpSqlstmt.hostvalue[7].mMaxlen = sizeof(dbinfo.c_tag_vhcl_clss);
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)(dbinfo.c_tag_atrb);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isstruct = 1;
    ulpSqlstmt.hostvalue[8].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 6;
    ulpSqlstmt.hostvalue[8].mSizeof = 0;
    ulpSqlstmt.hostvalue[8].mLen = 1+1;
    ulpSqlstmt.hostvalue[8].mMaxlen = sizeof(dbinfo.c_tag_atrb);
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[9].mHostVar = (void*)(dbinfo.c_vald_term);
    ulpSqlstmt.hostvalue[9].mHostInd = NULL;
    ulpSqlstmt.hostvalue[9].isstruct = 1;
    ulpSqlstmt.hostvalue[9].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[9].isarr = 0;
    ulpSqlstmt.hostvalue[9].mType = 6;
    ulpSqlstmt.hostvalue[9].mSizeof = 0;
    ulpSqlstmt.hostvalue[9].mLen = 14+1;
    ulpSqlstmt.hostvalue[9].mMaxlen = sizeof(dbinfo.c_vald_term);
    ulpSqlstmt.hostvalue[9].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[9].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[9].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[10].mHostVar = (void*)(dbinfo.c_tag_crc);
    ulpSqlstmt.hostvalue[10].mHostInd = NULL;
    ulpSqlstmt.hostvalue[10].isstruct = 1;
    ulpSqlstmt.hostvalue[10].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[10].isarr = 0;
    ulpSqlstmt.hostvalue[10].mType = 6;
    ulpSqlstmt.hostvalue[10].mSizeof = 0;
    ulpSqlstmt.hostvalue[10].mLen = 2+1;
    ulpSqlstmt.hostvalue[10].mMaxlen = sizeof(dbinfo.c_tag_crc);
    ulpSqlstmt.hostvalue[10].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[10].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[10].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[11].mHostVar = (void*)(dbinfo.c_iss_date_tm);
    ulpSqlstmt.hostvalue[11].mHostInd = NULL;
    ulpSqlstmt.hostvalue[11].isstruct = 1;
    ulpSqlstmt.hostvalue[11].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[11].isarr = 0;
    ulpSqlstmt.hostvalue[11].mType = 6;
    ulpSqlstmt.hostvalue[11].mSizeof = 0;
    ulpSqlstmt.hostvalue[11].mLen = 14+1;
    ulpSqlstmt.hostvalue[11].mMaxlen = sizeof(dbinfo.c_iss_date_tm);
    ulpSqlstmt.hostvalue[11].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[11].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[11].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[12].mHostVar = (void*)&(dbinfo.n_sale_amt);
    ulpSqlstmt.hostvalue[12].mHostInd = NULL;
    ulpSqlstmt.hostvalue[12].isstruct = 1;
    ulpSqlstmt.hostvalue[12].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[12].isarr = 0;
    ulpSqlstmt.hostvalue[12].mType = 2;
    ulpSqlstmt.hostvalue[12].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[12].mLen = 0;
    ulpSqlstmt.hostvalue[12].mMaxlen = 0;
    ulpSqlstmt.hostvalue[12].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[12].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[12].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[13].mHostVar = (void*)(dbinfo.c_isnc_vhcl_no);
    ulpSqlstmt.hostvalue[13].mHostInd = NULL;
    ulpSqlstmt.hostvalue[13].isstruct = 1;
    ulpSqlstmt.hostvalue[13].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[13].isarr = 0;
    ulpSqlstmt.hostvalue[13].mType = 6;
    ulpSqlstmt.hostvalue[13].mSizeof = 0;
    ulpSqlstmt.hostvalue[13].mLen = 12+1;
    ulpSqlstmt.hostvalue[13].mMaxlen = sizeof(dbinfo.c_isnc_vhcl_no);
    ulpSqlstmt.hostvalue[13].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[13].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[13].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[14].mHostVar = (void*)(dbinfo.c_tag_atrb_dtl_cd);
    ulpSqlstmt.hostvalue[14].mHostInd = NULL;
    ulpSqlstmt.hostvalue[14].isstruct = 1;
    ulpSqlstmt.hostvalue[14].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[14].isarr = 0;
    ulpSqlstmt.hostvalue[14].mType = 6;
    ulpSqlstmt.hostvalue[14].mSizeof = 0;
    ulpSqlstmt.hostvalue[14].mLen = 2+1;
    ulpSqlstmt.hostvalue[14].mMaxlen = sizeof(dbinfo.c_tag_atrb_dtl_cd);
    ulpSqlstmt.hostvalue[14].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[14].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[14].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[15].mHostVar = (void*)(dbinfo.c_tag_vhcl_no);
    ulpSqlstmt.hostvalue[15].mHostInd = NULL;
    ulpSqlstmt.hostvalue[15].isstruct = 1;
    ulpSqlstmt.hostvalue[15].structsize = sizeof(dbinfo);
    ulpSqlstmt.hostvalue[15].isarr = 0;
    ulpSqlstmt.hostvalue[15].mType = 6;
    ulpSqlstmt.hostvalue[15].mSizeof = 0;
    ulpSqlstmt.hostvalue[15].mLen = 8+1;
    ulpSqlstmt.hostvalue[15].mMaxlen = sizeof(dbinfo.c_tag_vhcl_no);
    ulpSqlstmt.hostvalue[15].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[15].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[15].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        pk_fail = (struct rq_lnk_rslt *)rep;
        memset(pk_fail, 0x00, sizeof(struct rq_lnk_rslt));
        sprintf((char *)pk_fail->kind, "%02x", AZN_PERD_TAG_SALE_RSPNS);
        sprintf((char *)pk_fail->rslt, "0001");
        printf("SQLCODE = %d TCSO_PERD_TAG_SALE 기간권발행 wrk_date[%.8s] lane_no[%.2s]\n",
                SQLCODE, pk_in->wrk_date, pk_in->wrk_no);
        return(1);
    }else
    {
        pk_snd = (struct tag_iss_sale_rq *)rep;
        memset(pk_snd, 0x00, sizeof(struct tag_iss_sale_rq));
        sprintf((char *)pk_snd->occ_datetm, "%.14s", dbinfo.c_iss_date_tm);
        sprintf((char *)pk_snd->tag_id, "%.24s", dbinfo.c_tag_id);
        sprintf((char *)pk_snd->iss_code, "%.2s", dbinfo.c_iss_comp_cd);
        sprintf((char *)pk_snd->wrk_date, "%.8s", dbinfo.c_work_date);
        sprintf((char *)pk_snd->plz_id, "%.6s", dbinfo.c_plz_id);
        sprintf((char *)pk_snd->wrk_no, "%.4s", dbinfo.c_work_no);
        sprintf((char *)pk_snd->serial_no, "%08d", dbinfo.n_prcs_seq);
        sprintf((char *)pk_snd->wrkr_no, "%.6s", dbinfo.c_workr_no);
        sprintf((char *)pk_snd->tag_atrb, "1");
        sprintf((char *)pk_snd->tag_dtl_code, "%.2s", dbinfo.c_tag_atrb_dtl_cd);
        pk_snd->tag_vhcl_clss = dbinfo.c_tag_vhcl_clss[0];
        sprintf((char *)pk_snd->tag_vald_term, "%.10s", dbinfo.c_vald_term);
        sprintf((char *)pk_snd->tag_vhcl_no, "%.8s", dbinfo.c_tag_vhcl_no);
        sprintf((char *)pk_snd->vhcl_no, "%.12s", dbinfo.c_isnc_vhcl_no);
        sprintf((char *)pk_snd->tag_crc, "%.2s", dbinfo.c_tag_crc);
    }
    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_prev_tr_info()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 직전거래 Data를 조회.
 *========================================================================
*/

int proc_prev_tr_info(char *target, char *rep)
{
    struct rcv_lane_data  *rd;
    struct    hi_betran_rq       *pk_in;
    struct    rq_betran_rslt_tbl *pk_snd;
    int  i, rowcnt = 0;

    struct  db_iss_info dbinfo;
    char carno[12+1];
    char vhcl_no[12+1];
    char tagid[24+1];
    int  rqseq, retran, tagcnt = 0;


    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_betran_rq *)rd->buf;
    memset(carno, 0x00, sizeof(carno));
    pk_snd = (struct rq_betran_rslt_tbl *)rep;
    memset(pk_snd, 0x00, sizeof(struct rq_betran_rslt_tbl));
    e_memcpy(carno, pk_in->vhcl_no);
    rqseq = lb_data2atoi((char *)pk_in->req_seq, 8);

    if(memcmp(pk_in->div, "01", 2) == 0)
    {
        /*  
        SELECT COUNT(TAG_ID) 
                     
        FROM  OPRM_ISNC_INFO 
        WHERE ISNC_VHCL_NO = :carno 
        ORDER BY TAG_ID 
        ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT COUNT(TAG_ID) "
"                     "
"        FROM  OPRM_ISNC_INFO "
"        WHERE ISNC_VHCL_NO = ?  "
"        ORDER BY TAG_ID "
"        ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)&(tagcnt);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 2;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[0].mLen = 0;
    ulpSqlstmt.hostvalue[0].mMaxlen = 0;
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(carno);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 12+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(carno);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


        if (SQLCODE < 0)
        {
            sprintf((char *)pk_snd->kind, "%02x", AZN_PREV_TR_INFO);
            sprintf((char *)pk_snd->rs_cnt, "%08d", tagcnt);
            sprintf((char *)pk_snd->snd_cnt, "%08d", rowcnt);



            sprintf((char *)pk_snd->betran_info[0].betran_div, "04");

            printf("SQLCODE = %d OPRM_ISNC_INFO [%.2s] Count Fail\n", SQLCODE, pk_in->div);
            return(-1);
        }

        /*  DECLARE OPRM_ISNC_INFO_S CURSOR FOR 
        SELECT 
              TAG_ID, 
              ISNC_VHCL_NO 
        FROM  OPRM_ISNC_INFO 
        WHERE ISNC_VHCL_NO = :carno 
        AND   ROWNUM >= :rqseq 
        ORDER BY TAG_ID 
        ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 12;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.curname = (char*) "OPRM_ISNC_INFO_S";
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT "
"              TAG_ID, "
"              ISNC_VHCL_NO "
"        FROM  OPRM_ISNC_INFO "
"        WHERE ISNC_VHCL_NO = ?  "
"        AND   ROWNUM >= ?  "
"        ORDER BY TAG_ID "
"        ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(carno);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 12+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(carno);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)&(rqseq);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 2;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[1].mLen = 0;
    ulpSqlstmt.hostvalue[1].mMaxlen = 0;
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


        /*  OPEN OPRM_ISNC_INFO_S; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpSqlstmt.stmttype = 13;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.curname = (char*) "OPRM_ISNC_INFO_S";
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 0;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}

        if (SQLCODE < 0)
        {
            sprintf((char *)pk_snd->kind, "%02x", AZN_PREV_TR_INFO);
            sprintf((char *)pk_snd->rs_cnt, "%08d", tagcnt);
            sprintf((char *)pk_snd->snd_cnt, "%08d", rowcnt);



            sprintf((char *)pk_snd->betran_info[0].betran_div, "04");

            printf("SQLCODE = %d OPRM_ISNC_INFO [%.2s]Select Fail\n", SQLCODE, pk_in->div);
            return(-1);
        }

    }else if(memcmp(pk_in->div, "02", 2) == 0)
    {
        /*  
        SELECT COUNT(TAG_ID) 
                     
        FROM  OPRM_ISNC_INFO 
        WHERE NO_VHCL_NO = :carno 
        ORDER BY TAG_ID 
        ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT COUNT(TAG_ID) "
"                     "
"        FROM  OPRM_ISNC_INFO "
"        WHERE NO_VHCL_NO = ?  "
"        ORDER BY TAG_ID "
"        ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)&(tagcnt);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 2;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[0].mLen = 0;
    ulpSqlstmt.hostvalue[0].mMaxlen = 0;
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(carno);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 12+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(carno);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


        if (SQLCODE < 0)
        {
            sprintf((char *)pk_snd->kind, "%02x", AZN_PREV_TR_INFO);
            sprintf((char *)pk_snd->rs_cnt, "%08d", tagcnt);
            sprintf((char *)pk_snd->snd_cnt, "%08d", rowcnt);



            sprintf((char *)pk_snd->betran_info[0].betran_div, "04");

            printf("SQLCODE = %d OPRM_ISNC_INFO [%.2s] Count Fail\n", SQLCODE, pk_in->div);
            return(-1);
        }

        /*  DECLARE OPRM_ISNC_INFO_S CURSOR FOR 
        SELECT 
              TAG_ID, 
              ISNC_VHCL_NO 
        FROM  OPRM_ISNC_INFO 
        WHERE NO_VHCL_NO = :carno 
        AND   ROWNUM >= :rqseq 
        ORDER BY TAG_ID 
        ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 12;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.curname = (char*) "OPRM_ISNC_INFO_S";
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT "
"              TAG_ID, "
"              ISNC_VHCL_NO "
"        FROM  OPRM_ISNC_INFO "
"        WHERE NO_VHCL_NO = ?  "
"        AND   ROWNUM >= ?  "
"        ORDER BY TAG_ID "
"        ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(carno);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 12+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(carno);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)&(rqseq);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 2;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[1].mLen = 0;
    ulpSqlstmt.hostvalue[1].mMaxlen = 0;
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


        /*  OPEN OPRM_ISNC_INFO_S; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpSqlstmt.stmttype = 13;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.curname = (char*) "OPRM_ISNC_INFO_S";
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 0;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}

        if (SQLCODE < 0)
        {
            sprintf((char *)pk_snd->kind, "%02x", AZN_PREV_TR_INFO);
            sprintf((char *)pk_snd->rs_cnt, "%08d", tagcnt);
            sprintf((char *)pk_snd->snd_cnt, "%08d", rowcnt);



            sprintf((char *)pk_snd->betran_info[0].betran_div, "04");

            printf("SQLCODE = %d OPRM_ISNC_INFO [%.2s]Select Fail\n", SQLCODE, pk_in->div);
            return(-1);
        }

    }else
        return(-1);
    printf("직전거래 조회 결과 TAG CNT[%d][%d]\n", tagcnt, rowcnt);
    if(tagcnt == 0)
    {
        sprintf((char *)pk_snd->kind, "%02x", AZN_PREV_TR_INFO);
        sprintf((char *)pk_snd->rs_cnt, "%08d", tagcnt);
        sprintf((char *)pk_snd->snd_cnt, "%08d", rowcnt);



        sprintf((char *)pk_snd->betran_info[0].betran_div, "03");

        memcpy(pk_snd->betran_info[0].tag_id, tagid, sizeof(pk_snd->betran_info[i].tag_id));
        memcpy(pk_snd->betran_info[0].tag_vhcl_no, vhcl_no, sizeof(pk_snd->betran_info[i].tag_vhcl_no));

        return(0);
    }

    sprintf((char *)pk_snd->kind, "%02x", AZN_PREV_TR_INFO);
    sprintf((char *)pk_snd->rs_cnt, "%08d", tagcnt);
    for(i = 0; i<25; i++)
    {
        memset(&tagid, 0x00, sizeof(tagid));

        /*  FETCH OPRM_ISNC_INFO_S INTO                 ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 14;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.curname = (char*) "OPRM_ISNC_INFO_S";
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(tagid);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 24+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(tagid);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(vhcl_no);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 12+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(vhcl_no);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


        /*  WHENEVER NOT FOUND DO break; */

        if( sqlca.sqlcode != 0  && sqlca.sqlcode != 100)
        {



            sprintf((char *)pk_snd->betran_info[i].betran_div, "04");

            printf( "FETCH OPRM_ISNC_INFO_S failed [%d]\n", sqlca.sqlcode );
            return(-1);
        }

        memcpy(pk_snd->betran_info[i].tag_id, tagid, sizeof(pk_snd->betran_info[i].tag_id));
        memcpy(pk_snd->betran_info[i].tag_vhcl_no, vhcl_no, sizeof(pk_snd->betran_info[i].tag_vhcl_no));

printf("직전거래 조회 결과[%d] TAGID[%.24s] CARNO[%.12s]\n", i, tagid, vhcl_no);

        memset(&dbinfo, 0x00, sizeof(dbinfo));
        /*  
        SELECT TR_DATE_TM, TR_AMT, CHRG_YN 
                                                                  
        FROM 
        ( 
            SELECT * 
            FROM TCSO_RGSTR_TAG_CHRG 
            WHERE TAG_ID = :tagid 
            ORDER BY TR_DATE_TM DESC 
        ) 
        WHERE ROWNUM = 1; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[4];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 4;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT TR_DATE_TM, TR_AMT, CHRG_YN "
"                                                                  "
"        FROM "
"        ( "
"            SELECT * "
"            FROM TCSO_RGSTR_TAG_CHRG "
"            WHERE TAG_ID = ?  "
"            ORDER BY TR_DATE_TM DESC "
"        ) "
"        WHERE ROWNUM = 1";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(dbinfo.datetime);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 14+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(dbinfo.datetime);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)&(dbinfo.tag_balc);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 2;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[1].mLen = 0;
    ulpSqlstmt.hostvalue[1].mMaxlen = 0;
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(dbinfo.chrg_div);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].isstruct = 0;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 1+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(dbinfo.chrg_div);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(tagid);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].isstruct = 0;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 24+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(tagid);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
    if(sqlca.sqlcode == SQL_NO_DATA) break;
}


        if (SQLCODE == 100)
        {



            sprintf((char *)pk_snd->betran_info[i].betran_div, "03");

            continue;
        }

        if (SQLCODE < 0)
        {



            sprintf((char *)pk_snd->betran_info[i].betran_div, "04");

            printf("SQLCODE = %d TCSO_RGSTR_TAG_CHRG [%.24s]Select Fail\n", SQLCODE, tagid);
            return(-1);
        }

        /*  
        SELECT COUNT(WORK_DATE) 
                     
        FROM PUBO_OUT_WAY_PRCS 
        WHERE PRCS_DATE_TM >= :dbinfo.datetime; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT COUNT(WORK_DATE) "
"                     "
"        FROM PUBO_OUT_WAY_PRCS "
"        WHERE PRCS_DATE_TM >= ? ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)&(retran);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 2;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[0].mLen = 0;
    ulpSqlstmt.hostvalue[0].mMaxlen = 0;
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(dbinfo.datetime);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 14+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(dbinfo.datetime);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
    if(sqlca.sqlcode == SQL_NO_DATA) break;
}


        if (SQLCODE < 0)
        {



            sprintf((char *)pk_snd->betran_info[i].betran_div, "04");

            printf("SQLCODE = %d PUBO_OUT_WAY_PRCS [%.14s]Count Fail\n", SQLCODE, dbinfo.datetime);
            return(-1);
        }

        if(retran > 0)
        {
            /*  
            SELECT PRCS_DATE_TM, RCPT_TOLL 
                                                    
            FROM PUBO_OUT_WAY_PRCS 
            WHERE PRCS_DATE_TM >= :dbinfo.datetime; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[3];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 3;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT PRCS_DATE_TM, RCPT_TOLL "
"                                                    "
"            FROM PUBO_OUT_WAY_PRCS "
"            WHERE PRCS_DATE_TM >= ? ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(dbinfo.datetime);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 14+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(dbinfo.datetime);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)&(dbinfo.tag_balc);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 2;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[1].mLen = 0;
    ulpSqlstmt.hostvalue[1].mMaxlen = 0;
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(dbinfo.datetime);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].isstruct = 0;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 14+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(dbinfo.datetime);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
    if(sqlca.sqlcode == SQL_NO_DATA) break;
}


            if (SQLCODE < 0)
            {



                sprintf((char *)pk_snd->betran_info[i].betran_div, "04");

                printf("SQLCODE = %d PUBO_OUT_WAY_PRCS [%.14s]Count Fail\n", SQLCODE, dbinfo.datetime);
                return(-1);
            }




            sprintf((char *)pk_snd->betran_info[i].betran_div, "01");

            memcpy(pk_snd->betran_info[i].betran_datetm, dbinfo.datetime, sizeof(pk_snd->betran_info[i].betran_datetm));
            sprintf((char *)pk_snd->betran_info[i].betran_mny, "%08d", dbinfo.tag_balc);
        }else
        {
            if(memcmp(dbinfo.chrg_div, "0", 1) == 0){



                sprintf((char *)pk_snd->betran_info[i].betran_div, "00");

            }else if(memcmp(dbinfo.chrg_div, "1", 1) == 0){



                sprintf((char *)pk_snd->betran_info[i].betran_div, "02");

            }
            memcpy(pk_snd->betran_info[i].betran_datetm, dbinfo.datetime, sizeof(pk_snd->betran_info[i].betran_datetm));
            sprintf((char *)pk_snd->betran_info[i].betran_mny, "%08d", dbinfo.tag_balc);
        }
        rowcnt++;
    }
    printf("발행정보 조회결과 SND CNT[%d]\n", rowcnt);
    sprintf((char *)pk_snd->snd_cnt, "%04d", rowcnt);

    printf("END\n");
    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_tag_info()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : TAG정보 Data를 조회.
 *========================================================================
*/

int proc_tag_info(char *target, char *rep)
{
    struct rcv_lane_data  *rd;
    struct    hi_tag_info_srch  *pk_in;
    struct    rq_tag_info_tbl   *pk_snd;

    struct  db_iss_info dbinfo;
    char tagid[24+1];
    int  blnc = 0, blyn, tagcnt = 0;


    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_tag_info_srch *)rd->buf;
    memset(tagid, 0x00, sizeof(tagid));

    pk_snd = (struct rq_tag_info_tbl *)rep;
printf("1");
    memset(pk_snd, 0x00, sizeof(struct rq_tag_info_tbl));

    e_memcpy(tagid, pk_in->tag_no);

    if(memcmp(pk_in->type, "01", 2) == 0)
    {
        /*  
        SELECT COUNT(TAG_ID) 
                     
        FROM OPRM_ISNC_INFO 
        WHERE TAG_ID = :tagid; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT COUNT(TAG_ID) "
"                     "
"        FROM OPRM_ISNC_INFO "
"        WHERE TAG_ID = ? ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)&(tagcnt);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 2;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[0].mLen = 0;
    ulpSqlstmt.hostvalue[0].mMaxlen = 0;
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(tagid);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 24+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(tagid);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


        if (SQLCODE < 0)
        {
            sprintf((char *)pk_snd->kind, "%02x", AZN_REQ_TAG_INFO);
            sprintf((char *)pk_snd->rslt, "%.2s", "02");
            e_memcpy(pk_snd->tag_id, pk_in->tag_no);
            printf("SQLCODE = %d OPRM_ISNC_INFO [%.2s] Count Fail\n", SQLCODE, pk_in->type);
            return(-1);
        }

        if(tagcnt == 0)
        {
            sprintf((char *)pk_snd->kind, "%02x", AZN_REQ_TAG_INFO);
            sprintf((char *)pk_snd->rslt, "%.2s", "03");
            e_memcpy(pk_snd->tag_id, pk_in->tag_no);
            return(0);
        }

        /*  
        SELECT BL_YN 
                   
        FROM ( 
        SELECT * 
        FROM  OPRM_ISNC_INFO 
        WHERE TAG_ID = :tagid 
        ORDER BY LAST_PRCS_DATE_TM DESC 
        ) 
        WHERE ROWNUM = 1; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT BL_YN "
"                   "
"        FROM ( "
"        SELECT * "
"        FROM  OPRM_ISNC_INFO "
"        WHERE TAG_ID = ?  "
"        ORDER BY LAST_PRCS_DATE_TM DESC "
"        ) "
"        WHERE ROWNUM = 1";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)&(blyn);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 2;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[0].mLen = 0;
    ulpSqlstmt.hostvalue[0].mMaxlen = 0;
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(tagid);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 24+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(tagid);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


        if (SQLCODE < 0)
        {
            sprintf((char *)pk_snd->kind, "%02x", AZN_REQ_TAG_INFO);
            sprintf((char *)pk_snd->rslt, "%.2s", "02");
            e_memcpy(pk_snd->tag_id, pk_in->tag_no);
            printf("SQLCODE = %d OPRM_ISNC_INFO [%.2s] BL Check Fail\n", SQLCODE, pk_in->type);
            return(-1);
        }

        if(blyn == 0)
        {
            printf("TAG정보 조회 결과 BL 유무[%d]\n", blyn);
            sprintf((char *)pk_snd->kind, "%02x", AZN_REQ_TAG_INFO);
            sprintf((char *)pk_snd->rslt, "%.2s", "01");
            e_memcpy(pk_snd->tag_id, pk_in->tag_no);
            return(0);
        }
    }else
        return(-1);

    sprintf((char *)pk_snd->kind, "%02x", AZN_REQ_TAG_INFO);
    sprintf((char *)pk_snd->rslt, "00");

    /*  
    SELECT BLNC 
               
    FROM ( 
            SELECT BLNC 
            FROM   OPRC_BLNC_INFO 
            WHERE TAG_ID = :tagid 
            ORDER BY BLNC_RECV_DATE_TM DESC 
         ) 
    WHERE ROWNUM = 1 
    ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT BLNC "
"               "
"    FROM ( "
"            SELECT BLNC "
"            FROM   OPRC_BLNC_INFO "
"            WHERE TAG_ID = ?  "
"            ORDER BY BLNC_RECV_DATE_TM DESC "
"         ) "
"    WHERE ROWNUM = 1 "
"    ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)&(blnc);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 2;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[0].mLen = 0;
    ulpSqlstmt.hostvalue[0].mMaxlen = 0;
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(tagid);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 24+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(tagid);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        sprintf((char *)pk_snd->kind, "%02x", AZN_REQ_TAG_INFO);
        sprintf((char *)pk_snd->rslt, "%.2s", "02");
        e_memcpy(pk_snd->tag_id, pk_in->tag_no);
        printf("SQLCODE = %d OPRC_BLNC_INFO [%.24s]Count Fail\n", SQLCODE, tagid);
        return(-1);
    }

    if(blnc == 0)
    {
        /*  
        SELECT COUNT(BLNC) 
                   
        FROM ( 
                SELECT BLNC 
                FROM   OPRM_BLNC_INFO 
                WHERE TAG_ID = :tagid 
                ORDER BY BLNC_RECV_DATE_TM DESC 
             ) 
        WHERE ROWNUM = 1 
        ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[2];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 2;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT COUNT(BLNC) "
"                   "
"        FROM ( "
"                SELECT BLNC "
"                FROM   OPRM_BLNC_INFO "
"                WHERE TAG_ID = ?  "
"                ORDER BY BLNC_RECV_DATE_TM DESC "
"             ) "
"        WHERE ROWNUM = 1 "
"        ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)&(blnc);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 2;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[0].mLen = 0;
    ulpSqlstmt.hostvalue[0].mMaxlen = 0;
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(tagid);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 24+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(tagid);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}

        if (SQLCODE < 0)
        {
            sprintf((char *)pk_snd->kind, "%02x", AZN_REQ_TAG_INFO);
            sprintf((char *)pk_snd->rslt, "%.2s", "02");
            e_memcpy(pk_snd->tag_id, pk_in->tag_no);
            printf("SQLCODE = %d OPRM_BLNC_INFO [%.24s]Count Fail\n", SQLCODE, tagid);
            return(-1);
        }
    }

    sprintf((char *)pk_snd->tag_blnc, "%08d", blnc);

    memset(&dbinfo, 0x00, sizeof(dbinfo));
    /*  
    SELECT 
        RPAD(NVL(TAG_ID         , ' '), 24, ' '), 
        LPAD(NVL(ISS_COMP_CD    , ' '),  2, ' '), 
        LPAD(NVL(TAG_VHCL_CLSS  , ' '),  1, ' '), 
        LPAD(NVL(TAG_ATRB       , ' '),  1, ' '), 
        LPAD(NVL(TAG_ATRB_DTL_CD, ' '),  2, ' '), 
        RPAD(NVL(ISNC_VHCL_NO   , ' '), 12, ' '), 
        RPAD(NVL(VALD_TERM      , ' '), 10, ' '), 
        RPAD(NVL(TAG_CRC        , ' '),  2, ' ') 
                                                                                                         
                                                                     
    FROM  OPRM_ISNC_INFO 
    WHERE TAG_ID = :tagid 
    ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[9];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 9;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT "
"        RPAD(NVL(TAG_ID         , ' '), 24, ' '), "
"        LPAD(NVL(ISS_COMP_CD    , ' '),  2, ' '), "
"        LPAD(NVL(TAG_VHCL_CLSS  , ' '),  1, ' '), "
"        LPAD(NVL(TAG_ATRB       , ' '),  1, ' '), "
"        LPAD(NVL(TAG_ATRB_DTL_CD, ' '),  2, ' '), "
"        RPAD(NVL(ISNC_VHCL_NO   , ' '), 12, ' '), "
"        RPAD(NVL(VALD_TERM      , ' '), 10, ' '), "
"        RPAD(NVL(TAG_CRC        , ' '),  2, ' ') "
"                                                                                                         "
"                                                                     "
"    FROM  OPRM_ISNC_INFO "
"    WHERE TAG_ID = ?  "
"    ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(dbinfo.tag_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 24+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(dbinfo.tag_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(dbinfo.tag_iss);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 2+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(dbinfo.tag_iss);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(dbinfo.tag_vhcl_clss);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].isstruct = 0;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 1+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(dbinfo.tag_vhcl_clss);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(dbinfo.tag_atrb);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].isstruct = 0;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 1+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(dbinfo.tag_atrb);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)(dbinfo.tag_dtl_code);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 6;
    ulpSqlstmt.hostvalue[4].isstruct = 0;
    ulpSqlstmt.hostvalue[4].mSizeof = 0;
    ulpSqlstmt.hostvalue[4].mLen = 2+1;
    ulpSqlstmt.hostvalue[4].mMaxlen = sizeof(dbinfo.tag_dtl_code);
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(dbinfo.tag_vhcl_no);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].isstruct = 0;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 12+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(dbinfo.tag_vhcl_no);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(dbinfo.tag_vald_term);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].isstruct = 0;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 10+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(dbinfo.tag_vald_term);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)(dbinfo.tag_crc);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 6;
    ulpSqlstmt.hostvalue[7].isstruct = 0;
    ulpSqlstmt.hostvalue[7].mSizeof = 0;
    ulpSqlstmt.hostvalue[7].mLen = 2+1;
    ulpSqlstmt.hostvalue[7].mMaxlen = sizeof(dbinfo.tag_crc);
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)(tagid);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 6;
    ulpSqlstmt.hostvalue[8].isstruct = 0;
    ulpSqlstmt.hostvalue[8].mSizeof = 0;
    ulpSqlstmt.hostvalue[8].mLen = 24+1;
    ulpSqlstmt.hostvalue[8].mMaxlen = sizeof(tagid);
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        sprintf((char *)pk_snd->kind, "%02x", AZN_REQ_TAG_INFO);
        sprintf((char *)pk_snd->rslt, "%.2s", "02");
        e_memcpy(pk_snd->tag_id, pk_in->tag_no);
        printf("SQLCODE = %d OPRM_ISNC_INFO [%.24s]Select Fail\n", SQLCODE, tagid);
        return(-1);
    }

    memcpy(pk_snd->tag_id, dbinfo.tag_id, sizeof(pk_snd->tag_id));
    memcpy(pk_snd->iss_comp, dbinfo.tag_iss, sizeof(pk_snd->iss_comp));

    pk_snd->tag_vhcl_clss = dbinfo.tag_vhcl_clss[0];
    pk_snd->tag_atrb = dbinfo.tag_atrb[0];

    memcpy(pk_snd->tag_dtl_code, dbinfo.tag_dtl_code, sizeof(pk_snd->tag_dtl_code));
    memcpy(pk_snd->tag_vhcl_no, dbinfo.tag_vhcl_no, sizeof(pk_snd->tag_vhcl_no));
    memcpy(pk_snd->vald_term, dbinfo.tag_vald_term, sizeof(pk_snd->vald_term));
    memcpy(pk_snd->tag_crc, dbinfo.tag_crc, sizeof(pk_snd->tag_crc));

    /*  
    SELECT 
        LPAD(NVL(PLZ_ID        , ' '), 6, ' '), 
        LPAD(NVL(WORK_DATE     , ' '), 8, ' '), 
        LPAD(NVL(WORK_NO       , ' '), 4, ' '), 
        LPAD(NVL(PRCS_SEQ      ,  0 ), 8,  0 ), 
        LPAD(NVL(SENS_VHCL_CLSS, ' '), 1, ' '), 
        LPAD(NVL(PRCS_VHCL_CLSS, ' '), 1, ' '), 
        LPAD(NVL(PRCS_DATE_TM  , ' '),14, ' ') 
                                                                                                                                                   
    FROM 
    ( 
        SELECT PLZ_ID, WORK_DATE, WORK_NO, PRCS_SEQ, SENS_VHCL_CLSS, PRCS_VHCL_CLSS, PRCS_DATE_TM 
        FROM   PUBO_IN_WAY_PRCS 
        WHERE  TAG_ID = :tagid 
        ORDER BY PRCS_DATE_TM DESC 
    ) 
    WHERE ROWNUM = 1 
    ; */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[8];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 4;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 8;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"SELECT "
"        LPAD(NVL(PLZ_ID        , ' '), 6, ' '), "
"        LPAD(NVL(WORK_DATE     , ' '), 8, ' '), "
"        LPAD(NVL(WORK_NO       , ' '), 4, ' '), "
"        LPAD(NVL(PRCS_SEQ      ,  0 ), 8,  0 ), "
"        LPAD(NVL(SENS_VHCL_CLSS, ' '), 1, ' '), "
"        LPAD(NVL(PRCS_VHCL_CLSS, ' '), 1, ' '), "
"        LPAD(NVL(PRCS_DATE_TM  , ' '),14, ' ') "
"                                                                                                                                                   "
"    FROM "
"    ( "
"        SELECT PLZ_ID, WORK_DATE, WORK_NO, PRCS_SEQ, SENS_VHCL_CLSS, PRCS_VHCL_CLSS, PRCS_DATE_TM "
"        FROM   PUBO_IN_WAY_PRCS "
"        WHERE  TAG_ID = ?  "
"        ORDER BY PRCS_DATE_TM DESC "
"    ) "
"    WHERE ROWNUM = 1 "
"    ";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(dbinfo.in_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].isstruct = 0;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(dbinfo.in_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(dbinfo.in_wrk_date);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].isstruct = 0;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 8+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(dbinfo.in_wrk_date);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(dbinfo.in_wrk_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].isstruct = 0;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 4+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(dbinfo.in_wrk_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)&(dbinfo.in_proc_no);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 2;
    ulpSqlstmt.hostvalue[3].isstruct = 0;
    ulpSqlstmt.hostvalue[3].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[3].mLen = 0;
    ulpSqlstmt.hostvalue[3].mMaxlen = 0;
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)(dbinfo.in_sens_knd);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 6;
    ulpSqlstmt.hostvalue[4].isstruct = 0;
    ulpSqlstmt.hostvalue[4].mSizeof = 0;
    ulpSqlstmt.hostvalue[4].mLen = 1+1;
    ulpSqlstmt.hostvalue[4].mMaxlen = sizeof(dbinfo.in_sens_knd);
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(dbinfo.in_proc_knd);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].isstruct = 0;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 1+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(dbinfo.in_proc_knd);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(dbinfo.datetime);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].isstruct = 0;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 14+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(dbinfo.datetime);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 1;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)(tagid);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 6;
    ulpSqlstmt.hostvalue[7].isstruct = 0;
    ulpSqlstmt.hostvalue[7].mSizeof = 0;
    ulpSqlstmt.hostvalue[7].mLen = 24+1;
    ulpSqlstmt.hostvalue[7].mMaxlen = sizeof(tagid);
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 0;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        sprintf((char *)pk_snd->kind, "%02x", AZN_REQ_TAG_INFO);
        sprintf((char *)pk_snd->rslt, "%.2s", "02");
        e_memcpy(pk_snd->tag_id, pk_in->tag_no);
        printf("SQLCODE = %d PUBO_IN_WAY_PRCS [%.24s]Select Fail\n", SQLCODE, tagid);
        return(-1);
    }

    memcpy(pk_snd->in_way_plz_id, dbinfo.in_plz_id, sizeof(pk_snd->in_way_plz_id));
    memcpy(pk_snd->in_way_wrk_date, dbinfo.in_wrk_date, sizeof(pk_snd->in_way_wrk_date));
    memcpy(pk_snd->in_way_wrk_no, dbinfo.in_wrk_no, sizeof(pk_snd->in_way_wrk_no));

    sprintf((char *)pk_snd->in_way_proc_no, "%08d", dbinfo.in_proc_no);
    pk_snd->in_way_sense_vhcl_clss = dbinfo.in_sens_knd[0];
    pk_snd->in_way_hnd_vhcl_clss = dbinfo.in_proc_knd[0];
    memcpy(pk_snd->in_way_entry_datetm, dbinfo.datetime, sizeof(pk_snd->in_way_entry_datetm));

    printf("END\n");
    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_in_spcl()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 입구특별처리 Data를 처리.
 *========================================================================
*/

int proc_in_spcl(char *target)
{
    struct rcv_lane_data  *rd;
    struct    hi_in_way_spcl_hnd   *pk_in;

    struct    tcso_in_way_spcl  tcso_in_way_spcl;


    memset((char *)&tcso_in_way_spcl, 0, sizeof(tcso_in_way_spcl));
    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_in_way_spcl_hnd *)rd->buf;

    e_memcpy(tcso_in_way_spcl.c_plz_id,    rd->plz_id         );
    e_memcpy(tcso_in_way_spcl.c_work_date, pk_in->wrk_date);
    e_memcpy(tcso_in_way_spcl.c_work_no,   pk_in->wrk_no  );
    e_memcpy(tcso_in_way_spcl.c_workr_no,  pk_in->wrkr_no );

    tcso_in_way_spcl.d_prcs_seq = lb_data2atoi((char *)pk_in->serial_no, 8);

    e_memcpy(tcso_in_way_spcl.c_spcl_prcs_cd,  pk_in->spc_hnd_code);
    e_memcpy(tcso_in_way_spcl.c_occrn_date_tm, pk_in->datetm);

    tcso_in_way_spcl.c_tag_rgst_vhcl_clss[0] = pk_in->old_vhcl_clss;
    tcso_in_way_spcl.c_dtrm_vhcl_clss[0] = pk_in->new_vhcl_clss;
    tcso_in_way_spcl.c_axle_cd[0] = pk_in->axle_code[1];
    e_memcpy(tcso_in_way_spcl.c_vhcl_no,   pk_in->vhcl_no);

    /*  INSERT INTO TCSO_IN_WAY_SPCL VALUES (:tcso_in_way_spcl); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[11];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 11;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO TCSO_IN_WAY_SPCL VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(tcso_in_way_spcl.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(tcso_in_way_spcl);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(tcso_in_way_spcl.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(tcso_in_way_spcl.c_work_date);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(tcso_in_way_spcl);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 8+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(tcso_in_way_spcl.c_work_date);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(tcso_in_way_spcl.c_work_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(tcso_in_way_spcl);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 4+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(tcso_in_way_spcl.c_work_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(tcso_in_way_spcl.c_workr_no);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(tcso_in_way_spcl);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 6+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(tcso_in_way_spcl.c_workr_no);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)&(tcso_in_way_spcl.d_prcs_seq);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isstruct = 1;
    ulpSqlstmt.hostvalue[4].structsize = sizeof(tcso_in_way_spcl);
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 2;
    ulpSqlstmt.hostvalue[4].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[4].mLen = 0;
    ulpSqlstmt.hostvalue[4].mMaxlen = 0;
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(tcso_in_way_spcl.c_spcl_prcs_cd);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isstruct = 1;
    ulpSqlstmt.hostvalue[5].structsize = sizeof(tcso_in_way_spcl);
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 2+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(tcso_in_way_spcl.c_spcl_prcs_cd);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(tcso_in_way_spcl.c_occrn_date_tm);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isstruct = 1;
    ulpSqlstmt.hostvalue[6].structsize = sizeof(tcso_in_way_spcl);
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 14+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(tcso_in_way_spcl.c_occrn_date_tm);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)(tcso_in_way_spcl.c_tag_rgst_vhcl_clss);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isstruct = 1;
    ulpSqlstmt.hostvalue[7].structsize = sizeof(tcso_in_way_spcl);
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 6;
    ulpSqlstmt.hostvalue[7].mSizeof = 0;
    ulpSqlstmt.hostvalue[7].mLen = 1+1;
    ulpSqlstmt.hostvalue[7].mMaxlen = sizeof(tcso_in_way_spcl.c_tag_rgst_vhcl_clss);
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)(tcso_in_way_spcl.c_dtrm_vhcl_clss);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isstruct = 1;
    ulpSqlstmt.hostvalue[8].structsize = sizeof(tcso_in_way_spcl);
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 6;
    ulpSqlstmt.hostvalue[8].mSizeof = 0;
    ulpSqlstmt.hostvalue[8].mLen = 1+1;
    ulpSqlstmt.hostvalue[8].mMaxlen = sizeof(tcso_in_way_spcl.c_dtrm_vhcl_clss);
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[9].mHostVar = (void*)(tcso_in_way_spcl.c_axle_cd);
    ulpSqlstmt.hostvalue[9].mHostInd = NULL;
    ulpSqlstmt.hostvalue[9].isstruct = 1;
    ulpSqlstmt.hostvalue[9].structsize = sizeof(tcso_in_way_spcl);
    ulpSqlstmt.hostvalue[9].isarr = 0;
    ulpSqlstmt.hostvalue[9].mType = 6;
    ulpSqlstmt.hostvalue[9].mSizeof = 0;
    ulpSqlstmt.hostvalue[9].mLen = 1+1;
    ulpSqlstmt.hostvalue[9].mMaxlen = sizeof(tcso_in_way_spcl.c_axle_cd);
    ulpSqlstmt.hostvalue[9].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[9].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[9].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[10].mHostVar = (void*)(tcso_in_way_spcl.c_vhcl_no);
    ulpSqlstmt.hostvalue[10].mHostInd = NULL;
    ulpSqlstmt.hostvalue[10].isstruct = 1;
    ulpSqlstmt.hostvalue[10].structsize = sizeof(tcso_in_way_spcl);
    ulpSqlstmt.hostvalue[10].isarr = 0;
    ulpSqlstmt.hostvalue[10].mType = 6;
    ulpSqlstmt.hostvalue[10].mSizeof = 0;
    ulpSqlstmt.hostvalue[10].mLen = 12+1;
    ulpSqlstmt.hostvalue[10].mMaxlen = sizeof(tcso_in_way_spcl.c_vhcl_no);
    ulpSqlstmt.hostvalue[10].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[10].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[10].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("SQLCODE = %d TCSO_IN_WAY_SPCL 입구특별 wrk_date[%.8s] lane_no[%.2s]\n",
                SQLCODE, pk_in->wrk_date, pk_in->wrk_no);
        return(-1);
    }
    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_ofc_data()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 사무실 Data를 처리.
 *========================================================================
*/

int proc_ofc_data(char *target)
{
    struct rcv_lane_data  *rd;
    struct hi_ofc_data *pk_in;

    struct    tcso_office       tcso_office;


    memset((char *)&tcso_office, 0, sizeof(tcso_office));
    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_ofc_data *)rd->buf;

    e_memcpy(tcso_office.c_plz_id,    rd->plz_id          );
    e_memcpy(tcso_office.c_work_date, pk_in->wrk_date);
    e_memcpy(tcso_office.c_work_no,   pk_in->wrk_no  );
    e_memcpy(tcso_office.c_workr_no,  pk_in->wrkr_no );

    tcso_office.n_prcs_seq = lb_data2atoi((char *)pk_in->serial_no, 8);

    e_memcpy(tcso_office.c_ofc_cd, pk_in->hnd_type);

    sprintf((char *)tcso_office.c_occrn_date_tm, "%.4s%.2s%.2s%.2s%.2s%.2s",
            pk_in->year, pk_in->month, pk_in->day,
            pk_in->hour, pk_in->min,   pk_in->sec);

    e_memcpy(tcso_office.c_sys_clss,     pk_in->sys_kind);
    tcso_office.c_tag_rgst_vhcl_clss[0] = pk_in->tag_rgst_vhcl_clss;
    tcso_office.c_vhcl_clss[0] = pk_in->tag_rgst_vhcl_clss;
    e_memcpy(tcso_office.c_bl_tag_id,    pk_in->nvald_tag_id);
    e_memcpy(tcso_office.c_prcs_vhcl_no, pk_in->vhcl_no);

    /*  INSERT INTO TCSO_OFFICE VALUES (:tcso_office); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[13];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 13;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO TCSO_OFFICE VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(tcso_office.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(tcso_office);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(tcso_office.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(tcso_office.c_work_date);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(tcso_office);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 8+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(tcso_office.c_work_date);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(tcso_office.c_work_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(tcso_office);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 4+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(tcso_office.c_work_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(tcso_office.c_workr_no);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(tcso_office);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 6+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(tcso_office.c_workr_no);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)&(tcso_office.n_prcs_seq);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isstruct = 1;
    ulpSqlstmt.hostvalue[4].structsize = sizeof(tcso_office);
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 2;
    ulpSqlstmt.hostvalue[4].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[4].mLen = 0;
    ulpSqlstmt.hostvalue[4].mMaxlen = 0;
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(tcso_office.c_ofc_cd);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isstruct = 1;
    ulpSqlstmt.hostvalue[5].structsize = sizeof(tcso_office);
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 2+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(tcso_office.c_ofc_cd);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(tcso_office.c_occrn_date_tm);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isstruct = 1;
    ulpSqlstmt.hostvalue[6].structsize = sizeof(tcso_office);
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 14+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(tcso_office.c_occrn_date_tm);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)(tcso_office.c_sys_clss);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isstruct = 1;
    ulpSqlstmt.hostvalue[7].structsize = sizeof(tcso_office);
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 6;
    ulpSqlstmt.hostvalue[7].mSizeof = 0;
    ulpSqlstmt.hostvalue[7].mLen = 2+1;
    ulpSqlstmt.hostvalue[7].mMaxlen = sizeof(tcso_office.c_sys_clss);
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)(tcso_office.c_tag_rgst_vhcl_clss);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isstruct = 1;
    ulpSqlstmt.hostvalue[8].structsize = sizeof(tcso_office);
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 6;
    ulpSqlstmt.hostvalue[8].mSizeof = 0;
    ulpSqlstmt.hostvalue[8].mLen = 1+1;
    ulpSqlstmt.hostvalue[8].mMaxlen = sizeof(tcso_office.c_tag_rgst_vhcl_clss);
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[9].mHostVar = (void*)(tcso_office.c_vhcl_clss);
    ulpSqlstmt.hostvalue[9].mHostInd = NULL;
    ulpSqlstmt.hostvalue[9].isstruct = 1;
    ulpSqlstmt.hostvalue[9].structsize = sizeof(tcso_office);
    ulpSqlstmt.hostvalue[9].isarr = 0;
    ulpSqlstmt.hostvalue[9].mType = 6;
    ulpSqlstmt.hostvalue[9].mSizeof = 0;
    ulpSqlstmt.hostvalue[9].mLen = 1+1;
    ulpSqlstmt.hostvalue[9].mMaxlen = sizeof(tcso_office.c_vhcl_clss);
    ulpSqlstmt.hostvalue[9].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[9].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[9].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[10].mHostVar = (void*)(tcso_office.c_bl_tag_id);
    ulpSqlstmt.hostvalue[10].mHostInd = NULL;
    ulpSqlstmt.hostvalue[10].isstruct = 1;
    ulpSqlstmt.hostvalue[10].structsize = sizeof(tcso_office);
    ulpSqlstmt.hostvalue[10].isarr = 0;
    ulpSqlstmt.hostvalue[10].mType = 6;
    ulpSqlstmt.hostvalue[10].mSizeof = 0;
    ulpSqlstmt.hostvalue[10].mLen = 16+1;
    ulpSqlstmt.hostvalue[10].mMaxlen = sizeof(tcso_office.c_bl_tag_id);
    ulpSqlstmt.hostvalue[10].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[10].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[10].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[11].mHostVar = (void*)(tcso_office.c_prcs_stat);
    ulpSqlstmt.hostvalue[11].mHostInd = NULL;
    ulpSqlstmt.hostvalue[11].isstruct = 1;
    ulpSqlstmt.hostvalue[11].structsize = sizeof(tcso_office);
    ulpSqlstmt.hostvalue[11].isarr = 0;
    ulpSqlstmt.hostvalue[11].mType = 6;
    ulpSqlstmt.hostvalue[11].mSizeof = 0;
    ulpSqlstmt.hostvalue[11].mLen = 1+1;
    ulpSqlstmt.hostvalue[11].mMaxlen = sizeof(tcso_office.c_prcs_stat);
    ulpSqlstmt.hostvalue[11].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[11].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[11].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[12].mHostVar = (void*)(tcso_office.c_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[12].mHostInd = NULL;
    ulpSqlstmt.hostvalue[12].isstruct = 1;
    ulpSqlstmt.hostvalue[12].structsize = sizeof(tcso_office);
    ulpSqlstmt.hostvalue[12].isarr = 0;
    ulpSqlstmt.hostvalue[12].mType = 6;
    ulpSqlstmt.hostvalue[12].mSizeof = 0;
    ulpSqlstmt.hostvalue[12].mLen = 12+1;
    ulpSqlstmt.hostvalue[12].mMaxlen = sizeof(tcso_office.c_prcs_vhcl_no);
    ulpSqlstmt.hostvalue[12].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[12].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[12].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("SQLCODE = %d TCSO_OFFICE 사무실 wrk_date[%.8s] lane_no[%.2s]\n",
                SQLCODE, pk_in->wrk_date, pk_in->wrk_no);
        return(-1);
    }

    return(0);
}

/*
 *========================================================================
 *
 *   함 수 명 : proc_etcs_vio()
 *   작 성 자 : 조보용
 *   작 성 일 : 2018.10.15
 *   수 정 일 :
 *   설    명 : 출구위반입구수납 Data를 처리.
 *========================================================================
*/

int proc_etcs_vio(char *target)
{
    struct rcv_lane_data  *rd;
    struct    hi_etcs_out_way_vio_in_way_rcpt *pk_in;

    struct    etco_out_way_vio_rcpt           tb_vio_rcpt;


    memset((char *)&tb_vio_rcpt, 0, sizeof(tb_vio_rcpt));
    rd = (struct rcv_lane_data *)target;
    pk_in = (struct hi_etcs_out_way_vio_in_way_rcpt *)rd->buf;

    e_memcpy(tb_vio_rcpt.c_plz_id,    rd->plz_id);
    e_memcpy(tb_vio_rcpt.c_work_date, pk_in->wrk_date);
    e_memcpy(tb_vio_rcpt.c_work_no,   pk_in->wrk_no);
    e_memcpy(tb_vio_rcpt.c_workr_no,  pk_in->wrkr_no);

    tb_vio_rcpt.d_prcs_seq = lb_data2atoi((char *)pk_in->serial_no, 8);

    e_memcpy(tb_vio_rcpt.c_prcs_type, pk_in->hnd_type);

    sprintf((char *)tb_vio_rcpt.c_occrn_date_tm, "%.4s%.2s%.2s%.2s%.2s%.2s",
            pk_in->year, pk_in->month, pk_in->day,
            pk_in->hour, pk_in->min,   pk_in->sec);

    tb_vio_rcpt.d_rcpt_toll = lb_data2atoi((char *)pk_in->rcpt_mny, 8);

    e_memcpy(tb_vio_rcpt.c_vhcl_no, pk_in->vhcl_no);

    /*  INSERT INTO ETCO_OUT_WAY_VIO_RCPT VALUES (:tb_vio_rcpt); */
{
    struct ulpSqlstmt ulpSqlstmt;
    memset(&ulpSqlstmt, 0, sizeof(ulpSqlstmt));
    ulpHostVar ulpHostVar[9];
    ulpSqlstmt.hostvalue = ulpHostVar;
    ulpSqlstmt.stmttype = 3;
    ulpSqlstmt.stmtname = NULL;
    ulpSqlstmt.ismt = 1;
    ulpSqlstmt.numofhostvar = 9;
    ulpSqlstmt.statusptr = NULL;
    ulpSqlstmt.errcodeptr = NULL;
    ulpSqlstmt.isatomic = 0;
    ulpSqlstmt.stmt = (char *)"INSERT INTO ETCO_OUT_WAY_VIO_RCPT VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? )";
    ulpSqlstmt.iters = 0;
    ulpSqlstmt.sqlinfo = 0;
    ulpSqlstmt.scrollcur = 0;
    ulpSqlstmt.cursorscrollable = 0;
    ulpSqlstmt.cursorsensitivity = 1;
    ulpSqlstmt.cursorwithhold = 0;
    ulpSqlstmt.esqlopts    = _esqlopts;
    ulpSqlstmt.sqlcaerr    = &sqlca;
    ulpSqlstmt.sqlcodeerr  = &SQLCODE;
    ulpSqlstmt.sqlstateerr = ulpGetSqlstate();
    ulpSqlstmt.hostvalue[0].mHostVar = (void*)(tb_vio_rcpt.c_plz_id);
    ulpSqlstmt.hostvalue[0].mHostInd = NULL;
    ulpSqlstmt.hostvalue[0].isstruct = 1;
    ulpSqlstmt.hostvalue[0].structsize = sizeof(tb_vio_rcpt);
    ulpSqlstmt.hostvalue[0].isarr = 0;
    ulpSqlstmt.hostvalue[0].mType = 6;
    ulpSqlstmt.hostvalue[0].mSizeof = 0;
    ulpSqlstmt.hostvalue[0].mLen = 6+1;
    ulpSqlstmt.hostvalue[0].mMaxlen = sizeof(tb_vio_rcpt.c_plz_id);
    ulpSqlstmt.hostvalue[0].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[0].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[0].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[1].mHostVar = (void*)(tb_vio_rcpt.c_work_date);
    ulpSqlstmt.hostvalue[1].mHostInd = NULL;
    ulpSqlstmt.hostvalue[1].isstruct = 1;
    ulpSqlstmt.hostvalue[1].structsize = sizeof(tb_vio_rcpt);
    ulpSqlstmt.hostvalue[1].isarr = 0;
    ulpSqlstmt.hostvalue[1].mType = 6;
    ulpSqlstmt.hostvalue[1].mSizeof = 0;
    ulpSqlstmt.hostvalue[1].mLen = 8+1;
    ulpSqlstmt.hostvalue[1].mMaxlen = sizeof(tb_vio_rcpt.c_work_date);
    ulpSqlstmt.hostvalue[1].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[1].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[1].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[2].mHostVar = (void*)(tb_vio_rcpt.c_work_no);
    ulpSqlstmt.hostvalue[2].mHostInd = NULL;
    ulpSqlstmt.hostvalue[2].isstruct = 1;
    ulpSqlstmt.hostvalue[2].structsize = sizeof(tb_vio_rcpt);
    ulpSqlstmt.hostvalue[2].isarr = 0;
    ulpSqlstmt.hostvalue[2].mType = 6;
    ulpSqlstmt.hostvalue[2].mSizeof = 0;
    ulpSqlstmt.hostvalue[2].mLen = 4+1;
    ulpSqlstmt.hostvalue[2].mMaxlen = sizeof(tb_vio_rcpt.c_work_no);
    ulpSqlstmt.hostvalue[2].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[2].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[2].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[3].mHostVar = (void*)(tb_vio_rcpt.c_workr_no);
    ulpSqlstmt.hostvalue[3].mHostInd = NULL;
    ulpSqlstmt.hostvalue[3].isstruct = 1;
    ulpSqlstmt.hostvalue[3].structsize = sizeof(tb_vio_rcpt);
    ulpSqlstmt.hostvalue[3].isarr = 0;
    ulpSqlstmt.hostvalue[3].mType = 6;
    ulpSqlstmt.hostvalue[3].mSizeof = 0;
    ulpSqlstmt.hostvalue[3].mLen = 6+1;
    ulpSqlstmt.hostvalue[3].mMaxlen = sizeof(tb_vio_rcpt.c_workr_no);
    ulpSqlstmt.hostvalue[3].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[3].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[3].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[4].mHostVar = (void*)&(tb_vio_rcpt.d_prcs_seq);
    ulpSqlstmt.hostvalue[4].mHostInd = NULL;
    ulpSqlstmt.hostvalue[4].isstruct = 1;
    ulpSqlstmt.hostvalue[4].structsize = sizeof(tb_vio_rcpt);
    ulpSqlstmt.hostvalue[4].isarr = 0;
    ulpSqlstmt.hostvalue[4].mType = 2;
    ulpSqlstmt.hostvalue[4].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[4].mLen = 0;
    ulpSqlstmt.hostvalue[4].mMaxlen = 0;
    ulpSqlstmt.hostvalue[4].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[4].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[4].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[5].mHostVar = (void*)(tb_vio_rcpt.c_prcs_type);
    ulpSqlstmt.hostvalue[5].mHostInd = NULL;
    ulpSqlstmt.hostvalue[5].isstruct = 1;
    ulpSqlstmt.hostvalue[5].structsize = sizeof(tb_vio_rcpt);
    ulpSqlstmt.hostvalue[5].isarr = 0;
    ulpSqlstmt.hostvalue[5].mType = 6;
    ulpSqlstmt.hostvalue[5].mSizeof = 0;
    ulpSqlstmt.hostvalue[5].mLen = 1+1;
    ulpSqlstmt.hostvalue[5].mMaxlen = sizeof(tb_vio_rcpt.c_prcs_type);
    ulpSqlstmt.hostvalue[5].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[5].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[5].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[6].mHostVar = (void*)(tb_vio_rcpt.c_occrn_date_tm);
    ulpSqlstmt.hostvalue[6].mHostInd = NULL;
    ulpSqlstmt.hostvalue[6].isstruct = 1;
    ulpSqlstmt.hostvalue[6].structsize = sizeof(tb_vio_rcpt);
    ulpSqlstmt.hostvalue[6].isarr = 0;
    ulpSqlstmt.hostvalue[6].mType = 6;
    ulpSqlstmt.hostvalue[6].mSizeof = 0;
    ulpSqlstmt.hostvalue[6].mLen = 14+1;
    ulpSqlstmt.hostvalue[6].mMaxlen = sizeof(tb_vio_rcpt.c_occrn_date_tm);
    ulpSqlstmt.hostvalue[6].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[6].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[6].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[7].mHostVar = (void*)&(tb_vio_rcpt.d_rcpt_toll);
    ulpSqlstmt.hostvalue[7].mHostInd = NULL;
    ulpSqlstmt.hostvalue[7].isstruct = 1;
    ulpSqlstmt.hostvalue[7].structsize = sizeof(tb_vio_rcpt);
    ulpSqlstmt.hostvalue[7].isarr = 0;
    ulpSqlstmt.hostvalue[7].mType = 2;
    ulpSqlstmt.hostvalue[7].mSizeof = sizeof(int);
    ulpSqlstmt.hostvalue[7].mLen = 0;
    ulpSqlstmt.hostvalue[7].mMaxlen = 0;
    ulpSqlstmt.hostvalue[7].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[7].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[7].mIsDynAlloc = (short) 0;
    ulpSqlstmt.hostvalue[8].mHostVar = (void*)(tb_vio_rcpt.c_vhcl_no);
    ulpSqlstmt.hostvalue[8].mHostInd = NULL;
    ulpSqlstmt.hostvalue[8].isstruct = 1;
    ulpSqlstmt.hostvalue[8].structsize = sizeof(tb_vio_rcpt);
    ulpSqlstmt.hostvalue[8].isarr = 0;
    ulpSqlstmt.hostvalue[8].mType = 6;
    ulpSqlstmt.hostvalue[8].mSizeof = 0;
    ulpSqlstmt.hostvalue[8].mLen = 30+1;
    ulpSqlstmt.hostvalue[8].mMaxlen = sizeof(tb_vio_rcpt.c_vhcl_no);
    ulpSqlstmt.hostvalue[8].mUnsign = (short) 1;
    ulpSqlstmt.hostvalue[8].mInOut = (short) 0;
    ulpSqlstmt.hostvalue[8].mIsDynAlloc = (short) 0;
    ulpDoEmsql( NULL, &ulpSqlstmt, NULL );
}


    if (SQLCODE < 0)
    {
        printf("SQLCODE = %d ETCO_OUT_WAY_VIO_RCPT 출구위반입구수납 wrk_date[%.8s] lane_no[%.2s]\n",
                SQLCODE, pk_in->wrk_date, pk_in->wrk_no);
        return(-1);
    }

    return(0);
}
