/*
 * vl_close_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_close_dbio.h"

int vldb_close_suspect(long sid)
{
    EXEC SQL BEGIN DECLARE SECTION;
    long h_sid = sid;
    EXEC SQL END DECLARE SECTION;
    EXEC SQL UPDATE vl_suspect SET status = 'CLOSED'
        WHERE suspect_id = :h_sid AND status = 'OPEN';
    if (sqlca.sqlcode < 0 || sqlca.sqlcode == 100) { userlog("vldb_close_suspect FAIL [%d]", sqlca.sqlcode); return -1; }
    return 0;
}
