How to update hash table

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

How to update hash table

Post by admin »

I have the following requirement --

Dimension table has "groups" of rows, of
which one is "Active" at any given time.

On loading, if I get a record in a given
group, then I need to insert it if it
doesnt exist, and update it as "Active"
the existing "Active" record for that group
also needs to be updated as "Inactive"

Beginning Table (for example, every 3 rows is a "group") field1,field2,field3,activeflag A,A,A,N A,A,B,Y A,A,C,N A,B,A,Y A,B,D,N A,B,E,N

on input A,A,B action: do nothing (already current)
on input A,A,G action: insert new row (A,A,G,Y), update row 2 with N
on input A,B,D action: update (A,B,D,N) to (A,B,C,Y); update (A,B,A,Y) to
(A,B,A,N)
on input A,A,C action: update (A,A,G,Y) to (A,A,G,N); update (A,A,C,N) to
(A,A,C,Y)

and so on...

I can do it straight against SQL tables with regular update/insert statements. I want to try to do it with hash table as input; I can get the row inserted OK,
but to do the update, Im running into problems finding the "Inactive" row and
updating it. The hash key (generated for the lookup) is a multi-column key
consiting of columns 1,2,3.

Anybody want to take this on?

thanks,
mark
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Since you can do it with SQL, and since every UniVerse table is a hashed file, why not use a UV stage? This has the Transaction Group feature as well, so that you can have control over the transaction.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Lamonts "reply to" field wasnt set to the list...

-----Original Message-----
From: Ray Wurlod [mailto:ray.wurlod@informix.com]
Sent: Tuesday, 26 June 2001 08:45
To: Lamont Lockwood
Subject: RE: How to update hash table


The UV stage does not require a driver.
It uses ODBC protocol, but bypasses the need to use a driver because the DataStage engine (UniVerse) already knows how to communicate with UniVerse! The data source name localuv is preconfigured for DataStage. With this DSN you can access any UniVerse file or table on the machine.
Locked