ページの先頭行へ戻る
Interstage Big DataComplex Event Processing ServerV1.0.0 開発リファレンス
Interstage

1.3.5 on merge文

イベントの発生を契機に、名前付きウィンドウに対するイベントの追加、更新、削除の操作を一度に行います。

構文:

on イベントタイプ[(フィルター条件)] [as 名前]
merge [into] ウィンドウ名 [as 名前]
[where 条件式]
when [not] matched [and 条件]
then (
insert [into インサート定義]
select プロパティや式のリスト
[where 条件式]
|
update set プロパティ = [, プロパティ = ] [, ...]
[where 条件式]
|
delete
[where 条件式]
)
[then (insert|update|delete) ...] [then ...]
[when ... then ...] [...]

イベントタイプのイベントの発生を契機にウィンドウ名で指定した名前付きウィンドウに対して各種操作を実行します。

名前付きウィンドウに(merge句の後ろにwhere句の指定がある場合には、その条件式にしたがった)イベントがあるかどうかで、when matchedまたはwhen not matchedの後に指定されたthen句のアクション(insert、update、delete)を実行します。when [not] matchedにさらに条件を and で追加することもできます。then句のアクションとして、when matchedの場合にはinsert、update、deleteのどれでも指定できます。when not matchedの場合にはinsertだけを指定できます。