language-extensions/python/src/PythonExtension.cpp
//-------------------------------------------------------------------------------------------------
// Name: GetResults
//
// Description:
//  Returns the output data as well as the null map retrieved from the user program
//
// Returns:
//  SQL_SUCCESS on success, else SQL_ERROR
//

GetResults
Description:
Returns the output data as well as the null map retrieved from the user program


GetResults Description : Returns the output data as well as the null map retrieved from the user program
SQLRETURN GetResults(
	SQLGUID      sessionId,
	SQLUSMALLINT taskId,
	SQLULEN      *rowsNumber,
	SQLPOINTER   **data,
	SQLINTEGER   ***strLen_or_Ind
)
{
	LOG("GetResults");
	SQLRETURN result = SQL_SUCCESS;
	string session = PythonExtensionUtils::ConvertGuidToString(&sessionId);
	try
	{
		g_pySessionMap[session]->GetResults(
			rowsNumber,
			data,
			strLen_or_Ind);
	}
	catch (const exception &ex)
	{
		result = SQL_ERROR;
		LOG_ERROR(ex.what());
	}
	catch (const bp::error_already_set&)
	{
		result = SQL_ERROR;
		LOG_ERROR("Python error: " + PythonExtensionUtils::ParsePythonException());
	}
	catch (...)
	{
		result = SQL_ERROR;
		LOG_ERROR("Unexpected exception occurred in function GetResults()");
	}
	return result;
}
SQLRETURN GetResults ( SQLGUID sessionId , SQLUSMALLINT taskId , SQLULEN * rowsNumber , SQLPOINTER * * data , SQLINTEGER * * * strLen_or_Ind ) { LOG ( " " ) ; SQLRETURN result = SQL_SUCCESS ; string session = PythonExtensionUtils :: ConvertGuidToString ( & sessionId ) ; try { g_pySessionMap [ session ] -> GetResults ( rowsNumber , data , strLen_or_Ind ) ; } catch ( const exception & ex ) { result = SQL_ERROR ; LOG_ERROR ( ex . what ( ) ) ; } catch ( const bp :: error_already_set & ) { result = SQL_ERROR ; LOG_ERROR ( " " + PythonExtensionUtils :: ParsePythonException ( ) ) ; } catch ( ... ) { result = SQL_ERROR ; LOG_ERROR ( " " ) ; } return result ; }
Name: GetResults
Description:
Returns the output data as well as the null map retrieved from the user program
Name : GetResults Description : Returns the output data as well as the null map retrieved from the user program