Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Application development using Embedded SQL [Table of Contents] Using host variables

[-] Chapter 2: The Embedded SQL Interface
[-] Embedded SQL data types


Embedded SQL data types

To transfer information between a program and the database server, every piece of data must have a data type. The Embedded SQL data type constants are prefixed with DT_, and can be found in the sqldef.h header file. You can create a host variable of any one of the supported types. You can also use these types in a SQLDA structure for passing data to and from the database.

The following data types are supported by the Embedded SQL programming interface:

The structures are defined in the sqlca.h file. The VARCHAR, BINARY and DECIMAL types contain a one-character array and are thus not useful for declaring host variables but they are useful for allocating variables dynamically or typecasting other variables.


DATE and TIME database types

There are no corresponding Embedded SQL interface data types for the various DATE and TIME database types. These database types are all fetched and updated using either the SQLDATETIME structure or character strings.

There are no Embedded SQL interface data types for LONG VARCHAR and LONG BINARY database types. These database types are fetched and updated in pieces.

For more information see GET DATA statement and SET statement .


Application development using Embedded SQL [Table of Contents] Using host variables