DECLARE
  cnt NUMBER (12);
BEGIN


cnt:=0;
select count(*) into cnt from user_tables where table_name='TEMP_MBK_LSMOVE_FUT';
if cnt > 0 then
  begin
    execute immediate 'truncate table TEMP_MBK_LSMOVE_FUT';
    execute immediate 'drop table TEMP_MBK_LSMOVE_FUT';
  end;
end if;

execute immediate 'CREATE GLOBAL TEMPORARY TABLE TEMP_MBK_LSMOVE_FUT ('||
  'ID decimal(12, 0),  DOGID decimal(12, 0),  LSOLD decimal(12, 0),  LSNEW decimal(12, 0),  LSDOG decimal(12, 0),  DD date,'||
  'SUMMA decimal(18, 2),  S_S decimal(12, 0),  DOCOID decimal(12, 0),  DOCID decimal(12, 0),  S_CR decimal(12, 0),  S_CDT date,'||
  'S_MR decimal(12, 0),  S_MDT date,  S_ORG decimal(12, 0),  OLDBSID decimal(12, 0),  NEWBSID decimal(12, 0),  ERR_MESS varchar2(3000),'||
  'EVENTID decimal(12, 0),  S_CLASS decimal(12, 0), DOG_TYPE decimal(12, 0), CONTRACT decimal(12, 0), LSMOVEID decimal(12, 0)) ON COMMIT PRESERVE ROWS NOCACHE'; 


END;   
