Attribute - Generation specific to Sybase

 

Mapping types

The correspondence between the types of the different "spaces" is presented in the table below:

 

Type

Tagged value

Sybase data type

integer

 

INTEGER

integer

{short}

SMALLINT

integer

{long}

INTEGER

integer

{unsigned}

INTEGER

boolean

 

BIT

real

 

REAL

real

{long}

FLOAT (p)

string(n)

 

VARCHAR (n)

char

 

CHAR (1)

char

{unsigned}

TINYINT

set (n) of char

{array}

CHAR (n)

 

 

The types referred to here as Sybase data types correspond to the SQL Server Datatype, described in the Open Client Embedded SQL/C Programmer's Manual, pages 4-16 and 4-17.


The SQL VARCHAR type is a character type in which the blanks at the end have been removed.


The Objecteering6 string(*) and string() types do not have an equivalent type in Sybase. The size of a string must be specified, since the size of the Sybase VARCHAR has been limited to 255 characters.

 

 

Using specific types

Sybase allows the use of specific types, such as NUMERIC, DATETIME, IMAGE, and Objecteering SQL Designer provides attribute parameterization, which allows you to use these types.


To use specific Sybase types, you should:

·         either position the {sqlType(specific_type)} tagged value, for example {sqlType(raw)} (for further information on this tagged value, please see "Tagged value types").

·         or use the "SQL type" combobox in the SQL tab of the auxiliary window on an attribute (for further information on the SQL tab of the auxiliary window, please see "The auxiliary window and SQL Designer").

 

 

Parameterizing specific types

Parameters can be defined on attribute types through the "Type constraint/String size" field on the attribute concerned (this field appears in the "Attribute" dialog box).

 

 

Available types in Sybase

 

Type

Parameterizable

Code generated

numeric

Yes

X = The parameter defined in the "Type constraint/String size” field in the "Attribute" dialog box.

NUMERIC(X) if a parameter X has been provided.

NUMERIC if no parameter has been provided.

decimal

Yes

X = The parameter defined in the "Type constraint/String size” field in the "Attribute" dialog box.

DECIMAL(X) if a parameter X has been provided.

DECIMAL if no parameter has been provided.

double

No

DOUBLE PRECISION

smallmoney

No

SMALLMONEY

money

No

MONEY

smalldatetime

No

SMALLDATETIME

datetime

No

DATETIME

binary

Yes

X = The parameter defined in the "Type constraint/String size” field in the "Attribute" dialog box.

BINARY(X) if a parameter X has been provided.

BINARY if no parameter has been provided.

varbinary

Yes

X = The parameter defined in the "Type constraint/String size” field in the "Attribute" dialog box.

VARBINARY(X) if a parameter X has been provided.

VARBINARY if no parameter has been provided.

image

No

IMAGE

text

No

TEXT

identity

No

AttributeName type IDENTITY

tinyint

No

TINYINT