-
Notifications
You must be signed in to change notification settings - Fork 2
/
load_data.sql
38 lines (33 loc) · 1.93 KB
/
load_data.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--------------------------------------------------------
-- File created - Tuesday-September-12-2017
--------------------------------------------------------
WHENEVER SQLERROR EXIT
--------------------------------------------------------
-- Load Data
--------------------------------------------------------
REM INSERTING into BEACON.ACTIONS
SET DEFINE OFF;
Insert into BEACON.ACTIONS (ID,ACTION,VALUE) values (1,'ifttt',null);
Insert into BEACON.ACTIONS (ID,ACTION,VALUE) values (2,'deadBolt','lock');
Insert into BEACON.ACTIONS (ID,ACTION,VALUE) values (3,'deadBolt','unlock');
Insert into BEACON.ACTIONS (ID,ACTION,VALUE) values (4,'sonosTts','Locking the front door');
Insert into BEACON.ACTIONS (ID,ACTION,VALUE) values (5,'sonosTts','Unlocking the front door');
--Set the next generated id value
alter table BEACON.ACTIONS modify id GENERATED BY DEFAULT ON NULL AS IDENTITY (START WITH 6);
REM INSERTING into BEACON.ALERTS
SET DEFINE OFF;
Insert into BEACON.ALERTS (ID,SCANNER_ID,NAME,DESCRIPTION,LTD,STARTHOUR,HOURS) values (1,1,'Outside',null,1,null,null);
Insert into BEACON.ALERTS (ID,SCANNER_ID,NAME,DESCRIPTION,LTD,STARTHOUR,HOURS) values (2,2,'LeftRoom',null,2,20,8);
Insert into BEACON.ALERTS (ID,SCANNER_ID,NAME,DESCRIPTION,LTD,STARTHOUR,HOURS) values (3,3,'FrontDoor',null,1,null,null);
--Set the next generated id value
alter table BEACON.ALERTS modify id GENERATED BY DEFAULT ON NULL AS IDENTITY (START WITH 4);
REM INSERTING into BEACON.ALERT_ACTIONS
SET DEFINE OFF;
Insert into BEACON.ALERT_ACTIONS (ALERT_ID,ACTION_ID) values (1,1);
Insert into BEACON.ALERT_ACTIONS (ALERT_ID,ACTION_ID) values (1,3);
Insert into BEACON.ALERT_ACTIONS (ALERT_ID,ACTION_ID) values (1,5);
Insert into BEACON.ALERT_ACTIONS (ALERT_ID,ACTION_ID) values (2,1);
Insert into BEACON.ALERT_ACTIONS (ALERT_ID,ACTION_ID) values (3,1);
Insert into BEACON.ALERT_ACTIONS (ALERT_ID,ACTION_ID) values (3,2);
Insert into BEACON.ALERT_ACTIONS (ALERT_ID,ACTION_ID) values (3,4);
commit;