/**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_TCCIT_BIZDEF_ENTRY_L') 
 CREATE TABLE T_TPO_TCCIT_BIZDEF_ENTRY_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FFULLNAME VARCHAR(200) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TPO_TCCIT_BIZDEF_ENTRY' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_TPO_TCCIT_BIZDEF_ENTRY ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TPO_TCCIT_BIZDEF_ENTRY' AND KSQL_COL_NAME ='FCREATETIME') 
 ALTER TABLE T_TPO_TCCIT_BIZDEF_ENTRY ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TPO_TCCIT_BIZDEF_ENTRY' AND KSQL_COL_NAME ='FMODIFYTIME') 
 ALTER TABLE T_TPO_TCCIT_BIZDEF_ENTRY ADD (FMODIFYTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TPO_TCCIT_BIZDEF_ENTRY' AND KSQL_COL_NAME ='FSTATUS') 
 ALTER TABLE T_TPO_TCCIT_BIZDEF_ENTRY ADD (FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TPO_TCCIT_BIZDEF_ENTRY' AND KSQL_COL_NAME ='FENABLE') 
 ALTER TABLE T_TPO_TCCIT_BIZDEF_ENTRY ADD (FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TPO_TCCIT_BIZDEF_ENTRY' AND KSQL_COL_NAME ='FLONGNUMBER') 
 ALTER TABLE T_TPO_TCCIT_BIZDEF_ENTRY ADD (FLONGNUMBER VARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TPO_TCCIT_BIZDEF_ENTRY' AND KSQL_COL_NAME ='FMASTERID') 
 ALTER TABLE T_TPO_TCCIT_BIZDEF_ENTRY ADD (FMASTERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TPO_TCCIT_BIZDEF_ENTRY' AND KSQL_COL_NAME ='FLEVEL') 
 ALTER TABLE T_TPO_TCCIT_BIZDEF_ENTRY ADD (FLEVEL BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TPO_TCCIT_BIZDEF_ENTRY' AND KSQL_COL_NAME ='FISLEAF') 
 ALTER TABLE T_TPO_TCCIT_BIZDEF_ENTRY ADD (FISLEAF CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TPO_TCCIT_BIZDEF_ENTRY' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_TPO_TCCIT_BIZDEF_ENTRY ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );

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