UPDATE NOVOCODIGO
SET NRSEQUENCIAL = LPAD(RTRIM(TO_CHAR(TO_NUMBER(NRSEQUENCIAL) + 1)),20,'0')
WHERE CDCONTADOR LIKE 'SOLICOMP%'
/


ALTER TABLE DATA ADD constraint PK_DATA primary key (DTDATA)
/

create index DATA_01 on DATA (DTMES asc)
/

DELETE
FROM DATA
WHERE TO_DATE(TO_CHAR(DTDATA, 'DD/MM/YYYY'), 'DD/MM/YYYY') < TO_DATE('01/01/2000', 'DD/MM/YYYY')
/

COMMIT
/




