I'm a stumped beginer.
I have TABLE1 with fields: ID, Source, Date_Entered
I have TABLE2 that is the destination table and has a field called Specialty
I have TABLE3 that has an ID field and other data to be transformed and entered into TABLE2.
I wish to populate the Field Specialty with a 'Y' when the data comes in if TABLE3.ID is in TABLE1 and the TABLE1.source = 'ABC' and the TABLE1.Date_Entered = to_date('06012006','MMDDYYYY')
I use a SQL statement to transform and load that is structured like:
INSERT INTO TABLE2
( FIELD_T2_1, FIELD_T2_2, FIELD_T2_3...)
(FIELD_T3_1, FIELD_T3_2, FIELD_T3_3...)
FROM TABLE 3
Of course I utilize DECODE() and other calculations in the FIELD_T3_ s
to put the data in the right format.
But I just cant seem to figure this one out. Nor can I figure out how to test it.
I used to do it with a NOT EXISTS() statement after everything was loaded, but that was before I added the DATE_ENTERED and SOURCE. That's hosing me.