I need some help on something.
I am reading some data from an Excel file and I need to insert it into an Oracle table.
Ok, but before inserting it i gotta do some validations.
The guy that did this before did the validations AFTER inserting. I am changing it to do it before ’cause it’s an ammount of data that takes sometime to be inserted.
Here is the current way of validating it:
SELECT FV, COD_BRICK, CANAL, SEGMENTO
FROM TJANSSEN_MATRIZ_DDD_SEGMENTO
WHERE (FV, COD_BRICK, CANAL, SEGMENTO) IN
(SELECT FV, COD_BRICK, CANAL, SEGMENTO
FROM TJANSSEN_MATRIZ_DDD_SEGMENTO
GROUP BY FV, COD_BRICK, CANAL, SEGMENTO
HAVING COUNT(*) > 1)
ORDER BY FV, COD_BRICK, CANAL, SEGMENTO;
If this returns something, then there is duplicated stuff and I should warn or give some error.
Anyway, I don’t know exactly how to do this using Datatable’s Select() method. I mean, I alredy used it sometimes but with simple expressions.
Thanks for reading and for your help.
dev_Gabriel (:
The way you should do this in the most performant manner is to: