/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TPO_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TPO_STANDINGBOOK_DETAIL') 
 CREATE TABLE T_TPO_STANDINGBOOK_DETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPROJNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FISDISCOUNT VARCHAR(50) DEFAULT ' ' NOT NULL,
FPROJTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FFILTER NCLOB,
FSETTING VARCHAR(50) DEFAULT ' ' NOT NULL,
FDESCRIPTION VARCHAR(2000) DEFAULT ' ' NOT NULL,
FISLEAF CHAR(1) DEFAULT '0' NOT NULL,
FTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTART DATETIME,
FEND DATETIME,
FTEMPLATE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FLEVEL BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FLEAF CHAR(1) DEFAULT '0' NOT NULL,
FSTATUSCOPY VARCHAR(50) DEFAULT ' ' NOT NULL,
FENABLECOPY VARCHAR(50) DEFAULT ' ' NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TPO_STANDINGBOOK_ITEMS') 
 CREATE TABLE T_TPO_STANDINGBOOK_ITEMS (
FID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FLEVEL BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FISLEAF CHAR(1) DEFAULT '0' NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FDISCOUNTTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTART DATETIME,
FEND DATETIME,
FTEMPLATE VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL
);


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



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