Product Documentation

FairCom Direct SQL for C and C++

Previous Topic

Next Topic

ctsqlSetParameter

Set the value of a parameter.

Declaration

CTSQLRET ctsqlSetParameter(pCTSQLCMD hCmd, INTEGER index, CTSQLTYPE ptype, INTEGER length, BIT isnull, void* buffer)

Description

ctsqlSetParameter() sets the value of a parameter. The parameter type must match the expected type as no conversion is provided.

  • hCmd the command handle.
  • index the parameter number to be set. The value must be greater or equal to zero but less than the parameter count.
  • ptype the type of parameter being passed in buffer. This type must match the expected type.
  • length the parameter length being passed in buffer. The proper length must be passed.
  • isnull TRUE indicate a NULL value.
  • buffer buffer containing the parameter value. buffer can be NULL if isnull is TRUE.

Return

ctsqlSetParameter() returns CTSQLRET_OK on success.

Symbolic Constant

Explanation

SQL_ERR_BADPARAM

Bad parameter specification for the statement.

SQL_ERR_INTYPES

Inconsistent types.

See Also

ctsqlSetParameterScale(), ctsqlSetParameterPrecision()

TOCIndex