/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_PARAMENUM') 
 CREATE TABLE T_TCTB_PARAMENUM (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FVALUE VARCHAR(50) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_PARAMPLAN') 
 CREATE TABLE T_TCTB_PARAMPLAN (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(250) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(250) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_PARAMPLAN_ORG') 
 CREATE TABLE T_TCTB_PARAMPLAN_ORG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FORG BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_PARAMPLAN_PARAM') 
 CREATE TABLE T_TCTB_PARAMPLAN_PARAM (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPARAMNAME BIGINT DEFAULT 0 NOT NULL,
FPARAMVAL BIGINT DEFAULT 0 NOT NULL
);


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


/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_table.sql **/
