/**Begin D:\PDM_UPGRADE\PDM1\PUR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCDATACHANNEL') 
 CREATE TABLE T_PUR_SCDATACHANNEL (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCHANNELCLASS VARCHAR(255) DEFAULT ' ' NOT NULL,
FISCLINKID BIGINT DEFAULT 0 NOT NULL,
FCONNECTERP VARCHAR(50) DEFAULT ' ' 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_PUR_SCDATAHANDLE') 
 CREATE TABLE T_PUR_SCDATAHANDLE (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FISEXCUTESERVICE CHAR(1) DEFAULT '0' NOT NULL,
FHANDLECLASS VARCHAR(255) DEFAULT ' ' NOT NULL,
FFAILSTRATEGY VARCHAR(50) DEFAULT ' ' NOT NULL,
FISV VARCHAR(255) DEFAULT ' ' NOT NULL,
FENTITYID VARCHAR(36) DEFAULT ' ' NOT NULL,
FOPERATE VARCHAR(36) DEFAULT ' ' NOT NULL,
FHANDLECONFIG NCLOB DEFAULT ' ',
FMASTERID VARCHAR(36) DEFAULT ' ' 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_PUR_REFSCDATAHANDLE') 
 CREATE TABLE T_PUR_REFSCDATAHANDLE (
FENTRYID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSCDATASERVICEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FSCSERVICECONFIG NCLOB DEFAULT ' '
);

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

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCDATAHANDLEFAIL') 
 CREATE TABLE T_PUR_SCDATAHANDLEFAIL (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FLOGTYPE VARCHAR(36) DEFAULT ' ' NOT NULL,
FSTATE VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTITYDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FOPERATEDESC NVARCHAR(512) DEFAULT ' ' NOT NULL,
FUSERNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FTRACEID VARCHAR(80) DEFAULT ' ' NOT NULL,
FSCDATAHANDLEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FRETRY INT DEFAULT 0 NOT NULL,
FCONFIG VARCHAR(255) DEFAULT ' ' NOT NULL,
FCONFIG_TAG NCLOB,
FPARAMS VARCHAR(255) DEFAULT ' ' NOT NULL,
FPARAMS_TAG NCLOB,
FRESULT VARCHAR(255) DEFAULT ' ' NOT NULL,
FRESULT_TAG NCLOB,
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_PUR_SCDATASERVICE') 
 CREATE TABLE T_PUR_SCDATASERVICE (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FENTITYID VARCHAR(36) DEFAULT ' ' NOT NULL,
FISV VARCHAR(255) DEFAULT ' ' NOT NULL,
FHANDLEPROPERTY VARCHAR(120) DEFAULT ' ' NOT NULL,
FSERVICETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSERVICECLASS VARCHAR(255) DEFAULT ' ' NOT NULL,
FMASTERID VARCHAR(36) DEFAULT ' ' 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_PUR_SCDATACONFIG') 
 CREATE TABLE T_PUR_SCDATACONFIG (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FSTORECLASS VARCHAR(255) DEFAULT ' ' NOT NULL,
FSCDATACHANNELID VARCHAR(36) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);

/**End D:\PDM_UPGRADE\PDM1\PUR_table.sql **/
