0

I am trying to fetch a user-defined opaque column (opaque_col) via the ODBC driver using SQL_C_BINARY to access the internal binary format:

const char* query = "SELECT opaque_col FROM opaque_test";
rc = SQLPrepareA(hstmt, (SQLCHAR*)query, SQL_NTS);;
...
rc = SQLBindCol(hstmt, 1, SQL_C_BINARY, columnValuesBuffer.data(), colSize, columnIndicators.data());
...
rc = SQLExecute(hstmt);
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) return 1;
rc = SQLFetch(hstmt); // or SQLFetchScroll(hstmt, SQL_FETCH_NEXT, 0)
if (rc == SQL_ERROR) {
    // Expect HY000 / -9634: No cast from <opaque_type_name> to sendrecv (server lacks send/recv).
}

According to Informix documentation:

Use SQL_C_BINARY to access an OPAQUE value in the internal binary format.

However, I get the following error:

No cast from myuuid to sendrecv

Is there a way to fetch a user-defined OPAQUE column in internal binary format using ODBC without using casts or helper functions on the server?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.