Hi, someone help please:
I have 3 tables: "Jan_2004", "Feb_2004", "Mar_2004"
They all have similar fields:
'orderId',
'OrderCode',
'Department',
'Language',
'PartOfWorld'
And 2 other tables:
"OrderLookup" : 'OrderCode', 'Dept'
"LangLookup" : 'Language', 'Country'
What I want to do is
1. Loop through all tbls ending with '_2004'
2. In each tbl, use 'OrderCode', lookup using 'OrderLookup.OrderCode', return 'OrderLookup.Dept', and update to 'Department'
3. Same thing with 'Language', lookup 'LangLookup.Language', return 'LangLookup.Country', and update to 'PartOfWorld'
I can use cursor in a stored procedure without problem, but I'm stuck at steps 2 & 3. My problem is to loop through the recordset in each '_2004' tbl & do the update.
Any help would be appreciated.
I have 3 tables: "Jan_2004", "Feb_2004", "Mar_2004"
They all have similar fields:
'orderId',
'OrderCode',
'Department',
'Language',
'PartOfWorld'
And 2 other tables:
"OrderLookup" : 'OrderCode', 'Dept'
"LangLookup" : 'Language', 'Country'
What I want to do is
1. Loop through all tbls ending with '_2004'
2. In each tbl, use 'OrderCode', lookup using 'OrderLookup.OrderCode', return 'OrderLookup.Dept', and update to 'Department'
3. Same thing with 'Language', lookup 'LangLookup.Language', return 'LangLookup.Country', and update to 'PartOfWorld'
I can use cursor in a stored procedure without problem, but I'm stuck at steps 2 & 3. My problem is to loop through the recordset in each '_2004' tbl & do the update.
Any help would be appreciated.