/*
 * txcore_dbio.h - TxCore DBIO 규약 (ECPG/Pro*C 공통)
 */
#ifndef TXCORE_DBIO_H
#define TXCORE_DBIO_H

#include "txcore.h"

#define TX_SQL_OK        0
#define TX_SQL_NOTFOUND  100

#define TX_DBIO_RESULT(sc)                                   \
    ((sc) == TX_SQL_OK      ? TX_OK :                        \
     (sc) == TX_SQL_NOTFOUND ? TX_ENOENT : TX_EDB)

#define TX_DBIO_LOG_ERR(tag)                                 \
    tx_log(TX_LOG_ERROR, "DBIO 오류 [%s] sqlcode=%ld msg=%.*s", \
           (tag), (long)sqlca.sqlcode,                       \
           (int)sqlca.sqlerrm.sqlerrml, sqlca.sqlerrm.sqlerrmc)

#endif /* TXCORE_DBIO_H */
