CREATE TABLE TBSCRIPT_IMP_CONVERSAO (
    ID INTEGER NOT NULL,
    USUARIO VARCHAR(100) CHARACTER SET UTF8 COLLATE UTF8,
    ARQUIVO BLOB SUB_TYPE 1 SEGMENT SIZE 100,
    SCRIPT BLOB SUB_TYPE 1 SEGMENT SIZE 80,
    DATAHORA TIMESTAMP);

ALTER TABLE TBSCRIPT_IMP_CONVERSAO
ADD CONSTRAINT PK_TBSCRIPT_IMP_CONVERSAO
PRIMARY KEY (ID);

CREATE SEQUENCE GTBSCRIPT_IMP_CONVERSAO;

CREATE OR ALTER TRIGGER TTBSCRIPT_IMP_CONVERSAO_B01I FOR TBSCRIPT_IMP_CONVERSAO
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
  IF (NEW.ID IS NULL) THEN
    NEW.ID = GEN_ID(GTBSCRIPT_IMP_CONVERSAO,1);
END;

ALTER TABLE TBSCRIPT_IMP_CONVERSAO
ADD SCRIPT_ID INTEGER;
