How to read a table record by record and process and update another table

From: Karen Middleton (karenmiddleol_at_yahoo.com)
Date: 01/03/05


Date: 2 Jan 2005 20:12:17 -0800

Jeff

Sorry, there is a problem is posting back to the newsgroup I have to
post as a new messsage everytime I reply back.

Albert first of all many thanks for your help I admit your posting
almost gave me what I was looking for. Very good update on using .net
languages in Yukon so perhaps Access is ahead of Yukon ):-

Jeff I am answering your question I have a staging table to a fact
table in the database the raw data is loaded into the staging table
which is almost not exactly similar in structure to the fact table.
Now from the staging table I want to read each record by record and
load the fact table. While this load happens I want to check for
various things business rules like if the transaction is in a
paticular company code to do different things and then do unit of
measure conversion looking up into a UOM conversion table and then do
currency conversion at different rates by looking up another tables.

I cannot unfortunately do all this in a query. I am little bit amazed
and surprised that Access queries cannot even accomodate multiple SQL
statements for action queries in one query and it is so painful to
write multiple queries for each of these tasks. I could have done all
this seamlessly in SQL with T-SQL despite all its limitations this was
I was after similar to opening a cursor against a SQL query and keep
updating a target table based on various complex business rules.

Albert - My only question to you is you have provided a nice example
of a read only cursor in your above example we can also update cursors
in T-SQL can you kindly give me a variant of the above whereby I can
update the authors table itself from the recordset while looping is it
possible ?

Many thanks
Karen



Relevant Pages

  • How to read a table record by record and process and update another table
    ... there is a problem is posting back to the newsgroup I have to ... Albert first of all many thanks for your help I admit your posting ... and surprised that Access queries cannot even accomodate multiple SQL ... I was after similar to opening a cursor against a SQL query and keep ...
    (microsoft.public.access.queries)
  • Re: [Forte Agent] question about the new release
    ... However, when I see top posting, most of the time the ... think the problem of the cursor landing at the top is what causes OE ... If the OEer also autosigns, both the cursor and the sig are ... That is a terrible influence on the newbie, and everytime I catch one of ...
    (news.software.readers)
  • Re: [Forte Agent] question about the new release
    ... However, when I see top posting, most of the time the ... think the problem of the cursor landing at the top is what causes OE ... If the OEer also autosigns, both the cursor and the sig are ... That is a terrible influence on the newbie, and everytime I catch one of ...
    (news.software.readers)
  • Re: Time Saver: what is it?
    ... posting, move your cursor to the end of the post instead of leaving ... it where you finished typing and your sig file will go to the end. ... a unique feature to it that cuts removes any text after this ...
    (rec.models.railroad)
  • where clause
    ... After posting to the newsgroup I thought I should post to the dbi-users mailing list instead. ... I am unable to get a where clause to work against MS SQL Server. ... SELECT TOP 201 AuUnique, AuRIN, AuCaseID, AuFirstName, AuLastName, AuMiddleInitial, AuSSN FROM Authorize WHERE (AuFirstName LIKE ...
    (perl.dbi.users)