IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_COLLATASKAPP') 
 CREATE TABLE T_HPDI_COLLATASKAPP (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID VARCHAR(18) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_TASKCENTERAPP') 
 CREATE TABLE T_HPDI_TASKCENTERAPP (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID VARCHAR(18) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_SUMVBILLAPP') 
 CREATE TABLE T_HPDI_SUMVBILLAPP (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID VARCHAR(18) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_VERMULTASKCENTER') 
 CREATE TABLE T_HPDI_VERMULTASKCENTER (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_VERMULCOLLATASK') 
 CREATE TABLE T_HPDI_VERMULCOLLATASK (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HPDI_TASKCENTER' AND KSQL_COL_NAME IN ('FARRANGESEQ')) 
 ALTER TABLE T_HPDI_TASKCENTER ADD (FARRANGESEQ INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HPDI_COLLATASK' AND KSQL_COL_NAME IN ('FARRANGESEQ')) 
 ALTER TABLE T_HPDI_COLLATASK ADD (FARRANGESEQ INT DEFAULT 0 NOT NULL );