May 10, 2006 at 10:31 am
I have a data task that reads an XML file into two gash tables a header and details table, the records in the tables are joined by a reportid. what i need to do is loop the details table for each header reportid and look up a licence number fom a thir table before inserting that record into a perminate table
i know its a bit sketchy but any idea's on the best way to do this, there mat me more than one record in the header table and more than one corrasponding record in the details tabale for each header record
May 15, 2006 at 8:00 am
This was removed by the editor as SPAM
May 15, 2006 at 8:26 am
You can loop over the contents of a recordset using a ForEach loop.: http://blogs.conchango.com/jamiethomson/archive/2005/07/04/1748.aspx In your case the recordset will be te list of ReportIDs from the header table
You can use the iterated ReportID and use that in the query against the details able. http://blogs.conchango.com/jamiethomson/archive/2005/12/09/2480.aspx
You haven't said what the criteria is for looking up a value in the third table so I can't answer your question there.
-Jamie
Jamie Thomson
http://sqlblog.com/blogs/jamie_thomson
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply