Skip to content

Latest commit

 

History

History
28 lines (24 loc) · 1.57 KB

File metadata and controls

28 lines (24 loc) · 1.57 KB
title C to SQL: Bit
description C to SQL: Bit
author David-Engel
ms.author davidengel
ms.date 01/19/2017
ms.service sql
ms.subservice connectivity
ms.topic reference
helpviewer_keywords
converting data from c to SQL types [ODBC], bit
bit data type [ODBC]
data conversions from C to SQL types [ODBC], bit

C to SQL: Bit

The identifier for the bit ODBC C data type is:

SQL_C_BIT

The following table shows the ODBC SQL data types to which bit C data may be converted. For an explanation of the columns and terms in the table, see Converting Data from C to SQL Data Types.

SQL type identifier Test SQLSTATE
SQL_CHAR SQL_VARCHAR

SQL_LONGVARCHAR

SQL_WCHAR SQL_WVARCHAR

SQL_WLONGVARCHAR
None n/a
SQL_DECIMAL SQL_NUMERIC

SQL_TINYINT SQL_SMALLINT

SQL_INTEGER SQL_BIGINT

SQL_REAL SQL_FLOAT

SQL_DOUBLE
None n/a
SQL_BIT None n/a

The driver ignores the length/indicator value when converting data from the bit C data type and assumes that the size of the data buffer is the size of the bit C data type. The length/indicator value is passed in the StrLen_or_Ind argument in SQLPutData and in the buffer specified with the StrLen_or_IndPtr argument in SQLBindParameter. The data buffer is specified with the DataPtr argument in SQLPutData and the ParameterValuePtr argument in SQLBindParameter.