Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Properties take their type from the definition in the metadata (e.g. property Active is a Boolean)

  • Functions define the result type (e.g. function CreateGuid() returns a GUID)

Marshalling types

Some conversions are straightforward and unlikely to cause issues in either SQL or the local evaluator:

...

  • If a String is expected, a DateTime will be converted first (to something like "2021-04-20 12:00:00").

  • If an Int is expected, a String like "Hello" cannot be converted and causes an error.

Operator parameters

While many of the operators support Expression Operatoren support various types of arguments, most of them will marshall all parameters to a common type.

...

  • The SQL Mapper makes no attempt to marshal the values to the same type. The database is the final arbiter on how it handles an operation that involves unequal types, including throwing an error.

  • The local evaluator makes a best effort to marshall types for comparison. E.g.

  • Use the cast operator to explicitly marshal values to known types to avoid errors.

...

Basistypen

The primitive types are relatively standard.

Type

Beispiel

Example

XML

Notes

Notiz

Whole Numbers

Ganze Zahlen

6

C# int

Real numbers

Dezimalzahlen

45.678

 or 

 oder 45.678f

C# double

Money

Dezimalzahlen (hohe Präzision)

45.678m

C# decimal

Constant

null - Konstante

null

C# null

Boolean constants

Boolsche - Konstanten

truefalse

c# true and false

Single-quoted strings

Zeichenkette mit einfachen Anführungszeichen ''

'A ''quoted'' string'

Pascal-style escaping

Double-quoted strings

Alternative: Zeichenketten können auch in doppelten Anführungszeichen eingeschlossen werden ""

"A \"quoted\" string"

Nicht zulässig in XML. Hier müssen die einfachen Anführungszeichen verwendet werden.

C-style escaping

Lists

Liste

[A, B, 2, "three"]

Item can be any type

Dates, times, and timespans

A product can work with Datetimes and Times and Timespans in the following ways:

...

  • DateTime + TimeSpan = DateTime

  • DateTime - TimeSpan = DateTime

  • DateTime - DateTime = TimeSpan

  • TimeSpan + TimeSpan = TimeSpan

  • TimeSpan - TimeSpan = TimeSpan

Guids

A product can work with Guids in the following ways:

...