/*
 * MG_STAN.pgc - mg 모듈 서비스 MG_STAN (one service = one file).
 * Split out of the former inline mg_svr.pgc; runs on the caller's XA
 * branch (no EXEC SQL CONNECT). Advertised by mg_svr at tpsvrinit.
 */
#include "MG_STAN.h"

/* 5. MG_STAN - STAN 채번 (Postgres sequence). */
void MG_STAN(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    long stan = mgdb_next_stan();
    if (stan < 0) FAIL(b);
    setl(b, T_ARG1, stan);
    OK(b);
}
