continued.. untuk lebih simple PL/SQL SCD2 ini memakai MERGE mungkin lebih efektif, contohnya begini:
misalkan kita punya table awal(CUSTOMER_DIM): Customer Dimension dgn field2nya: cust_key,cust_id,custname,city,state....dll kemudian table external yg akan diisikan/update(CUSTOMER_EXTRACT): cust_key,cust_id,custname,city,state...dll table ini bisa kita merger...dgn cara: MERGE INTO CUSTOMER_DIM c USING CUSTOMER_EXTRACT X ON (c.cust_id = x.cust_id) /*buat update*/ WHEN MATCHED THEN UPDATE SET CUST_FIRST_NAME = X.CUST_FIRST_NAME, CUST_LAST_NAME = X.CUST_LAST_NAME, . CUST_EMAIL = X.CUST_EMAIL /*buat insert record baru*/ WHEN NOT MATCHED THEN INSERT ( CUST_KEY, CUST_ID, ) VALUES( CUST_SEQ.NEXTVAL, X.CUST_ID, X.CUST_EMAIL); sekian dulu dari saya, best regards, tuan tanah --- Rahandra Pramono <[EMAIL PROTECTED]> wrote: > Dear all, > > > > Ada yang punya script PL/SQL untuk SCD (Slowly > Changing Dimension) Type 2 > gak ? > > Jika ada yang memiliki, sudilah kiranya untuk > berbagi > > > > Terima kasih > > > > andra > > _____ > > > > [Non-text portions of this message have been > removed] > > > > -- > -----------I.N.D.O - O.R.A.C.L.E--------------- > Keluar: [EMAIL PROTECTED] > Website: http://indo-oracle.blogspot.com > Mirror: http://indooracle.wordpress.com > ----------------------------------------------- > > Bergabung dengan Indonesia Thin Client User Groups, > Terminal Server, Citrix, New Moon Caneveral, di: > http://indo-thin.blogspot.com > Yahoo! Groups Links > > > > > > ____________________________________________________________________________________ We have the perfect Group for you. Check out the handy changes to Yahoo! Groups (http://groups.yahoo.com) -- -----------I.N.D.O - O.R.A.C.L.E--------------- Keluar: [EMAIL PROTECTED] Website: http://indo-oracle.blogspot.com Mirror: http://indooracle.wordpress.com ----------------------------------------------- Bergabung dengan Indonesia Thin Client User Groups, Terminal Server, Citrix, New Moon Caneveral, di: http://indo-thin.blogspot.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/indo-oracle/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/indo-oracle/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

