/**Begin D:\d_desk\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_EINVOICE_ACCOUNT' AND KSQL_COL_NAME ='FCLIENTID') 
 ALTER TABLE T_BDM_EINVOICE_ACCOUNT ADD (FCLIENTID VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_EINVOICE_ACCOUNT' AND KSQL_COL_NAME ='FCLIENTSECRET') 
 ALTER TABLE T_BDM_EINVOICE_ACCOUNT ADD (FCLIENTSECRET VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_EINVOICE_ACCOUNT' AND KSQL_COL_NAME ='FENCRYPTKEY') 
 ALTER TABLE T_BDM_EINVOICE_ACCOUNT ADD (FENCRYPTKEY VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_EINVOICE_ACCOUNT' AND KSQL_COL_NAME ='FTENANTNAME') 
 ALTER TABLE T_BDM_EINVOICE_ACCOUNT ADD (FTENANTNAME VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_EINVOICE_ACCOUNT' AND KSQL_COL_NAME ='FTENANTNO') 
 ALTER TABLE T_BDM_EINVOICE_ACCOUNT ADD (FTENANTNO VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_EINVOICE_ACCOUNT' AND KSQL_COL_NAME ='FCOMPANYOUNO') 
 ALTER TABLE T_BDM_EINVOICE_ACCOUNT ADD (FCOMPANYOUNO VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_E_ACCOUNT_ITEM') 
 CREATE TABLE T_BDM_E_ACCOUNT_ITEM (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FACCOUNT VARCHAR(50) DEFAULT ' ' NOT NULL,
FISENABLE VARCHAR(10) DEFAULT ' ' NOT NULL,
FISDEFAULT VARCHAR(10) DEFAULT ' ' NOT NULL,
FACCOUNTTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FDEFAULTBUSINESS VARCHAR(10) DEFAULT ' ' NOT NULL
);



/**End D:\d_desk\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_table.sql **/
