surrogate key for a hash table

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
bigpoppa
Participant
Posts: 190
Joined: Fri Feb 28, 2003 11:39 am

surrogate key for a hash table

Post by bigpoppa »

DS 6.0r2
Server : Sun Solaris
Client : XP

I'm inserting rows into a hash table. The table has a surrogate key. Is there an easy way to implement the surrogate key? Perhaps using something like a Serial column for the key, etc?

Thanks,
bp
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Can you not take advantage of the 'GetNextValue' routines in the sdk?

Specifically, under Routines/sdk/KeyMgt:

KeyMgtGetNextValue (use when concurrency isn't an issue)
KeyMgtGetNextValueConcurrent (for when it is)

-craig
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you create the hashed file using a CREATE TABLE statement (which you will have to do manually) there is a keyword (from memory it is NEXT.AVAILABLE) that you can use in the PRIMARY KEY clause. It's the weekend here, and I don't have my DataStage machine booted, so can't check. I will verify the actual syntax next time I have it available. But the short answer is yes.

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
Post Reply