Github user arvind-narain commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/799#discussion_r86430179 --- Diff: core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp --- @@ -6378,6 +6378,124 @@ odbc_SQLSrvr_FetchPerf_sme_( } // odbc_SQLSrvr_FetchPerf_sme_() +extern "C" void +odbc_SQLSrvr_ExtractLob_sme_( + /* In */ CEE_tag_def objtag_ + , /* In */ const CEE_handle_def *call_id_ + , /* Out */ odbc_SQLsrvr_ExtractLob_exc_ *exception_ + , /* In */ IDL_long extractLobAPI + , /* In */ IDL_string lobHandle + , /* Out */ IDL_long_long &lobDataLen + , /* Out */ IDL_char *& lobDataValue + ) +{ + char LobExtractQuery[1000]; + char RequestError[200] = {0}; + SRVR_STMT_HDL *QryLobExtractSrvrStmt = NULL; + + if ((QryLobExtractSrvrStmt = getSrvrStmt("", TRUE)) == NULL) + { + SendEventMsg(MSG_MEMORY_ALLOCATION_ERROR, + EVENTLOG_ERROR_TYPE, + srvrGlobal->nskProcessInfo.processId, + ODBCMX_SERVER, + srvrGlobal->srvrObjRef, + 2, + "EXTRACT LOB APIs", + "Allocate Statement"); + exception_->exception_nr = odbc_SQLsrvr_ExtractLob_ParamError_exn_; + exception_->u.ParamError.ParamDesc = SQLSVC_EXCEPTION_UNABLE_TO_ALLOCATE_SQL_STMT; + } + + snprintf(LobExtractQuery, sizeof(LobExtractQuery), "EXTRACT LOBLENGTH(LOB'%s') LOCATION %Ld", lobHandle, (Int64)&lobDataLen); + + try + { + SQL_EXEC_SetParserFlagsForExSqlComp_Internal(INTERNAL_QUERY_FROM_EXEUTIL); + + short retcode = QryLobExtractSrvrStmt->ExecDirect(NULL, LobExtractQuery, EXTERNAL_STMT, TYPE_CALL, SQL_ASYNC_ENABLE_OFF, 0); + --- End diff -- Do please first get the parser flag, save it and after each ExecDirect set it back to the saved parser flag.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---