/**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_ORG_GROUP_DETAIL' AND KSQL_COL_NAME IN ('PARENTENTRYID')) 
 ALTER TABLE T_TCTB_ORG_GROUP_DETAIL ADD (PARENTENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_ORG_GROUP_DETAIL' AND KSQL_COL_NAME IN ('FSHAREID')) 
 ALTER TABLE T_TCTB_ORG_GROUP_DETAIL ADD (FSHAREID CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_ORG_GROUP_DETAIL' AND KSQL_COL_NAME IN ('FLEVEL')) 
 ALTER TABLE T_TCTB_ORG_GROUP_DETAIL ADD (FLEVEL BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_ORG_GROUP' AND KSQL_COL_NAME IN ('FTAXTYPE')) 
 ALTER TABLE T_TCTB_ORG_GROUP ADD (FTAXTYPE VARCHAR(30) DEFAULT ' ' NOT NULL );

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