
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 't_bas_importtemplate_att')
CREATE TABLE t_bas_importtemplate_att (
      FID              BIGINT DEFAULT 0 NOT NULL,
      FENTRYID         BIGINT DEFAULT 0 NOT NULL,
      FSEQ             INT DEFAULT 0 NOT NULL,
      FATT_NUMBER      VARCHAR(50)   default ' ' not null,
      FATT_ISINPUT     CHAR(1)          default '0' not null,
      FATT_ISIMPORT    CHAR(1)          default '0' not null,
      FATT_COLWIDTH    BIGINT,
      FPARENTENTRYID   BIGINT        default 0 not null,
      FATTDESCRIPTION  VARCHAR(2000)  default ' ' not null
);

EXEC P_ALTERPK 'pk_bas_importtemplate_att', 't_bas_importtemplate_att', 'FENTRYID', '1';



IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 't_bas_importtemplate_att_l')
CREATE TABLE t_bas_importtemplate_att_l (
      FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
      FENTRYID BIGINT DEFAULT 0 NOT NULL,
      FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
      FATTDESCRIPTION VARCHAR(2000) DEFAULT ' ' NOT NULL
);

EXEC P_ALTERPK 'pk_bas_importtemplate_att_l', 't_bas_importtemplate_att_l', 'FPKID', '1';

