/**Begin D:\pdm\PDM_UPGRADE\pdm_new\BDM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_DOWNLOAD_CENTER' AND KSQL_COL_NAME ='FAPPID') 
 ALTER TABLE T_BDM_DOWNLOAD_CENTER ADD (FAPPID VARCHAR(40) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_DOWNLOAD_CENTER' AND KSQL_COL_NAME ='FEXP_PARAM') 
 ALTER TABLE T_BDM_DOWNLOAD_CENTER ADD (FEXP_PARAM VARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_DOWNLOAD_CENTER' AND KSQL_COL_NAME ='FFILE_TYPE') 
 ALTER TABLE T_BDM_DOWNLOAD_CENTER ADD (FFILE_TYPE VARCHAR(8) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_DOWNLOAD_DETAIL1') 
 CREATE TABLE T_BDM_DOWNLOAD_DETAIL1 (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FSERIAL_NO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDEAL_RESULT NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_DOWNLOAD_DETAIL2') 
 CREATE TABLE T_BDM_DOWNLOAD_DETAIL2 (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FDETAIL_URL NVARCHAR(300) DEFAULT ' ' NOT NULL,
FDETAIL_FILE_NAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);



/**End D:\pdm\PDM_UPGRADE\pdm_new\BDM_table.sql **/
