
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_REIMBURSESETTING_REL') 
 CREATE TABLE T_ER_REIMBURSESETTING_REL (
FID BIGINT DEFAULT 0 NOT NULL,
FUSER BIGINT DEFAULT 0 NOT NULL,
FREIMBURSELEVEL BIGINT DEFAULT 0 NOT NULL,
FCOMPANY BIGINT DEFAULT 0 NOT NULL
);


EXEC P_ALTERPK 'PK_T_ER_REIMBURSESETTING_REL', 'T_ER_REIMBURSESETTING_REL', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_COMPANYUSER') CREATE INDEX IDX_ER_COMPANYUSER ON T_ER_REIMBURSESETTING_REL ( FUSER ,FCOMPANY );


