IB - Developer Center    Forums  Hop To Forum Categories  iWay Products    [CODE] DM - Fact Table Surrogate Key with Oracle Sequence
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  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: 79 | Registered: March 28, 2006Reply With QuoteReport This Post
Virtuoso
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: 993 | Location: New York | Registered: November 16, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

IB - Developer Center    Forums  Hop To Forum Categories  iWay Products    [CODE] DM - Fact Table Surrogate Key with Oracle Sequence

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