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::ParamByIndex

SAParam & ParamByIndex( int  nIndex );
throw (SAException);

Returns the command parameter specified by index.

Parameters

nIndex.    A zero-based index of the requested parameter in the array of SAParam objects. It must be greater than or equal to 0 and 1 less than the value returned by ParamCount method.

Return value

A reference to a SAParam object.

Remarks

Normally you should use Param method to access a parameter by its name or position (in SQL statement). ParamByIndex method can be used if, for example, you want to walk through all the parameters.  

If parameters were not created before calling ParamByIndex method the Library creates them implicitly (can query native API if needed and therefore can throw exception on error) and then returns the specified parameter. 

Passing a negative value of index or a value greater or equal than the value returned by ParamCount method will result in a failed assertion.

SAParam object contains full information about a parameter: name, type, size, etc. Values for the input parameters can be assigned to SAParam object or supplied by operator << .

Server specific notes

No specific information.

See also

CreateParam, Param, ParamCount

SAParam

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.