language-extensions/R/src/RSession.cpp
//--------------------------------------------------------------------------------------------------
// Name: RSession::InitParam
//
// Description:
//  Initializes the parameter for this session
//
:InitParam
Description:
Initializes the parameter for this session
: InitParam Description : Initializes the parameter for this session
void RSession::InitParam(
	SQLUSMALLINT  paramNumber,
	const SQLCHAR *paramName,
	SQLSMALLINT   paramNameLength,
	SQLSMALLINT   dataType,
	SQLULEN       paramSize,
	SQLSMALLINT   decimalDigits,
	SQLPOINTER    paramValue,
	SQLINTEGER    strLen_or_Ind,
	SQLSMALLINT   inputOutputType)
{
	LOG("RSession::InitParam");
	if (paramName == nullptr)
	{
		throw invalid_argument("Invalid input parameter name supplied");
	}
	else if (paramNumber >= m_paramContainer.GetSize())
	{
		throw invalid_argument("Invalid input param id supplied: " + to_string(paramNumber));
	}
	if (!m_isStreaming && 
		strcmp(reinterpret_cast<const char *>(paramName), m_streamingParamName.c_str()) == 0)
	{
		m_isStreaming = true;
		m_outputDataSet.IsStreaming(true);
	}
	 Add parameter to the container and embedded R environment.
	m_paramContainer.AddParamToEmbeddedR(
		paramNumber,
		paramName,
		paramNameLength,
		dataType,
		paramSize,
		decimalDigits,
		paramValue,
		strLen_or_Ind,
		inputOutputType);
}
void RSession :: InitParam ( SQLUSMALLINT paramNumber , const SQLCHAR * paramName , SQLSMALLINT paramNameLength , SQLSMALLINT dataType , SQLULEN paramSize , SQLSMALLINT decimalDigits , SQLPOINTER paramValue , SQLINTEGER strLen_or_Ind , SQLSMALLINT inputOutputType ) { LOG ( " " ) ; if ( paramName == nullptr ) { throw invalid_argument ( " " ) ; } else if ( paramNumber >= m_paramContainer . GetSize ( ) ) { throw invalid_argument ( " " + to_string ( paramNumber ) ) ; } if ( ! m_isStreaming && strcmp ( reinterpret_cast < const char * > ( paramName ) , m_streamingParamName . c_str ( ) ) == 0 ) { m_isStreaming = true ; m_outputDataSet . IsStreaming ( true ) ; } m_paramContainer . AddParamToEmbeddedR ( paramNumber , paramName , paramNameLength , dataType , paramSize , decimalDigits , paramValue , strLen_or_Ind , inputOutputType ) ; }
Name: RSession::InitParam
Description:
Initializes the parameter for this session
Name : RSession :: InitParam Description : Initializes the parameter for this session
// Check if we are streaming.  // If the input param "r_rowsPerRead" is set, we are in the streaming case. // // Add parameter to the container and embedded R environment. //