
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_STRUCTOFACCOUNT_S') 
 CREATE TABLE T_BCM_STRUCTOFACCOUNT_S (
FID BIGINT DEFAULT 0 NOT NULL,
FDATARESOURCE CHAR(1) DEFAULT '0' NOT NULL,
FACCTTABLEID BIGINT DEFAULT 0 NOT NULL,
FACCTFORMULA VARCHAR(255) DEFAULT ' ' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DIMENSION' AND KSQL_COL_NAME IN ('FASSTACTTYPE')) 
 ALTER TABLE T_BCM_DIMENSION ADD (FASSTACTTYPE BIGINT DEFAULT 0 NOT NULL );
