1 #include #include #include #include
2 void insql(int* input1,int* output, int input_id, int output_id, SQLUDF_TRAIL_ARGS) {
4 SQLHANDLE hstmt;
5 SQLHENV henv;
6 SQLHDBC hdbc;
7 SQLRETURN rc=SQL_SUCCESS;
8 rc = SQLAllocEnv(&henv);
9 rc = SQLAllocConnect(henv, &hdbc);
10 rc = SQLConnect(hdbc, NULL, SQL_NTS, NULL, SQL_NTS, NULL, SQL_NTS);
11 SQLCHAR * sql = (SQLCHAR *)"CREATE TABLE test_dll(no integer)";
13 rc=SQLAllocHandle(SQL_HANDLE_STMT,hdbc,&hstmt);
15 SQLExecDirect (hstmt,sql,SQL_NTS);
16 if(rc != sql_success)
17 *output=-1;
20 *output=0;
21 SQLFreeStmt(hstmt,SQL_CLOSE);
22 SQLEndTran(SQL_HANDLE_DBC, hdbc, SQL_COMMIT);
23 SQLFreeConnect(hdbc);
24 SQLFreeEnv(henv); return }
SQL1224N The database manager is not able to accept new requests, has
terminated all requests in progress, or has terminated your particular request
due to an error or, a force interrupt. SQLSTATE=55032
외부 함수 호출로 위의 함수를 호출하여 create table 또는 insert를 하려고 하면 위의 에러가 납니다.
에러 이유와 해결 방안을 가르쳐 주시면 감사드리겠습니다.
|