BusinessObjects Board

Whats the best way to incorporate a oracle sequence?

Hi,

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?

What is recommended here?

Thanks!

Tobias


toki79 (BOB member since 2012-10-18)

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.


eganjp :us: (BOB member since 2007-09-12)

That sounds interisting. Thanks


toki79 (BOB member since 2012-10-18)