Unanswered: SQL Loader control file with conditional processing
I am not sure how to create a sqlldr control file with INSERT and UPDATE actions, and conditional processing. Here's the details of what I need to get done:
I will be receiving a big text file with data records. The records will be of different type (but all in one file) indicated by one of the fields (record type field) and they will have different structure. I.e. a book record will have the record type field set to "B0" and have 4 other fields: ID, title, author, date of publishing. A CD record will have the record type field set to "C0" and will have 5 other fields: ID, album, artist, date, genre. There will also be a "B1" record which will have its own structure, but contain additional information about the books in the "B0" records. For example, it will have the ID of the book in one of the fields and publisher in one of the other fields.
I will need to insert all the data in corresponding tables - the B0, B1 records should go in a book table, the C0 records should go in a CD table. The B1 records may need to update a record in the book table if that record with the same book ID is already present, or may need to create the record. So the control file will need to perform conditional processing on record types, and insert/update.
If anyone has examples of such control files or can help me in any way with this complex task, I will be much grateful.