DML: Constants

Constants

Strings: data class S

Boolean: data class B

Real numbers: data class R

Integers: data class I

Date & Time: data class D

Constants

Each constant that you define in Mapping Services has an associated data class. When you define a constant, you must respect the conventions of the relevant data class. These data classes include:

See also, DML handling null and absent.

Strings: data class S

To specify a constant that is a String, you can use up to 255 characters. To delimit most String constants, use quotation marks (for example, "My Constant"). However, when you enter String constants in Table columns, do not enclose the constant within quotation marks.

The following table summarizes how to format and add special characters to String constants.

To add a... Use...

quotation mark

\"

new line

\n

carriage return

\r

tab

\t

backslash

\\

Boolean: data class B

To specify a Boolean constant, use true or false. In the default value of an element of an XML Business Document, you can use 1 (for true) or 0 (for false).

Real numbers: data class R

To specify a constant that is a Real number, you can use up to:

  • 38 characters in the mantissa. The mantissa is mandatory and must include a decimal marker and at least one digit.
  • 3 characters in the exponent. The exponential part of a Real number is optional.

You can include the following characters in a Real number:

  • Numbers from 0 to 9 (zero to nine)
  • The plus sign ( + )
  • The minus sign ( - )
  • The exponent symbol ( e or E )
  • The decimal point ( . )

The syntax of a constant that is a Real number is: sign? [(number.number+) | (number+.number)] [(E|e) sign? number+]?

Where:

  • sign is +|-
  • number is (0|1|2|3|4|5|6|7|8|9)

When no sign is present, a Real number is positive.

Examples:

  • 37
  • .2
  • +37.2
  • -37.2
  • -.2
  • +.2
  • -37.2e+8

Integers: data class I

To specify a constant that is an Integer, you can use up to 38 characters. This constant:

  • Must include at least one number.
  • Can include a plus or minus sign (+ or -).

When no sign is present, the Integer is positive.

Examples:

  • 37
  • +37
  • -37

Date & Time: data class D

Mapping Services conventions for Date & Time constants conform with the ISO standard 8601. You can use a constant to specify one point in time, not a period of time. This constant:

  • Must include a date
  • Can include a time

If you do not include a time, the Map Engine Server inserts 00:00 for the time.

To delimit most Date & Time constants, use single quotation marks (for example,'2000-12-12'). However, when you enter Date & Time constants in Table columns, do not enclose the constant with single quotation marks.

Dates

To indicate a date, use the 10-character format yyyy-mm-dd.

Time

Use a space to separate the date and the time. To indicate a time, use a 24-hour clock to express hours and the 8-character format hh:mm:ss. You can also include the difference between the local time and the UTC Coordinated Universal Time) in +/-UH:UM format. If you do not specify this difference, the software registers no difference between the UTC and the local time.

You can choose how much detail is expressed in a time. For example, you can choose to express only hours, or hours and minutes. The following table illustrates how you can modify the level of detail in a Date & Time constant.

This Date & Time constant Includes...

'1975-04-16 17:45:00+02:00'

Full details about a data and time. These details include the:

  • Date in 10-character format (yyyy-mm-dd)
  • Time in 8-character format (hh:mm:ss)
  • Difference between the local time and the UTC

'1975-04-16 17:45:00'

A date and time, in the 8-character format (hh:mm:ss)

'1975-04-16 17:45'

A date and time, in the 5-character format (hh:mm)

'1975-04-16 17'

A date and time, in the 2-character format (hh)

'1975-04-16'

Only a date

Related Links