Question
· Nov 6

EnsLib.RecordMap.Service.FileService row?

When using a EnsLib.RecordMap.Service.FileService business service, is there a way to tell which row number that is being read in? I want to read in a csv, but on the first record, trigger a truncate on the External SQL Table that it is being written to through JDBC.

Thanks

Scott

Product version: IRIS 2025.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2025.1 (Build 230_2U) Wed Jun 4 2025 18:50:44 EDT [HealthConnect:8.2.2]
Discussion (3)2
Log in or sign up to continue

If you're using a custom business process to handle the message, you could perform the truncate in an OnRequest() callback.

If you're using a BPL, you would add an action near the beginning of the process to perform the truncate. The request object will be a single batch object containing a collection of records; the next step would be to iterate over the collection and perform the inserts.

You could do essentially the same thing in a DTL; use an SQL rule at the beginning to truncate, then add a foreach to iterate over the batch and populate the DB.

The key is the fact that your BP is getting all of the records in a single object. So when that object arrives, it's time to truncate the table and repopulate it. You will have to skip the first record if it contains headers, of course.