dbExpress Driver and Framework support for SQL Anywhere 12

From RAD Studio
Jump to: navigation, search

Go Up to Developing Database Applications for the Win32 Platform Index


RAD Studio provides support for the SQL Anywhere 12 from Sybase iAnywhere. Features include:

  • New data type supported by SQL Anywhere 12: TIMESTAMP WITH TIME ZONE.
  • Changes in behavior for existing data types such as CHAR, NCHAR, and NVARCHAR.
  • New connectivity options: the host and port connection parameters.

Requirements

  • Latest SQL Anywhere version 12.0.0 client
  • New platform support: x64

New data types

A new data type is supported to conform to the new SQL Anywhere version 12. The new TIMESTAMP WITH TIME ZONE data type stores a point in time with a time zone offset. TIMESTAMP WITH TIME ZONE contains the year, month, day, hour, minute, second, fraction of a second, and number of minutes before or after the Coordinated Universal Time (UTC). The fraction is stored to six decimal places. A TIMESTAMP WITH TIME ZONE value requires ten bytes of storage.

The accepted format is 2009-07-15 08:00:00 -08:00, where:

Component Number of digits

Year

1 to 4 digits

Month

1 or 2 digits

Day

1 or 2 digits

Hour

1 or 2 digits

Minutes

1 or 2 digits

Seconds

1 or 2 digits

Fraction of seconds

1 to 6 digits

Time zone hour

1 or 2 digits

Time zone minutes

1 or 2 digits

The maximum accepted precision is 34.

Behavior changes to existing data types

The CHAR, NCHAR, NVARCHAR, and VARCHAR data types now support 32768 characters length values.

If the described byte length in the client character set for the NCHAR, NVARCHAR, CHAR, or VARCHAR data type with character length semantics would be more than 32767, then these types are described as the LONG NVARCHAR or LONG VARCHAR data type.

Existing data types

The following table lists the data types that are supported by version 12 of the iAnywhere driver along with their SQL and DBX correspondents:

ASA field type SQL type DBX type

fldASACHAR

SQL_CHAR

fldZSTRING

fldASAVARCHAR

fldASAVARCHAR

fldZSTRING

fldASADECIMAL

SQL_DECIMAL

fldBCD

fldASANUMERIC

SQL_NUMERIC

fldBCD

fldASASMALLINT

SQL_SMALLINT

fldINT16

fldASAINTEGER

SQL_INTEGER

fldINT32

fldASAREAL

SQL_REAL

fldSINGLE

fldASAFLOAT

SQL_FLOAT

fldFLOAT

fldASADOUBLE

SQL_DOUBLE

fldFLOAT

fldASALONGVARCHAR

SQL_LONGVARCHAR

fldBLOB

fldASABIT

SQL_BIT

fldBOOL

fldASALONGVARBIT

SQL_BIT

fldBOOL

fldASAVARBIT

SQL_BIT

fldBOOL

fldASATINYINT

SQL_TINYINT

fldUINT8

fldASABIGINT

SQL_BIGINT

fldINT64

fldASABINARY

SQL_BINARY

fldVARBYTES

fldASAVARBINARY

SQL_VARBINARY

fldVARBYTES

fldASALONGVARBINARY

SQL_LONGVARBINARY

fldBLOB

fldASAIMAGE

SQL_LONGVARBINARY

fldBLOB

fldASALONGBINARY

SQL_LONGVARBINARY

fldBLOB

fldASAUNIQUEIDENTIFIER

SQL_GUID

fldZSTRING

fldASADATE

SQL_DATE

fldDATE

fldASATIME

fldASATIME

fldTIME

fldASATIMESTAMP

SQL_TIMESTAMP

fldTIMESTAMP

fldASADATETIME

SQL_DATETIME

fldTIMESTAMP

fldASASMALLDATETIME

SQL_DATETIME

fldTIMESTAMP

fldASAMONEY

SQL_NUMERIC

fldBCD

fldASASMALLMONEY

SQL_NUMERIC

fldBCD

fldASALONGNVARCHAR

SQL_WLONGVARCHAR

fldBLOB

fldASANCHAR

SQL_WCHAR

fldWIDESTRING

fldASANTEXT

SQL_WLONGVARCHAR

fldBLOB

fldASANVARCHAR

SQL_WVARCHAR

fldWIDESTRING

fldASATEXT

SQL_LONGVARCHAR

fldBLOB

fldASAUNIQUEIDENTIFIERSTR

SQL_CHAR

fldZSTRING

fldASAXML

SQL_LONGVARCHAR

fldBLOB

fldASAWCHAR

SQL_WCHAR

fldWIDESTRING

fldASAWVARCHAR

SQL_WVARCHAR

fldWIDESTRING

fldASAWLONGVARCHAR

SQL_WLONGVARCHAR

fldBLOB

fldASANULL

SQL_TYPE_NULL

fldUNKNOWN

fldASAUNKNOWN

SQL_UNKNOWN_TYPE

fldUNKNOWN

fldASADATETIMEOFFSET

SQL_VARCHAR

fldTIMESTAMPOFFSET

New connectivity options

Two new connectivity options are available with the SQL Anywhere version 12. They are used to specify the host and the port attributes of the connection.

The new Host connection parameter takes a host name (or an IP address) and an optional port number that tells the client where to find the database server. When you use the Host parameter, no UDP packets are sent if enough information is given to uniquely identify the server (a host name and a port number). If neither a port number nor a database server name is given, the port number is assumed to be 2638 and the client does not perform a broadcast. However, if the client has a host name and database server name, but no port number, it sends a UDP packet to port 2683 on the specified host, to find the port number.

For example, if a database server is named testserver and is running on a computer called testcomputer on the default port number, the following connection string can be used to connect to the database server:

UID=DBA;PWD=sql;Server=testserver;Host=testcomputer:2683

If the port number is unknown, then you can simply use the following connection string to connect to the database server:

UID=DBA;PWD=sql;Server=testserver;Host=testcomputer

Follow Up

At clients' request, the following features can be implemented:

  • TIMESTAMP WITH TIME ZONE conversion to TIMESTAMP and vice versa.
  • Different format support for the TIMESTAMP WITH TIME ZONE data type.
  • Data types for spatial data and support for spatial compatibility functions.

Notes

For any server-side changes, please visit the vendor's online support.

See Also