Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [CODE] DM - Fact Table Surrogate Key with Oracle Sequence
Go
New
Search
Notify
Tools
Reply
  
[CODE] DM - Fact Table Surrogate Key with Oracle Sequence
 Login/Join
 
Gold member
posted
Many of us asking how to incorporate Data Migrator with Oracle Sequence Generator when loading Fact Tables.

This will be fully supported in DM 7.7, but meanwhile, here is one way that will help you.

Make the Surrogate_Key field of the Fact table in the Metadata "Read Only". You will ignore this field in the target transformation.

Create an Oracle Seq Generator for this field;

CREATE SEQUENCE seq_name INCREMENT BY 5 START WITH 10 ;

Create an INSERT trigger on the Fact table;

CREATE OR REPLACE
TRIGGER trigger_name BEFORE INSERT ON fact_table_name
FOR EACH ROW
BEGIN SELECT
seq_name.NETXVAL INTO :NEW."surrogate_key_col_name" FROM DUAL; END;

------
This is very similar to Microsoft Sql Server IDENTETY field type, when the database engine automatically updates the field of new records with a new sequence number.

This message has been edited. Last edited by: Kerry,


WebFocus 7.6.8
iWay Data Migrator 7.6.8
PMF 5.1
 
Posts: 83 | Registered: March 28, 2006Reply With QuoteReport This Post
Expert
posted Hide Post
Hi Endre,

Thanks a lot for sharing the info with all. Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1950 | Location: New York | Registered: November 16, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [CODE] DM - Fact Table Surrogate Key with Oracle Sequence

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.