Last active
March 5, 2020 17:12
-
-
Save mykelalvis/36cc1446ca8b685fe99db7d3202be76b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; | |
DROP INDEX TBLX_Field4_IDX; | |
; | |
DROP INDEX TBLX_Field2_IDX; | |
DROP SEQUENCE TBLX_FIELD1_SEQ; | |
CREATE SEQUENCE IF NOT EXISTS TBLX_FIELD1_SEQ | |
INCREMENT BY 10 | |
MINVALUE = 10 | |
NOMAXVALUE | |
START WITH 10 | |
NOCYCLE | |
COMMENT = "TBLX_Field1_SEQ sequence_name"; | |
DROP TABLE IF EXISTS TBLX; | |
CREATE TABLE TBLX | |
( | |
Field1 integer PRIMARY KEY default (next value for TBLX_FIELD1_SEQ), | |
Field2 integer NOT NULL, | |
Field3 varchar(255) DEFAULT NULL, | |
Field4 FLOAT DEFAULT NULL, | |
Field5 BLOB DEFAULT NULL, | |
Field6 DECIMAL DEFAULT NULL | |
) | |
; | |
CREATE UNIQUE INDEX TBLX_Field4_IDX ON TBLX(Field4) | |
; | |
CREATE UNIQUE INDEX TBLX_Field2_IDX ON TBLX(Field2) | |
; | |
INSERT INTO TBLX (Field2,Field3,Field4,Field5,Field6) VALUES (1,'X',1.1,null,234); | |
INSERT INTO TBLX (Field2,Field3,Field4,Field5,Field6) VALUES (2,'A',1.2,null,6); | |
INSERT INTO TBLX (Field2,Field3,Field4,Field5,Field6) VALUES (3,'B',1.3,null,324); | |
INSERT INTO TBLX (Field2,Field3,Field4,Field5,Field6) VALUES (4,'C',1.4,null,3243); | |
INSERT INTO TBLX (Field2,Field3,Field4,Field5,Field6) VALUES (5,'D',1.5,null,3); | |
INSERT INTO TBLX (Field2,Field3,Field4,Field5,Field6) VALUES (6,'E',1.6,null,77); | |
INSERT INTO TBLX (Field2,Field3,Field4,Field5,Field6) VALUES (7,'F',1.7,null,6); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment