declare
    object_exists exception;
    pragma exception_init (object_exists , -00955);
begin
  execute immediate
	'CREATE TABLE AG_DEV_ADIANTAMENTO_CLIENTE (
        AGDEVADIANTAMENTOCLIENTE_ID NUMBER(7) NOT NULL,
        CLIENTE VARCHAR2(10),
        ESTABELECIMENTO VARCHAR2(4) NOT NULL,
        CENTRORESULTADOS VARCHAR2(10),
        CONTADESPREC VARCHAR2(10) NOT NULL,
        CONTAFINANCEIRA VARCHAR2(4),
        DATA DATE NOT NULL,
        VALOR NUMBER(12,2) NOT NULL,
        IDWS VARCHAR2(30),
        INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL,
        FECINTEGRACION DATE,
        MOTIVONAOINTEGRADO VARCHAR2(500),
        CLIENTECNPJCPF VARCHAR2(20),
        CLIENTEIDWS VARCHAR2(30),
        OBSERVACAO VARCHAR2(255),
        PRIMARY KEY (AGDEVADIANTAMENTOCLIENTE_ID)
    )';
 exception when object_exists then null;
end;
/
declare
    object_exists exception;
    pragma exception_init (object_exists , -00955);
begin
  execute immediate 'CREATE SEQUENCE "AG_DEVADIANTAMENTO_CLIENTE_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';	
  exception when object_exists then null;
end;
