@PHONTOD

CREATE TABLE PHTTAB 
(
  IDENTI  VARCHAR(6) NOT NULL,
  CODIGO  VARCHAR(10) NOT NULL,
  DESCRI  VARCHAR(80),
 PRIMARY KEY ("IDENTI", "CODIGO")
);

@EXECSQL

CREATE TABLE PHTLOT
(
  TABLOT  VARCHAR(4) NOT NULL, 
  IDENIV  VARCHAR(2) NOT NULL,
  CODIGO  VARCHAR(5) NOT NULL,
  DESCRI  VARCHAR(30),
 PRIMARY KEY ("TABLOT", "IDENIV", "CODIGO")
);

@EXECSQL


CREATE TABLE PHTCRG
(
  TABCRG       VARCHAR(4) NOT NULL, 
  CODIGO       VARCHAR(8) NOT NULL, 
  DESCRI       VARCHAR(100), 
  NUMCBO       VARCHAR(10),
 PRIMARY KEY ("TABCRG", "CODIGO")
);

@EXECSQL

CREATE TABLE PHTJOR 
(
    TABJOR  VARCHAR(4) NOT NULL,
    CODIGO  VARCHAR(4) NOT NULL,
    DESCRI  VARCHAR(80),
    ANTEE1  VARCHAR(5),
    HORAE1  VARCHAR(5),
    TOLEE1  VARCHAR(5),
    ANTES1  VARCHAR(5),
    HORAS1  VARCHAR(5),
    TOLES1  VARCHAR(5),
    ANTEE2  VARCHAR(5),
    HORAE2  VARCHAR(5),
    TOLEE2  VARCHAR(5),
    ANTES2  VARCHAR(5),
    HORAS2  VARCHAR(5),
    TOLES2  VARCHAR(5),
    ANTEE3  VARCHAR(5),
    HORAE3  VARCHAR(5),
    TOLEE3  VARCHAR(5),
    ANTES3  VARCHAR(5),
    HORAS3  VARCHAR(5),
    TOLES3  VARCHAR(5),
    ANTEE4  VARCHAR(5),
    HORAE4  VARCHAR(5),
    TOLEE4  VARCHAR(5),
    ANTES4  VARCHAR(5),
    HORAS4  VARCHAR(5),
    TOLES4  VARCHAR(5),
    HRSCON  VARCHAR(5),
    HRSINI  VARCHAR(5),
    HRSFIN  VARCHAR(5),
    TIPMAX  VARCHAR(1),
    HORMAX  VARCHAR(5),
    REDHOR  VARCHAR(2),
    NOTEST  VARCHAR(2),
 PRIMARY KEY ("TABJOR", "CODIGO")
);

@EXECSQL

CREATE TABLE PHTFRQ 
(
    TABJOR  VARCHAR(4) NOT NULL,
    CODIGO  VARCHAR(5) NOT NULL,
    DESCRI  VARCHAR(80),
    HORSEG  VARCHAR(5),
    HORTER  VARCHAR(5),
    HORQUA  VARCHAR(5),
    HORQUI  VARCHAR(5),
    HORSEX  VARCHAR(5),
    HORSAB  VARCHAR(5),
    HORDOM  VARCHAR(5),
    CARPTO  VARCHAR(100),
 PRIMARY KEY ("TABJOR", "CODIGO")
);

@EXECSQL

