Home How To Online Documentation Support Download Order
 

 

 

SACommand
SAConnection
SAException
SAField
SAParam

SAString
SADateTime
SANumeric
SAInterval

Enums and Typedefs

  

Usage

Class Members

Examples

SACommand::CreateParam

SAParam& CreateParam( const SAString &sName, SADataType_t eParamType, int nNativeType, size_t nParamSize, int nParamPrecision, int nParamScale, SAParamDirType_t eDirType );
throw (SAException);

SAParam& CreateParam( const SAString &
sName, SADataType_t eParamType, SAParamDirType_t eDirType = SA_ParamInput );
throw (SAException);

Creates parameter associated with the specified command. 

Parameters

sName.    A string representing the name of parameter.

ePatamType.    Type of the parameter's value. eParamType can have one of the following values from SADataType_t enum:

  • SA_dtBool    Sets parameter's value as bool data.
  • SA_dtShort    Sets parameter's value as short data.
  • SA_dtLong    Sets parameter's value as long data.
  • SA_dtFloat    Sets parameter's value as float data.
  • SA_dtDouble    Sets parameter's value as double data.
  • SA_dtNumeric    Data type is SANumeric (used internally).
  • SA_dtDateTime    Sets parameter's value as standard C++ datetime structure (struct tm).
  • SA_dtString    Sets parameter's value as string data (SAString).
  • SA_dtLongBinary    Sets parameter's value as long binary data (SAString).
  • SA_dtLongChar    Sets parameter's value as long character data (SAString).
  • SA_dtBLob    Sets parameter's value as BLob data (SAString).
  • SA_dtCLob    Sets parameter's value as CLob data (SAString).
  • SA_dtCursor    Sets parameter's value as Oracle REF CURSOR (SACommand).
  • SA_dtSpecificToDBMS    Sets parameter's value as server-specific data type value. 

nNativeType.    An integer value representes a code of server-specific data type, if known. Otherwise, -1 .

nParamSize.    An integer value represents parameter's value size.

nParamPrecision.    An integer value represents parameter's value precision.

nParamScale.    An integer value represents parameter's value scale.

eDirType.    Type of the parameter. eDirType can have one of the following values from SAParamDirType_t enum:

  • SA_ParamInput      SAParam object is an input parameter.
  • SA_ParamInputOutput    SAParam object is an input/output parameter.
  • SA_ParamOutput    SAParam object is an output parameter.
  • SA_ParamReturn    SAParam object is a returning parameter.

Return value

A reference to a SAParam object.

Remarks

Normally you should not create parameters by yourself. The Library automatically detects whether the command has parameters in terms of the command text and implicitly creates a set of SAParam objects.

Nevertheless, if you call CreateParam explicitly you have to delete all SAParam objects created automatically by the Library before. Use SACommand::DestroyParams method before the first call of CreateParam method.

Server specific notes

No specific information.

See also

DestroyParams, CommandText, setCommandText, CommandType

SAParam, SADataType_t, SAParamDirType_t

Error handling

Problems and Questions

If you haven't found the answer to your questions or have some problems on using the Library, please, send e-mail to howto@sqlapi.com.