Product Documentation

FairCom Direct SQL for C and C++

Previous Topic

Next Topic

ctsqlSetParameterAsString

Set parameter for all types except BINARY.

Declaration

CTSQLRET ctsqlDECL ctsqlSetParameterAsString(pCTSQLCMD hCmd, INTEGER index, CTSQLCHAR* buffer)

Parameters:

  • hCmd [IN] - command handle
  • index [IN] - parameter number you want to set. The value must be greater or equal to zero but less than the parameter count.
  • buffer [IN] - null terminated char* data

    Date string must be: yyyy-MM-dd

    Time string must be: hh:mm:ss

    Timestamp string must be: yyyy-MM-dd hh:mm:ss

Description

The Direct SQL API (ctsqlapi) requires that query parameters are set using the proper C-language type for the underlying SQL data type. This can be difficult in some languages, such as Python. In these languages, it is more convenient to use strings and let the logic determine the parameter type and perform the proper conversion.

Return

Return CTSQLRET_OK on success.

TOCIndex