Datatype Qualifiers

Qualifiers tell the access service how to format data that is inserted for a placeholder.

If you do not supply a qualifier, the access service applies default transformations.

Qualification is required for date and time values. You can use the ?T, ?t, ?D, and ?d qualifiers for dates, or you can create a custom qualifier using special qualifiers.

Destination-Template Transfer Datatype Qualifiers

Placeholder/ Qualifier

Definition

?C

Character string enclosed in quotes

?N

Numeric data, no quotes

?D

Standard format Adaptive Server datetime data enclosed in quotes

?T

Standard format ISO TIMESTAMP data enclosed in quotes, ‘YYYY-MM-DD-hh.mm.ss.nnnnnn

?d

mm/dd/yyyy

?t

hh:mm:ss

?X

Standard format Adaptive Server hexadecimal data (for example, 0xffee) used for transferring binary data

?x

Standard format hexadecimal data (for example, X’FFEE’) used for transferring binary data

?y

yy/mm/dd

?G

G‘<...>’ used for transferring graphic datatypes or formatting a graphic constant from binary character data

?g

GX‘<...>’ used for transferring graphic datatypes or formatting a graphic constant from binary character data (returns data in hexadecimal format)

Note: For each table, special circumstances are detailed in the text.

See the effects of the ?C, ?N, ?D, and ?T qualifiers.

Effects of Qualifiers on Datatypes (1)

Open Server Datatype

Default

Effects (by Qualifier)

?C

?N

?D

?T

CS_CHAR CS_VARCHAR CS_TEXT

?C

Quote

No quote

Convert to Open Server datetime string, quote

Convert to ISO TIMESTAMP, quote

CS_BIT, CS_INT1 CS_INT2 CS_ INT4 CS_REAL CS_FLOAT

?N

Convert to char, quote

Convert to char, no quote

n/a

n/a

CS_MONEY CS_MONEY4 CS_DECIMAL

?N

Convert to char, quote

Convert to char, no quote

n/a

n/a

CS_DATETIME CS_DATETIME4

?D

'MON DD YYYY hh:mm’ [AM or PM]

n/a

'MON DD YYYY hh:mm:ss:nnn

'YYYY-MM-DD-hh.mm.ss. nnnnnn

For CS_CHAR, CS_VARCHAR, and CS_TEXT used with the ?D qualifier:
  • If the source is an ISO TIMESTAMP, it is converted to ‘Mon dd yyyy hh:mm:ss:nnn’.

  • If it is an ISO DATE, it is converted to ‘Mon dd yy’.

  • If it is an ISO TIME, it is converted to ‘Mon dd yy hh:mm:ss’ using the value from the DefaultDate property as the date portion of the value.

For CS_CHAR, CS_VARCHAR, and CS_TEXT used with the ?T qualifier, if the source is an ISO DATE or TIME, the DefaultDate and DefaultTime property values are used to fill in missing information.

See the effects of the ?y, ?d, ?t, and ?x qualifiers.

Effects of Qualifiers on Datatypes (2)

Open Server Datatype

Default

Effects (by Qualifier)

?y

?d

?t

?x

CS_CHAR CS_VARCHAR CS_TEXT

?C

Convert and quote

Convert and quote

Convert and quote

Convert to hex; leading X’ trailing ’. For example, X’ab70’

CS_BIT, CS_INT1 CS_INT2 CS_INT4 CS_REAL CS_FLOAT CS_MONEY CS_MONEY4 CS_DECIMAL

?N

n/a

n/a

n/a

n/a

CS_DATETIME CS_DATETIME4

?D

'yy/mm/dd

mm/dd/yyyy

hh:mm:ss

n/a

CS_BINARY CS_VARBINARY CS_IMAGE

?X or ?x

n/a

n/a

n/a

Convert to hex; leading X’ trailing ’. For example, X’ab70’

For CS_CHAR, CS_VARCHAR, and CS_TEXT used with the ?yqualifier, if the source is an ISO DATE, TIME, or TIMESTAMP, it is converted to ‘yy/mm/dd’.

For CS_CHAR, CS_VARCHAR, and CS_TEXT used with the ?d qualifier, if the source is an ISO DATE, TIME, or TIMESTAMP, it is converted to ‘mm/dd/yy’.

For CS_CHAR, CS_VARCHAR, and CS_TEXT used with the ?t qualifier, if the source is an ISO DATE, TIME, or TIMESTAMP, it is converted to ‘hh:mm:ss’.

For all datatypes used with the ?x qualifier, if the target database is ODBC, ?x converts the data to the standard ODBC hexadecimal format (a quoted hexadecimal number with a leading X).

See the effects of the ?x and ?O qualifiers.

Effects of Qualifiers on Datatypes (3)

Open Server Datatype

Default

Effects (by Qualifier)

?X

CS_CHAR

CS_VARCHAR

CS_TEXT

 

Convert to hex; leading 0x, no quote

CS_BIT

CS_ INT1

CS_INT2

CS_INT4

CS_REAL

CS_FLOAT

CS_MONEY

CS_MONEY4

CS_DECIMAL

?N

n/a

CS_DATETIME

CS_DATETIME4

?D

n/a

CS_BINARY

CS_VARBINARY

CS_IMAGE

?X or ?x

Convert to hex; leading 0x, no quote

For CS_BINARY, CS_VARBINARY, and CS_IMAGE datatypes used with the ?X qualifier, if the target database is ODBC, ?x converts the data to the standard ODBC hexadecimal format (a quoted hexadecimal number with a leading X).