IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_REFRESHBASEDATARECORD') 
 CREATE TABLE T_BD_REFRESHBASEDATARECORD (
FID BIGINT DEFAULT 0 NOT NULL,
FENTITYID VARCHAR(36) DEFAULT ' ' NOT NULL
);

 EXEC P_ALTERPK 'PK_T_BD_REFRESHBASEDATARECORD', 'T_BD_REFRESHBASEDATARECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_REFRESHBASEDATARECORD') CREATE INDEX IDX_REFRESHBASEDATARECORD ON T_BD_REFRESHBASEDATARECORD ( FENTITYID );
