IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_LINKBILLNODE') 
 CREATE TABLE T_PBD_LINKBILLNODE (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FNODEDESC NVARCHAR(512) DEFAULT ' ' NOT NULL,
FSOURCEENTITYID VARCHAR(36) DEFAULT ' ' NOT NULL,
FTARGETENTITYID VARCHAR(36) DEFAULT ' ' NOT NULL,
FBIZAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FDEFINELINKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FPRESET CHAR(1) DEFAULT '0' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_DEFINELINKBILL') 
 CREATE TABLE T_PBD_DEFINELINKBILL (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(512) DEFAULT ' ' NOT NULL,
FCONFIGFORMID VARCHAR(36) DEFAULT ' ' NOT NULL,
FIMPLEMENTATION VARCHAR(255) DEFAULT ' ' NOT NULL,
FPARAMTYPECLASS VARCHAR(255) DEFAULT ' ' NOT NULL,
FPRESET CHAR(1) DEFAULT '0' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_EXECUTETRACKING') 
 CREATE TABLE T_PBD_EXECUTETRACKING (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(512) DEFAULT ' ' NOT NULL,
FBIZAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FPRESET CHAR(1) DEFAULT '0' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_TRACKINGENTRY') 
 CREATE TABLE T_PBD_TRACKINGENTRY (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID VARCHAR(36) DEFAULT ' ' NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSOURCEENTITYID VARCHAR(36) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_TRACKINGDETAIL') 
 CREATE TABLE T_PBD_TRACKINGDETAIL (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID VARCHAR(36) DEFAULT ' ' NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FDETAILID VARCHAR(36) DEFAULT ' ' NOT NULL,
FTARGETENTITYID VARCHAR(36) DEFAULT ' ' NOT NULL,
FDEFINELINKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FEXECUTELINKCONFIG NCLOB
);