/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_DIMMATERULEBILL' AND KSQL_COL_NAME IN ('FCURRENCYUSEMAP')) 
 ALTER TABLE T_EB_DIMMATERULEBILL ADD (FCURRENCYUSEMAP CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_DIMMATERULEBILL' AND KSQL_COL_NAME IN ('FCURRENCYDIMSIONMAPID')) 
 ALTER TABLE T_EB_DIMMATERULEBILL ADD (FCURRENCYDIMSIONMAPID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_ACCOUNTRULEFORMULA' AND KSQL_COL_NAME IN ('FFORMULAPO')) 
 ALTER TABLE T_EB_ACCOUNTRULEFORMULA ADD (FFORMULAPO NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_ACCOUNTRULEFORMULA' AND KSQL_COL_NAME IN ('FFORMULAPO_TAG')) 
 ALTER TABLE T_EB_ACCOUNTRULEFORMULA ADD (FFORMULAPO_TAG NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_ACCOUNTRULEFORMULA' AND KSQL_COL_NAME IN ('FSEQUENCE')) 
 ALTER TABLE T_EB_ACCOUNTRULEFORMULA ADD (FSEQUENCE BIGINT DEFAULT 0 NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_DIMMEMBERMAPPING' AND KSQL_COL_NAME IN ('FDBNAME')) 
 ALTER TABLE T_EB_DIMMEMBERMAPPING ADD (FDBNAME NVARCHAR(100) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_TEMPLATE') 
 CREATE TABLE T_EB_TEMPLATE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FTEMPLATECATALOGID BIGINT DEFAULT 0 NOT NULL,
FUSAGE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FGROUP BIGINT DEFAULT 0 NOT NULL,
FTEMPLATETYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSEQUENCE BIGINT DEFAULT 0 NOT NULL,
FEFFECTIVEDATE DATETIME,
FDATA NCLOB
);


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