language-extensions/R/src/RExtension.cpp
//--------------------------------------------------------------------------------------------------
// Name: Execute
//
// Description:
//  Given the data from ExtHost, convert and populate the arrays in the user script. Then,
//  invoke the specified script and retrieve the output schema and convert the data back to
//  ODBC types.
//
// Returns:
//	SQL_SUCCESS on success, else SQL_ERROR
//
Execute
Description:
Given the data from ExtHost, convert and populate the arrays in the user script. Then,
invoke the specified script and retrieve the output schema and convert the data back to
ODBC types.


Execute Description : Given the data from ExtHost convert and populate the arrays in the user script . Then invoke the specified script and retrieve the output schema and convert the data back to ODBC types .
SQLRETURN Execute(
	SQLGUID      sessionId,
	SQLUSMALLINT taskId,
	SQLULEN      rowsNumber,
	SQLPOINTER   *data,
	SQLINTEGER   **strLen_or_Ind,
	SQLUSMALLINT *outputSchemaColumnsNumber
)
{
	LOG("RExtension::Execute");
	SQLRETURN result = SQL_ERROR;
	*outputSchemaColumnsNumber = 0;
	try
	{
		RSession* session = CheckAndGetSession("Execute", sessionId, taskId);
		session->ExecuteWorkflow(
			rowsNumber,
			data,
			strLen_or_Ind,
			outputSchemaColumnsNumber);
		result = SQL_SUCCESS;
	}
	catch (exception &ex)
	{
		LOG_EXCEPTION(ex);
	}
	catch (...)
	{
		LOG_ERROR("Unexpected exception occurred in function Execute().");
	}
	return result;
}
SQLRETURN Execute ( SQLGUID sessionId , SQLUSMALLINT taskId , SQLULEN rowsNumber , SQLPOINTER * data , SQLINTEGER * * strLen_or_Ind , SQLUSMALLINT * outputSchemaColumnsNumber ) { LOG ( " " ) ; SQLRETURN result = SQL_ERROR ; * outputSchemaColumnsNumber = 0 ; try { RSession * session = CheckAndGetSession ( " " , sessionId , taskId ) ; session -> ExecuteWorkflow ( rowsNumber , data , strLen_or_Ind , outputSchemaColumnsNumber ) ; result = SQL_SUCCESS ; } catch ( exception & ex ) { LOG_EXCEPTION ( ex ) ; } catch ( ... ) { LOG_ERROR ( " " ) ; } return result ; }
Name: Execute
Description:
Given the data from ExtHost, convert and populate the arrays in the user script.
Name : Execute Description : Given the data from ExtHost convert and populate the arrays in the user script .