HENV gHenv = SQL_NULL_HENV;
HDBC ghdbc;
void MethodA(CORBA_long param1)
{
TCHAR SqlStatement[80*2];
HSTMT hstmt;
RETCODE rc = 0;
memset((void *)SqlStatement, 0x00, 80*2);
SQLSetConnectOption (ghdbc, SQL_COPT_SS_ENLIST_IN_XA, TRUE);
sprintf(SqlStatement,
"update OTSDB..OTSTBL set OTSCOL002=OTSCOL002 + 1
where OTSCOL001 = %d",param1);
SQLAllocStmt(ghdbc, &hstmt);
SQLExecDirect(hstmt,(UCHAR *)SqlStatement,SQL_NTS);
SQLFreeStmt(hstmt, SQL_DROP);
return;
}
int
main()
{
:
rc = SQLAllocEnv(&gHenv);
rc = SQLAllocConnect(gHenv, &ghdbc);
rc = SQLConnect(ghdbc, "LocalServer", SQL_NTS, "abc", SQL_NTS, "efg", SQL_NTS);
CORBA_BOA_impl_is_ready( boa, impl, &env_g );
rc = SQLDisconnect(ghdbc);
rc = SQLFreeConnect(ghdbc);
rc = SQLFreeEnv(gHenv);
OTS_term( ots, &env_g );
return 0;
} |