-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzoo.script
59 lines (59 loc) · 3.17 KB
/
zoo.script
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
SET DATABASE UNIQUE NAME HSQLDB7822C3C815
SET DATABASE GC 0
SET DATABASE DEFAULT RESULT MEMORY ROWS 0
SET DATABASE EVENT LOG LEVEL 0
SET DATABASE TRANSACTION CONTROL LOCKS
SET DATABASE DEFAULT ISOLATION LEVEL READ COMMITTED
SET DATABASE TRANSACTION ROLLBACK ON CONFLICT TRUE
SET DATABASE TEXT TABLE DEFAULTS ''
SET DATABASE SQL NAMES FALSE
SET DATABASE SQL REFERENCES FALSE
SET DATABASE SQL SIZE TRUE
SET DATABASE SQL TYPES FALSE
SET DATABASE SQL TDC DELETE TRUE
SET DATABASE SQL TDC UPDATE TRUE
SET DATABASE SQL CONCAT NULLS TRUE
SET DATABASE SQL UNIQUE NULLS TRUE
SET DATABASE SQL CONVERT TRUNCATE TRUE
SET DATABASE SQL AVG SCALE 0
SET DATABASE SQL DOUBLE NAN TRUE
SET FILES WRITE DELAY 500 MILLIS
SET FILES BACKUP INCREMENT TRUE
SET FILES CACHE SIZE 10000
SET FILES CACHE ROWS 50000
SET FILES SCALE 32
SET FILES LOB SCALE 32
SET FILES DEFRAG 0
SET FILES NIO TRUE
SET FILES NIO SIZE 256
SET FILES LOG TRUE
SET FILES LOG SIZE 50
SET FILES CHECK 268
SET DATABASE COLLATION "SQL_TEXT" PAD SPACE
CREATE USER SA PASSWORD DIGEST 'd41d8cd98f00b204e9800998ecf8427e'
ALTER USER SA SET LOCAL TRUE
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE MEMORY TABLE PUBLIC.EXHIBITS(ID INTEGER PRIMARY KEY,NAME VARCHAR(255),NUM_ACRES DECIMAL(4,1))
CREATE MEMORY TABLE PUBLIC.NAMES(ID INTEGER PRIMARY KEY,SPECIES_ID INTEGER,NAME VARCHAR(255),FOREIGN KEY(SPECIES_ID) REFERENCES PUBLIC.EXHIBITS(ID))
CREATE PROCEDURE PUBLIC.READ_E_NAMES() SPECIFIC READ_E_NAMES_10099 LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA NEW SAVEPOINT LEVEL DYNAMIC RESULT SETS 1 BEGIN ATOMIC DECLARE RESULT CURSOR WITH RETURN FOR SELECT PUBLIC.NAMES.ID,PUBLIC.NAMES.SPECIES_ID,PUBLIC.NAMES.NAME FROM PUBLIC.NAMES;OPEN RESULT;END
CREATE PROCEDURE PUBLIC.READ_NAMES_BY_LETTER(IN PREFIX VARCHAR(10)) SPECIFIC READ_NAMES_BY_LETTER_10101 LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA NEW SAVEPOINT LEVEL DYNAMIC RESULT SETS 1 BEGIN ATOMIC DECLARE RESULT CURSOR WITH RETURN FOR SELECT PUBLIC.NAMES.ID,PUBLIC.NAMES.SPECIES_ID,PUBLIC.NAMES.NAME FROM PUBLIC.NAMES WHERE NAME LIKE CONCAT(PREFIX,'%');OPEN RESULT;END
CREATE PROCEDURE PUBLIC.MAGIC_NUMBER(OUT NUM INTEGER) SPECIFIC MAGIC_NUMBER_10102 LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA NEW SAVEPOINT LEVEL BEGIN ATOMIC SET NUM=42;END
CREATE PROCEDURE PUBLIC.DOUBLE_NUMBER(INOUT NUM INTEGER) SPECIFIC DOUBLE_NUMBER_10103 LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA NEW SAVEPOINT LEVEL DYNAMIC RESULT SETS 1 BEGIN ATOMIC SET NUM=NUM*2;END
ALTER SEQUENCE SYSTEM_LOBS.LOB_ID RESTART WITH 1
SET DATABASE DEFAULT INITIAL SCHEMA PUBLIC
GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.SQL_IDENTIFIER TO PUBLIC
GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.YES_OR_NO TO PUBLIC
GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.TIME_STAMP TO PUBLIC
GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.CARDINAL_NUMBER TO PUBLIC
GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.CHARACTER_DATA TO PUBLIC
GRANT DBA TO SA
SET SCHEMA SYSTEM_LOBS
INSERT INTO BLOCKS VALUES(0,2147483647,0)
SET SCHEMA PUBLIC
INSERT INTO EXHIBITS VALUES(1,'African Elephant',7.5)
INSERT INTO EXHIBITS VALUES(2,'Zebra',1.2)
INSERT INTO NAMES VALUES(1,1,'Elsa')
INSERT INTO NAMES VALUES(2,2,'Zelda')
INSERT INTO NAMES VALUES(3,1,'Ester')
INSERT INTO NAMES VALUES(4,1,'Eddie')
INSERT INTO NAMES VALUES(5,2,'Zoe')