/*
 * vl_rule_list_dbio.pgc - 활성 검증규칙 수 (libvldbio.a).
 * ECPG functions; run on the caller's XA branch. No EXEC SQL CONNECT.
 */
#include <string.h>
#include <userlog.h>
#include "vl_rule_list_dbio.h"

long vldb_rule_count(void)
{
    EXEC SQL BEGIN DECLARE SECTION;
    long h_cnt;
    EXEC SQL END DECLARE SECTION;
    EXEC SQL SELECT count(*) INTO :h_cnt FROM vl_rule WHERE status = 'ACTIVE';
    if (sqlca.sqlcode < 0) { userlog("vldb_rule_count FAIL [%d]", sqlca.sqlcode); return -1; }
    return h_cnt;
}
