Extracting Mulitple fields from a text file for use in an UPDATE statement
This is a little tough to explain but here goes. By using Recursive coding I was able to extract multiple dates(99/99/9999) from a text file into multiple records.
EXAMPLE table tab_a Patient a
NOTE_TEXT field: On 12/31/2010 we had a New Years Eve party but I didn't feel good until 01/04/2011. Therefore, next year I will start practicing on 12/21/2011 to get in shape.
Output: Table tab_b
Pat a 12/31/2010
Pat a 01/04/2011
Pat a 12/21/2011
In table tab_a there is only 1 record for Pat a but as you can see there's multiple records for tab_b. My goal is to update tab_a 3 different times using a UDF.REPLACE_CHAR function. The output would then look like this:
On DAY 1 we had a New Years Eve party but I didn't feel good until DAY 5. Therefore, next year I will start practicing on DAY 356 to get in shape.
I don't have an issue if it's a straight one-to-one relationship. Is there any easy way to perform an UPDATE statement that doesn't get error 'Target row updated by multiple source rows.' using my examples?