Sie sind auf Seite 1von 21

!

" ! #
$ % & $ '
( ! ! !
) ' ! * ' &
) '' '
' * * ! * ! & !
' + ! ( ' * *
' ! ! & ,
! '
- & . " #

- &
- & ) /0 '
- & -
- & 1 -
)' '
2!& 3
$ % & '(
)
!"

#
**
. ' - & !' '
- &
$ 84$
! '
. 45 ' 6) 7!
*' !'

$ 84$ ! !' '


!' 45 ' 6. &
!' *'

# " (+ , ! -+.. ! ..
2!& 9
1 + ! 6- ! ' ) /0 '
- &
0 ' / 0
0 '
!' /' '
' '
$ 84$ $ 84$
&
. !' $' ! !
' '

:
! "
2!& !' ;

'
) /0 ' !' (
2! ) /0 ' !' 2! /' '
!' '
*

<! +
$ 84$ 6 8(2
5 5 '
4 & &
2!& =
$ !
$ %
- .
- 0 + $ !
2
) ! ' +
$ - -
- & > ! 0 . '

2!& ?
. $ -
( 2 $ $

. !
! .
1
$ $ @
!
9/;A/
- 1 2)
; = 9; 3
3 ?

- $! $ '
$ ' 2))*2% )*2 )

2!& A
- 0 +
- + 1 -

3 3
2 $!& :
( 2 0 + - (
* ** * ** * * ** ** ** ** ** ** ** ** 2!'
** ** *** ** * * ** ** ** ** ** ** ** * ** * ** * * ** ** ** ** ** ** ** ** *
** ** ** **** ** ** * ** ** * * ** * * ** *** ** * * ** ** ** ** ** ** ** *
* * * * ** * * ** * * ** * * ** ** **** ** ** * ** ** * * ** ** *
- $!& :0 + /$ ! * * 0 +
** * * ** * * ** *

2 ! !& 0 + /$ !
0 ' B
$ ' + 5 !
2!&
2
!+ 2 -+ .

C
$ C
D C
-1
22 - 0 ) 2

. ! ! &
. + !
% ! +
2!&
E &F&G E &" *H ! H#I

Pattern Matching with Oracle Database


F&
F&
E 1
2
" !
" ! J 2
#I
#I

12c
F& K ! ' " ! J K ! ' #I

Fraud Analysis
F& $ ' " ' J ' #I

F& ! !J "( 5 #I
F& ! !> ! "( 5 #I
select count(*) number_of_occurences, sum(fraudulant_amount)
amount_defrauded, fraud_occured_at_loc
from (select * from transactions)
F& 0 " ! 0 #I
MATCH_RECOGNIZE
F& . ! " ! . ! #I
( PARTITION BY ACCOUNT_ID ORDER BY TRANS_TIME
MEASURES
x.trans_time as last_trans_time,
F& ) ! ' "( 5 ) ! ' #I
y.trans_time as time_of_fraud,
F& ! ! ' "( 5 ! ! ' #I
y.amount as fraudulant_amount,
x.location_id as previous_location,
y.location_id as fraud_occured_at_loc,
) ! ' ) !2 "F &* 2 " L M##I
ROUND(FRAUD_ANALYSIS.DISTANCE_RATIO(Y.LOCATION_ID, X.LOCATION_ID,
! ! ' ! ! 2 "F &* 2 " L M##I
Y.TRANS_TIME, X.TRANS_TIME),2) as fraud_likleyhood
ONE ROW PER MATCH
! GF& ' " ! #I
PATTERN (S X{2,4} Y)
DEFINE S as
! " ! N 6 #I
(trans_type='T'),
O
X as (trans_type='T' and S.LOCATION_ID = X.LOCATION_ID ),
Y as (trans_type='T'
!& ' "$ LM # 45 P
AND Y.LOCATION_ID != X.LOCATION_ID
5 G ( .! ! " ! "#* #I
)
;9 Q 8 " 5
5
5 G I
GG #P
G ( .! ! "
E
E &"#* #I
0 . ! )
?8
where fraud_likleyhood > 1
$< 8
group by fraud_occured_at_loc
O
order by number_of_occurences desc

O
O
$ ' 5 " 5 #I
3 5 *! 9 5
+ ! I
String state = null;

Pattern Matching with Oracle Database


String[] attributes;
String prev = "";
String next = "";

12c
public V0Line(String[] atts) {

Finding Double Bottom (W)


}
attributes = atts;

public String[] getAttributes() {


return attributes;
} SELECT first_x, last_z
public void setState(String state) { FROM ticker MATCH_RECOGNIZE (
this.state = state;
}
PARTITION BY name ORDER BY time
MEASURES FIRST(x.time) AS first_x,
public String getQuantity() {
return this.attributes[4]; LAST(z.time) AS last_z
} ONE ROW PER MATCH
public String setState(V0Line linePrev, PATTERN (X+ Y+ W+ Z+)
V0Line lineNext) {
String q = this.getQuantity(); DEFINE X AS (price < PREV(price)),
Y AS (price > PREV(price)),
if (linePrev == null) {
prev = ""; W AS (price < PREV(price)),
} else {
prev = linePrev.getQuantity();
Z AS (price >
} PREV(price) AND
z.time - FIRST(x.time)
9 Q8
if (lineNext == null) {
next = "";
} else {
E 2)K <= 7 )) 8 $< 8
next = lineNext.getQuantity();
}

if (!q.isEmpty() && (prev.isEmpty() ||


5 *95
(eq(q, prev) && gt(q, next)))) {
state = "S";
return state;
}
- & . " #

- &
- & ) /0 '
- & -
- & 1 -
)' '
2!&
- & -
-+ 4 ! 1 1 ! &5

E$ .!&

- .- $
24R

2!& 9
.4$( - $
"' - .+ $ %

. % ((2 D .).4$( !
K 4( 2 $(
1! ! $< 8 ! B

E $ ' +
. ! ! E$ '
$ - & . " #
' + 24R 8 2!& ;
.4$( - $
.4$(
- $
D .4$( E$
' ! E$ ! K
2) $< 8
2 1 + PE$ O -
E$
- !'
D .) 0 : 1 $< 8 $

( ' E$ $< 8 . ! $ -
PE$ O . (&

% ((2"$# $< 8 2) J > ! 8 +!


2 1 + PE$ O
-
$< 8
2!& =
E$ $! - &
, % $ 1 6 " .+ -7

- &

E$ $< 8

- - & - B $< 8
) E$
.4$( !

2), 2!& ?
E$ $! - &
$ ' E$ !'
- &
E$ 5 "> . % . 8 1#
! 5 5" 5# E$ !'
! 5 &! E$ !'
E$ / 2),
.4$(
- !' / 2) E " ! #
$< 8 7! & E$ !'
2 ! E$
$' 2!& A
$ <! E$
PUT /my_database/my_schema/customers
6
HTTP/1.0 &!
$ E$ ! .4$( !
Content-Type: application/json
! 6
Body:
{2) <! E$ ! $< 8
"firstName": "John", select
"lastName": "Smith", c.document.firstName,
"age": 25, c.document.lastName,
"address": { c.document.address.city
"streetAddress": "21 2nd from customers c;
Street",
"city": "New York",
"state": "NY", firstName lastName
"postalCode": "10021", address.city
"isBusiness" : false }, ----------- ----------- ----------
"phoneNumbers": [ ----
{"type": "home", John Smith New York
"number": "212 555-1234" },
{"type": "fax",
"number": "646 555-4567" }
]
2!&
- & -
-+ 4 ! 1
1 ! & &5
-7 $ + - &
1 %

3 D .4$( 2)

! 34 % D !' /
2), &!
- 8 $ -9 -1 !
+% D .4$( 2) $< 8
D .4$( 2)

0 D .4$( 2)

D .4$( 2)

D .4$( 2)

S) . % .

Das könnte Ihnen auch gefallen