Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 52 lines (26 sloc) 0.825 kB
9387374 @mariuz added firetube.sql
authored
1 /****************** GENERATORS ********************/
2
3 CREATE GENERATOR GEN_POSTS_ID;
4
5 /******************** TABLES **********************/
6
7 CREATE TABLE POSTS
8
9 (
10
11 ID Integer NOT NULL,
12
13 TITLE Varchar(50),
14
15 BODY Varchar(2000),
16
17 CREATED Timestamp,
18
19 MODIFIED Timestamp,
20
21 PRIMARY KEY (ID)
22
23 );
24
25 /******************** TRIGGERS ********************/
26
27 SET TERM ^ ;
28
29 CREATE TRIGGER POSTS_BI FOR POSTS ACTIVE
30
31 BEFORE INSERT POSITION 0
32
33 AS
34
35 BEGIN
36
37 IF (NEW.ID IS NULL) THEN
38
39 NEW.ID = GEN_ID(GEN_POSTS_ID, 1);
40
41 END^
42
43 SET TERM ; ^
44
45 GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE
46
47 ON POSTS TO SYSDBA WITH GRANT OPTION;
48 INSERT INTO "POSTS" ("TITLE","BODY","MODIFIED","CREATED") VALUES ('Foo bazz bar','test blog ','now','now');
49
50 INSERT INTO "POSTS" ("TITLE","BODY","MODIFIED","CREATED") VALUES (' bazz bar Foo','test blog2 ','now','now');
51
Something went wrong with that request. Please try again.