Product Documentation

c-treeACE V10.3 Update Guide

Previous Topic

Next Topic

Direct SQL - New numeric conversion functions

Most high-level languages have their own numeric/decimal types that usually require converting them into strings in the high-level language and then converting the strings into the proper numeric/decimal types. To aid in this process, two new functions were added that return numeric columns as strings:

ctsqlSetNumericParameterAsString

Declaration

CTSQLRET ctsqlDECL ctsqlSetNumericParameterAsString(pCTSQLCMD hCmd, INTEGER index, CTSQLTYPE ptype, BIT isnull, CTSQLCHAR* buffer)

Description

Set parameter for all numeric types: CTSQL_NUMERIC and CTSQL_MONEY.

Parameters

  • hCmd - command handle
  • index - parameter number you want to set. The value must be greater or equal to zero but less than the parameter count
  • ptype - type of parameter being passed in buffer. This type must match one of the following types: CTSQL_NUMERIC and CTSQL_MONEY
  • isnull - indicate if parameter should be NULL or not
  • buffer - string representing the numeric data

Return

Returns CTSQLRET_OK on success.

ctsqlGetNumericAsString

Declaration

CTSQLRET ctsqlDECL ctsqlGetNumericAsString(pCTSQLCURSOR hCursor, INTEGER colnumber, CTSQLCHAR* buffer, INTEGER size)

Description

Retrieve the value of a numeric field.

Parameters

  • hCursor - cursor handle
  • colnumber - number of column
  • buffer [out] - buffer to receive field data
  • size - size of buffer

Return

Returns CTSQLRET_OK on success.

TOCIndex