declare
    object_exists exception;
    pragma exception_init (object_exists , -00955);
begin
  execute immediate
	'CREATE TABLE DADOS_ESTORNO_CARTAO (
		DADOSESTORNOCARTAO_ID NUMBER(7) NOT NULL,
		NUMCARTAO VARCHAR2(48),
		FECTRANSACAO DATE,
		NSU VARCHAR2(45),
		NUMAUTORIZACAO VARCHAR2(45),
		IMPORTETOTAL NUMBER(11,2),
		IMPORTEESTORNADO NUMBER(11,2),
		NOMBTITULAR VARCHAR2(180),
		DOCUMENTOCPF  VARCHAR2(45),
		TELEFONO VARCHAR2(14),
		EMAIL VARCHAR2(50),
		ORIGEN_ID NUMBER(7),
		DESTINO_ID NUMBER(7),
		FECVIAGEM DATE,
        FECREGISTRO DATE,
        NUMFOLIOSISTEMA VARCHAR2(36),
        NUMOPERACION VARCHAR2(36),
        ACTIVO NUMBER(1),
        FECMODIF DATE,
        USUARIO_ID NUMBER(7),
        PRIMARY KEY (DADOSESTORNOCARTAO_ID)
	)';
	  
  execute immediate 
	'CREATE SEQUENCE DADOS_ESTORNO_CARTAO_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';	
	
  execute immediate 'ALTER TABLE  ORGAO_CANCELACION add INDSOLICITADATOSTARJETA NUMBER(1) DEFAULT 0 NOT NULL';
	
  exception when object_exists then null;
end;
