このプロシージャは、文字列値をタイムスタンプにキャストしようと試み、それが不可能な場合にエラーの代わりにNULLを返します。元の値がNULLの場合、返される値もNULLとなります。

Parameters

Parameter

Description

originalValue

Original value as a string

format

Format of the date and time as a string

checkFormatRegex

Regex format of the date and time as a string

Attributes

 Attribute

Type

Description

newValue

timestamp

 Value cast to the new type

Example

CALL UTILS.tryCastTimestamp(
originalValue => '2018-10-21 10:05:02.987',
format => 'yyyy-MM-dd hh:mm:ss.SSS'
);;

  TIMESTAMP 文字列の自動解析が可能です:

yyyy-MM-dd
yyyy-MM-dd HH:mm:ss
yyyy-MM-dd HH:mm:ss.S
yyyy-MM-ddTHH:mm:ss
yyyy-MM-ddTHH:mm:ss.S