/*
 * mm_fx_count_dbio.pgc - 등록 통화 종류 수 (libmmdbio.a).
 * ECPG functions; run on the caller's XA branch. No EXEC SQL CONNECT.
 */
#include <string.h>
#include <userlog.h>
#include "mm_fx_count_dbio.h"

long mmdb_fx_ccy_count(void)
{
    EXEC SQL BEGIN DECLARE SECTION;
    long h_cnt;
    EXEC SQL END DECLARE SECTION;
    EXEC SQL SELECT count(DISTINCT ccy) INTO :h_cnt FROM mm_fx_rate;
    if (sqlca.sqlcode < 0) { userlog("mmdb_fx_ccy_count FAIL [%d]", sqlca.sqlcode); return -1; }
    return h_cnt;
}
