IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_ISC_SETTING') 
 CREATE TABLE T_ER_ISC_SETTING (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSRCSYS BIGINT DEFAULT 0 NOT NULL,
FTARSYS BIGINT DEFAULT 0 NOT NULL,
FDBTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FENABLE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY NVARCHAR(10) DEFAULT ' ' NOT NULL
);

 EXEC P_ALTERPK 'PK_T_ER_ISC_SETTING', 'T_ER_ISC_SETTING', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_ISC_SETTING_NUMBER') CREATE INDEX IDX_ER_ISC_SETTING_NUMBER ON T_ER_ISC_SETTING ( FNUMBER );

 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_ISC_SETTINGENTRY') 
 CREATE TABLE T_ER_ISC_SETTINGENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FKEY VARCHAR(255) DEFAULT ' ' NOT NULL,
FVALUE VARCHAR(255) DEFAULT ' ' NOT NULL
);

 EXEC P_ALTERPK 'PK_T_ER_ISC_SETTINGENTRY', 'T_ER_ISC_SETTINGENTRY', 'FENTRYID', '1';
