/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_LABEL_TYPE' AND KSQL_COL_NAME ='FLONGNUMBER') 
 ALTER TABLE T_TCTB_LABEL_TYPE ADD (FLONGNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_LABEL_TYPE' AND KSQL_COL_NAME ='FLEVEL') 
 ALTER TABLE T_TCTB_LABEL_TYPE ADD (FLEVEL BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_LABEL_TYPE' AND KSQL_COL_NAME ='FISLEAF') 
 ALTER TABLE T_TCTB_LABEL_TYPE ADD (FISLEAF CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_LABEL_TYPE' AND KSQL_COL_NAME ='FPARENTID') 
 ALTER TABLE T_TCTB_LABEL_TYPE ADD (FPARENTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_LABEL_TYPE_L' AND KSQL_COL_NAME ='FFULLNAME') 
 ALTER TABLE T_TCTB_LABEL_TYPE_L ADD (FFULLNAME VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_LABEL_TYPE_L' AND KSQL_COL_NAME ='FDESCRIBE') 
 ALTER TABLE T_TCTB_LABEL_TYPE_L ADD (FDESCRIBE VARCHAR(100) DEFAULT ' ' NOT NULL );

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