IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_AUTOEVATPL') 
 CREATE TABLE T_SRM_AUTOEVATPL (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FEFFECTIVEDATE DATETIME,
FEXPIRINGDATE DATETIME,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FEXECTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FPUSHTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FREPEATNUMBER BIGINT DEFAULT 0 NOT NULL,
FREPEATUNIT CHAR(1) DEFAULT ' ' NOT NULL,
FEXECMONTH VARCHAR(2) DEFAULT ' ' NOT NULL,
FEXECDAY VARCHAR(2) DEFAULT ' ' NOT NULL,
FEXECTIME BIGINT DEFAULT 0 NOT NULL,
FEVATYPEID BIGINT DEFAULT 0 NOT NULL,
FEVAMETHOD CHAR(1) DEFAULT ' ' NOT NULL,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FGRADEID BIGINT DEFAULT 0 NOT NULL,
FISTYPESCORER CHAR(1) DEFAULT ' ' NOT NULL,
FAUTOGETVALUE CHAR(1) DEFAULT ' ' NOT NULL,
FBILLOBJECT VARCHAR(80) DEFAULT ' ' NOT NULL,
FOP VARCHAR(30) DEFAULT ' ' NOT NULL,
FEVAORGVALUE VARCHAR(30) DEFAULT ' ' NOT NULL,
FTIMEVALUE VARCHAR(30) DEFAULT ' ' NOT NULL,
FSUPPLIERVALUE VARCHAR(30) DEFAULT ' ' NOT NULL,
FTIMERANGE CHAR(1) DEFAULT ' ' NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FFINISHDATETYPE CHAR(1) DEFAULT ' ' NOT NULL,
FFINISHDATEOFFSET BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FFILTERTEXT NCLOB,
FFILTERTEXT_TAG NCLOB,
FCONDITIONTEXT NCLOB,
FCONDITIONTEXT_TAG NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_EVATPLSUPPLIERENTRY') 
 CREATE TABLE T_SRM_EVATPLSUPPLIERENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_EVATPLSCORERENTRY') 
 CREATE TABLE T_SRM_EVATPLSCORERENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FINDEXCLASSID BIGINT DEFAULT 0 NOT NULL,
FSCORERVALUETYPE VARCHAR(1) DEFAULT ' ' NOT NULL,
FSCORERVALUE VARCHAR(30) DEFAULT ' ' NOT NULL,
FSCORERID BIGINT DEFAULT 0 NOT NULL,
FWEIGHT DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_AUTOEVATPL_L') 
 CREATE TABLE T_SRM_AUTOEVATPL_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_AUTOEVATPLVER') 
 CREATE TABLE T_SRM_AUTOEVATPLVER (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FEFFECTIVEDATE DATETIME,
FEXPIRINGDATE DATETIME,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FEXECTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FPUSHTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FREPEATNUMBER BIGINT DEFAULT 0 NOT NULL,
FREPEATUNIT CHAR(1) DEFAULT ' ' NOT NULL,
FEXECMONTH VARCHAR(2) DEFAULT ' ' NOT NULL,
FEXECDAY VARCHAR(2) DEFAULT ' ' NOT NULL,
FEXECTIME BIGINT DEFAULT 0 NOT NULL,
FEVATYPEID BIGINT DEFAULT 0 NOT NULL,
FEVAMETHOD CHAR(1) DEFAULT ' ' NOT NULL,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FGRADEID BIGINT DEFAULT 0 NOT NULL,
FISTYPESCORER CHAR(1) DEFAULT ' ' NOT NULL,
FAUTOGETVALUE CHAR(1) DEFAULT ' ' NOT NULL,
FBILLOBJECT VARCHAR(80) DEFAULT ' ' NOT NULL,
FOP VARCHAR(30) DEFAULT ' ' NOT NULL,
FEVAORGVALUE VARCHAR(30) DEFAULT ' ' NOT NULL,
FTIMEVALUE VARCHAR(30) DEFAULT ' ' NOT NULL,
FSUPPLIERVALUE VARCHAR(30) DEFAULT ' ' NOT NULL,
FTIMERANGE CHAR(1) DEFAULT ' ' NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FFINISHDATETYPE CHAR(1) DEFAULT ' ' NOT NULL,
FFINISHDATEOFFSET BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FFILTERTEXT NCLOB,
FFILTERTEXT_TAG NCLOB,
FCONDITIONTEXT NCLOB,
FCONDITIONTEXT_TAG NCLOB,
FVERSION VARCHAR(30) DEFAULT ' ' NOT NULL,
FVERNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FTPLID VARCHAR(80) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_EVATPLSUPPLIERVER') 
 CREATE TABLE T_SRM_EVATPLSUPPLIERVER (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_EVATPLSCOREVER') 
 CREATE TABLE T_SRM_EVATPLSCOREVER (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FINDEXCLASSID BIGINT DEFAULT 0 NOT NULL,
FSCORERVALUETYPE VARCHAR(1) DEFAULT ' ' NOT NULL,
FSCORERVALUE VARCHAR(30) DEFAULT ' ' NOT NULL,
FSCORERID BIGINT DEFAULT 0 NOT NULL,
FWEIGHT DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_AUTOEVATPLVER_L') 
 CREATE TABLE T_SRM_AUTOEVATPLVER_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_AUTOEVATPLLOG') 
 CREATE TABLE T_SRM_AUTOEVATPLLOG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FEXECTPLVERSIONID BIGINT DEFAULT 0 NOT NULL,
FEXECDATE DATETIME,
FLOGDATE DATETIME,
FBILLOBJECTID VARCHAR(80) DEFAULT ' ' NOT NULL,
FSOURCEBILLID VARCHAR(50) DEFAULT ' ' NOT NULL,
FEXECSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FTARGETBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FEXCEPTIONMSG NCLOB,
FTAG NVARCHAR(80) DEFAULT ' ' NOT NULL,
FTPLID VARCHAR(80) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_AUTOEVATPLLOG_L') 
 CREATE TABLE T_SRM_AUTOEVATPLLOG_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


/**End C:\PDM_UPGRADE\PDM1\SRM_table.sql **/
