apex data services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com evil ape or one could use...

64
APEX Data Services Mathias Magnusson Evil Ape 1 / 64

Upload: others

Post on 02-May-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

APEX Data ServicesMathias Magnusson

Evil Ape

1 / 64

Page 2: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 642

MeMathias Magnusson

Owner/Consultant at Evil Ape

Founder & Leader of SWEOUG

oradbdev.mathiasmagnusson.com / @mathiasmag

Oracle ACE

Page 3: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

3 Membership Tiers Oracle ACE Director Oracle ACE Oracle ACE Associate

bit.ly/OracleACEProgram

500+ Technical Experts Helping Peers Globally

Connect:

Nominate yourself or someone you know: acenomination.oracle.com

@oracleaceFacebook.com/oracleaces

[email protected]

3

Page 4: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team
Page 5: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team
Page 6: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

@mathiasmag Evil Apeoradbdev.mathiasmagnusson.com/ 64

What is REST?

A standard web service API allowing HTTP-calls that:

Give every “thing” an ID Link things together Use standard methods Resources with multiple representations Communicate statelessly

6

Page 7: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

@mathiasmag Evil Apeoradbdev.mathiasmagnusson.com/ 64

Let’s look at

• Remote Database

• REST Enabled SQL

• WEB Source

• Reading and writing

7

Page 8: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

@mathiasmag Evil Apeoradbdev.mathiasmagnusson.com/ 64

Remote Database

• Is APEX-talk for REST Enabled SQL (ORDS)

• REST-enable in one database

• Access from another (where APEX runs)

8

Page 9: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

@mathiasmag Evil Apeoradbdev.mathiasmagnusson.com/ 64

The setup

ADW - Defining REST services

ATP - Using REST services

9

Page 10: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

@mathiasmag Evil Apeoradbdev.mathiasmagnusson.com/ 64

Let’s start

Set up in ADW

1.Schema to use rest enabled SQL

2.Tables with auto rest enabled

10

Page 11: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6411

Page 12: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6412 @mathiasmag Evil Apeoradbdev.mathiasmagnusson.com

Page 13: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6413

Page 14: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6414

Page 15: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6415

Page 16: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6416

Page 17: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6417

Page 18: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6418

Page 19: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6419

Page 20: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6420

Page 21: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6421

Page 22: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

@mathiasmag Evil Apeoradbdev.mathiasmagnusson.com/ 64

Time to switch DB

Accessing from ATP

Getting data from Remote Database Set up Rest Enabled SQL Set up autorest on a table

22

Page 23: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6423

Page 24: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6424

Page 25: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6425

Note: Endpoint ends with “ords/restdemo” I.e only referring the alias of the schema

Page 26: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6426

Page 27: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6427

Page 28: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6428

Page 29: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6429

Page 30: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

@mathiasmag Evil Apeoradbdev.mathiasmagnusson.com/ 64

Next up - Web Service

• With SQL over REST covered

• Lets look at using the autorest table

30

Page 31: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6431

Page 32: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6432

Page 33: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6433

Page 34: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6434

Page 35: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6435

Page 36: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6436

Page 37: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6437

Page 38: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6438

Page 39: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6439

Page 40: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6440

Page 41: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

@mathiasmag Evil Apeoradbdev.mathiasmagnusson.com/ 64

Created - Let’s use it

• Now that we got a brand new web service

• We’ll use it in an interactive report

41

Page 42: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6442

Page 43: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6443

Page 44: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6444

Page 45: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

@mathiasmag Evil Apeoradbdev.mathiasmagnusson.com/ 64

But… How about updates

Reading is nice

But for a real solution we want to update

What would be GREAT would be to just edit an IG, click save and have it use proper REST

Well, one can always dream. Right?

45

Page 46: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

@mathiasmag Evil Apeoradbdev.mathiasmagnusson.com/ 64

OROne could use 19.2

The dream factory affectionately known as the Oracle APEX Development team makes dreams come true.

Nothing more needed than IR to make a full featured IG based on rest for select, insert, update, delete.

It is just AWSOME!

46

Page 47: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6447

Page 48: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

@mathiasmag Evil Apeoradbdev.mathiasmagnusson.com/ 64

SEP

Let it be someone else’s problem.

Use a REST-service created by someone else.

48

Page 49: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

@mathiasmag Evil Apeoradbdev.mathiasmagnusson.com/ 64

What is the data

• Game with clans

• Clans has members

• Members collect cards

49

Page 50: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6450

Page 51: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6451

Page 52: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6452

Page 53: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

@mathiasmag Evil Apeoradbdev.mathiasmagnusson.com/ 64

Make a copy

• First API was “clan”

• Second is “player”

• Copy + path prefix + Data Profile

53

Page 54: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6454

Page 55: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6455

Was: clan + 2CCCP

Page 56: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6456

Page 57: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6457

Was: members - auto selected last time

Page 58: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6458

Page 59: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

@mathiasmag Evil Apeoradbdev.mathiasmagnusson.com/ 64

Build drill-down

• Nothing new really

• Just build as was always do in APEX

59

Page 60: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6460

Page 61: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6461

Page 62: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6462

Note: No Auth here.

Page 63: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

oradbdev.mathiasmagnusson.com@mathiasmag Evil Ape/ 6463

Page 64: APEX Data Services€¦ · / 64 @mathiasmag oradbdev.mathiasmagnusson.com Evil Ape OR One could use 19.2 The dream factory affectionately known as the Oracle APEX Development team

Q64 / 64 @mathiasmag Evil Apeoradbdev.mathiasmagnusson.com