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

Parameters

Parameter

Description

originalValue

Original value as a string

format

Format of the date as a string

checkFormatRegex

Regex format of the date as a string

Attributes

 Attribute

Type

Description

newValue

date

 Value cast to the new type

Example

CALL UTILS.tryCastDate(
originalValue => '20181207',
format => 'yyyy-MM-dd'
);;

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

yyyy-MM-dd