I would like populate surrogate keys by oracle sequences. As far as I know, I could call the “sequence.nextval” in DI in a sql() function. But wouldn’t that be bad for performance as this function is called for every record?
Yes, that is bad for performance if you’re dealing with thousands of rows. A few hundred rows is no big deal.
The optimal solution is to write a custom function that reads the sequence for you. Configure the sequence to skip X number of values, say 1,000. The custom function will understand that each time it gets a value from the sequence that it can allocate 1,000 values before it has to back to Oracle for the next series.