Posts

Showing posts with the label https://livesql.oracle.com/apex/livesql/file/tutorial_EONPL1E0IU1BJV8WK0DWTKYHT.html

MATCH_RECOGNIZE - Fraud demo for OracleCODE events

  This is a simple demo showing how to use SQL pattern matching for fraud analysis. It is part of a presentation for the Oracle CODE events program for developers. In Database 12c there is a new SQL construct MATCH_RECOGNIZE for finding rows matching a pattern across a sequence of rows, using a regular expressions. Pattern matching using SQL is based around four logical concepts: Logically partition and order the data/li> Define pattern using regular expression and pattern variables/li> Regular expression is matched against a sequence of rows/li> Each pattern variable is defined using conditions on rows and aggregates irst step is to create the JSON table that will hold our transaction log. The log will provide the details of the time, account/user id, type of event (deposit or transfer) and the transaction amount. Oracle Database 12c supports storing JSON documents inside the database. Use following code to create a table to store the transaction log which is in JSON form...