How to create surrogate keys

dear all,
please give me some steps to creating and implementation of Surrogate keys in ODI .
thanks in advance
sri

Hi Yellanki,
Both ways are for calling the sequence in back end.
<%=odiRef.getObjectName("<your sequence name>")%>.NEXTVAL is syntax for calling back end objects from ODI.
your sequence name.NEXTVAL is generic syntax for calling sequence in Oracle.
Both will work in ODI but its "recommended" to call backend objects in ODI syntax.
Makes sense?
Thanks,
Guru

Similar Messages

  • How to create surrogate key in dimension without unique value

    Hi, I have a dimension where there is no column with unique value. I want to add a surrogate key to replace the existing primary key which is derived from concatenating 3 columns(e.g. 'A'||'B'||'C'). I'm thinking of using sequence. But this won't allow me to link the dimension to fact table. How do I come up with surrogate key under this situation? Thanks. ~Tracy

    I'm actually trying to accomplish something similar myself.
    In my sources I've got two sorts of customers, ones that are directly reported, and ones whose information is provided with sales records (this is stored in module ODS).
    Of course identification is different, but in the datamart (module DWH) I'm sort of forced to use an equivalent way of loading (due to the way it first used to work). To accelerate lookups on dimensions, I copy the ODS surrogate key to DWH dimensions, but this does not work for the 'inbuilt' customers because they do not have a surrogate key in the ODS.
    They DO have means of unique identification, and at first I thought I could concatenate these (also 3) columns to use as identification code. Unfortunately this is VARCHAR2, where the surrogate key is (naturally) NUMBER.
    So now it looks like I'm forced to first build a table in ODS especially for these 'inbuilt' customers and assign a surrogate key (by sequence) to it, this way it conforms to how 'normal' customers are loaded into DWH.
    I guess you'll have to pull of the same trick, i.e. create a table with either only the 'translation' of D-code to a surrogate key or all information that is fed into the dimension, which then can be used as a lookup or as complete source when loading data into your datamart.
    Good luck, Patrick

  • How we use Surrogate Keys for snowflake dimension

    Hi All,
    my question is - How we use  Surrogate Keys for  snowflake dimension
    i heard from some body Surrogate Keys only work with star schema.
    please correct me if i wrong.
    Regards,
    Manish

    Hi manishcal16PPS,
    According to your description, you can only create natural key in your dimension. But it's not working when using surrogate key. Right?
    In Analysis Services, the snowflake schema of the dimensions are represented by more than one dimension table in other words its takes multiple dimension tables to define a dimension. Surrogate key are just some extra, redundant, unique key based on the
    natural key. So there's no direct relationship or some limitations between surrogate keys and snowflake schema.
    In this scenario, since there's relationship between the two dimensions, you should create natural key. For using natural key or surrogate key. Please refer to an article below:
    Surrogate Key vs. Natural Key
    For understanding star/snowflake schema, please see:
    Understanding Star and Snowflake Schemas 
    Regards,
    Simon Hou
    TechNet Community Support

  • How to created Costing Key

    Hi,
    How to create costing key and wwhere to assign for value fields.Kindly provide me the Tcodes for the same.
    I will assgin poiints
    Thanks
    Sunitha

    Hi,
    The tcode to create costing key: KE40
    The tcode to assign value fields: KE4R

  • How we generate Surrogate Keys without using identify column

    Hi All,
    How we generate Surrogate Keys without using identify column.
    Regards,
    Manish

    There are various options
    1.IDENTITY columns - simplest to implement
    2. Using NEWID(), NEWSEQUENTIALID() functions (if you want to use GUID values as surrogate keys)
    3. SEQUENCE object (if SQL 2012 and above)
    4. Using custom functions to generate keys yourself
    This is an good article which compares use of GUIDs against integers as surrogate keys
    http://blog.jonathanoliver.com/integers-vs-guids-and-natural-vs-surrogate-keys/
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to create AES keys?

    How to create AES keys in Java Card SDK 2.2.1?
    The manual is confusing.

    The oncard building of an AES key is somehow similar to an DES key.
    On applet installation build an AES key by:
    AESKey key = (AESKey) KeyBuilder.buildKey(KeyBuilder.TYPE_AES,KeyBuilder.LENGTH_AES_128,false);
    //Now you can fill the key with random data.
    key.setKey(randomDataof128bitLength,(short)0);For generationg random data see RandomData.
    But you should keep in mind that most JavaCards only support DES /3DES as symmetric cipher. I only know two card that support AES (g&d SmartCafe Expert 64 and Axalto Cyberflex Access 64 K).
    Jan

  • How to Maintain Surrogate Key Mapping (cross-reference) for Dimension Tables

    Hi,
    What would be the best approach on ODI to implement the Surrogate Key Mapping Table on the STG layer according to Kimball's technique:
    "Surrogate key mapping tables are designed to map natural keys from the disparate source systems to their master data warehouse surrogate key. Mapping tables are an efficient way to maintain surrogate keys in your data warehouse. These compact tables are designed for high-speed processing. Mapping tables contain only the most current value of a surrogate key— used to populate a dimension—and the natural key from the source system. Since the same dimension can have many sources, a mapping table contains a natural key column for each of its sources.
    Mapping tables can be equally effective if they are stored in a database or on the file system. The advantage of using a database for mapping tables is that you can utilize the database sequence generator to create new surrogate keys. And also, when indexed properly, mapping tables in a database are very efficient during key value lookups."
    We have a requirement to implement cross-reference mapping tables with Natural and Surrogate Keys for each dimension table. These mappings tables will be populated automatically (only inserts) during the E-LT execution, right after inserting into the dimension table.
    Someone have any idea on how to implement this on ODI?
    Thanks,
    Danilo

    Hi,
    first of all please avoid bolding something. After this according Kimball (if i remember well) is a 1:1 mapping, so no-surrogate key.
    After that personally you could use Lookup Table
    http://www.odigurus.com/2012/02/lookup-transformation-using-odi.html
    or make a simple outer join filtering by your "Active_Flag" column (remember that this filter need to be inside your outer join).
    Let us know
    Francesco

  • How to create a key figure in SNP plannignbook which generate FA type order

    Hello
    trying to create a Key Figure in SNP planning book which generates FA type orders
    could kindly suggest how to do it?
    thanks
    elena

    Hi,
    You would be having different key figures in SNP. The type of orders that you see in Key figure is driven by type of categories or category group that you assign in planning area to each key figure. You can modifiy these cateogry groups in IMG settings.
    When you manually create a forecast through a report then automatically you will see those orders in key figures where you have assigned the category FA.
    Hope this helps.
    Regards
    Alhad

  • ActionsScript 3 how to create on key down function?

    Ok so I understand that you make an event listener and an
    event handler, but I do not understand how to create a function
    were I can hold down a key and the object keeps moving until the
    key is up.
    With the following function it only moves it every time I
    press a certain key. I need to move while the key is held down
    until released. I looked around with google and couldn't really
    find anything other than how to do this in AS2, which isn't
    helpful. Please help! :D
    stage.addEventListener(KeyboardEvent.KEY_DOWN, jumpEvent);
    private function jumpEvent(event:KeyboardEvent):void
    if(event.keyCode == 17)
    nissanZ.x += 10;

    hey thanks a bunch vario pegged!
    its working pretty well :D

  • How to create Basic Key Figure, Key Figure and Characteristic

    Hello Gurus,
    I have copied a standard layout of KP06, named it as a Z- layout and made changes to it, like defined the plan data upload field as Object Currency enabled.
    However I want to add a Z-Field , tax holiday unit as a column to this layout which I am not being able to do. The reason is when I go to Insert a new element from Edit > Element > Insert Element and click on 'Key figure with Characteristics' I do not get the Z-Field as a key figure.
    I want to define the Z-field as a key figure, so that I can add it as an element.
    Would be really nice of you if you can let me know the t-code/menu path to do that.
    Regards.

    Hello Gurus,
    I wanted to share this information with you, hoping this will help you to help me.
    I also tried to create a Key Figure in t-code GS32. In the table I mention --> FAGLFLEXR and hit enter. It says no Key figure has been defined for FAGLFLEXR. Then I put the cursor on the 'Reference Entry'and click on copy. Then give the name of the Key Field I want to create.
    'Create Key Figure' dialog box appears. When I input the 'Row Text' 'Column Text' and click enter, I am getting an error 'The basic key figure  entered for table FAGL is not defined'. I go back and do an F4 on 'Basic Key Figure' field, then I do not get any options.
    I would be highly grateful if you can let me know how to create this 'Basic Key Figure' for table FAGLFLEXR.

  • How to Create ACCESS key for different users

    How to create or generate an ACCESS KEY which is required to make changes to the table V_FAGL_ACTIVEC (For New General ledger) for IDES 6.0. Is it created in table DEVACCESS, if so where or is it created in SU01 where user id's are maintained. Since I am working on IDES, I thought probably we can create it for each user in SU01, but dont know the steps to do it. Please help me. It is urgent.

    Hi
    ACCESS KEY - First of all its provided by SAP. You can get the key from http://service.sap.com -> SAP SUPPORT PORTAL -> Keys & Requests -> SCCR Keys -> Registration. Here u can register a DEVELOPER or an OBJECT, by this time SAP will give the ACCESS KEYS.
    **Note : To access http://service.sap.com u should have S number login or like that.
    Only after obtaining that ACCESS KEY, SAP will allow the DEVELOPER to create some objects or change or modify Delivered objects.
    Why ACCESS KEY - For creating or accessing any object some one should be responsible. Suppose, any issue arises with an object then can easily track the details who has created or modified.
    Reward with suitable points

  • How to create manual key for AES with 256 key size

    we are just finding Different Approch for secure Key Genration and Store.
    For security purpose which way would be secure to store key in database and retrive that key.
    And can u tell me how to create secure maual key.
    Database user has access they should not able to find the what key we are using .
    Anybody has idea.

    1) Use 'keytool' with option -genseckey
    2) Use SecureRandom and store in a Java Keystore.
    3) Use a Secure Random with something like http://www.strongkey.org/
    4) Use hardware encryption such as produced by nCipher and others.
    There are many other approaches and I would suggest that you bring in an expert to advise you.

  • How to create HMAC256 Key from Key Manager (SAP SWIFT Integration Package)

    Hi,
    I am not sure how to create key HMAC Key. There is 2 input
    Key id = .............
    Key value = .................
    I have tried many times but still having below errors message.
    com.sapcons.xi.swift.CryptServiceException: Parameter key Value is invalid
    Is there any documentation on this ?
    Thank You and Best Regards
    Hidayat

    Solved.
    Key Value Length must be 32 bytes.
    The first 16 digit must be at least 1 number, 1 upper case, 1 lower case.
    The seconds 16 digit also the same.
    each character cannot repeated more than 7 times per each halft.
    There is no documentation about this, i just extract the SCA file and check the program logic.

  • How to create hot key?

    Hi all,
    I'm creating an application by using the J2SE v 1.4.2_10 SDK with NetBeans 4.1 Bundle. I have created 4 button and handles event each. I would like to create a hotkey for each button, "F2" key for jButtton2, "F3" key for jButton3, "F8" key for jButton4, "F1" key for jButton5, once i click on the key, the event will be triggered and the coding inside will be executed.
    Actually I have read through a few including How to Write a Key Listener, How to Write a Component Listener, How to Write an Action Listener, How to Use Actions, How to Use Key Bindings... but i really not so clear about that and don't know how to apply that into my task... Hope someone can help me...Thanks
    The following is part of my coding...
    * RegisterStudent_ADD.java
    * Created on November 15, 2005, 11:12 PM
    import java.awt.*;
    import java.sql.*;
    import javax.swing.*;
    import java.lang.*;
    public class RegisterStudent_ADD extends javax.swing.JFrame {
        /** Creates new form RegisterStudent_ADD */
        public RegisterStudent_ADD() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
        private void initComponents() {
            jDialog1 = new javax.swing.JDialog();
            jOptionPane1 = new javax.swing.JOptionPane();
            jLabel7 = new javax.swing.JLabel();
            jLabel6 = new javax.swing.JLabel();
            jLabel5 = new javax.swing.JLabel();
            jLabel4 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel8 = new javax.swing.JLabel();
            jTextField2 = new javax.swing.JTextField();
            jTextField3 = new javax.swing.JTextField();
            jTextField4 = new javax.swing.JTextField();
            jTextField5 = new javax.swing.JTextField();
            jButton5 = new javax.swing.JButton();
            jSeparator2 = new javax.swing.JSeparator();
            jLabel1 = new javax.swing.JLabel();
            jSeparator1 = new javax.swing.JSeparator();
            jButton2 = new javax.swing.JButton();
            jButton3 = new javax.swing.JButton();
            jButton4 = new javax.swing.JButton();
            jLabel3 = new javax.swing.JLabel();
            jDialog1.getContentPane().setLayout(null);
            jDialog1.getContentPane().add(jOptionPane1);
            jOptionPane1.setBounds(0, 0, 262, 90);
            getContentPane().setLayout(null);
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setTitle("Register Student - ADD");
            jLabel7.setText("Student Phone No");
            getContentPane().add(jLabel7);
            jLabel7.setBounds(5, 180, 150, 14);
            jLabel6.setText("Student Address");
            getContentPane().add(jLabel6);
            jLabel6.setBounds(5, 155, 150, 14);
            jLabel5.setText("Student IC# ");
            getContentPane().add(jLabel5);
            jLabel5.setBounds(5, 130, 150, 14);
            jLabel4.setText("Student Name");
            getContentPane().add(jLabel4);
            jLabel4.setBounds(5, 105, 150, 14);
            jLabel2.setText("Student Code");
            getContentPane().add(jLabel2);
            jLabel2.setBounds(5, 80, 150, 14);
            jLabel8.setBorder(new javax.swing.border.BevelBorder(javax.swing.border.BevelBorder.LOWERED));
            getContentPane().add(jLabel8);
            jLabel8.setBounds(130, 75, 160, 19);
            jTextField2.setColumns(8);
            jTextField2.setName("");
            getContentPane().add(jTextField2);
            jTextField2.setBounds(130, 100, 160, 19);
            jTextField3.setColumns(8);
            jTextField3.setName("");
            getContentPane().add(jTextField3);
            jTextField3.setBounds(130, 125, 160, 19);
            jTextField4.setColumns(8);
            jTextField4.setName("");
            getContentPane().add(jTextField4);
            jTextField4.setBounds(130, 150, 340, 19);
            jTextField5.setColumns(10);
            jTextField5.setName("");
            getContentPane().add(jTextField5);
            jTextField5.setBounds(130, 175, 160, 19);
            jButton5.setText("F1-Retry");
            jButton5.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton5ActionPerformed(evt);
            getContentPane().add(jButton5);
            jButton5.setBounds(5, 34, 90, 23);
            getContentPane().add(jSeparator2);
            jSeparator2.setBounds(0, 30, 800, 2);
            jLabel1.setText("Register Student");
            getContentPane().add(jLabel1);
            jLabel1.setBounds(5, 10, 150, 14);
            getContentPane().add(jSeparator1);
            jSeparator1.setBounds(0, 60, 800, 2);
            jButton2.setText("F2-NxRec");
            jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton2ActionPerformed(evt);
            getContentPane().add(jButton2);
            jButton2.setBounds(100, 34, 90, 23);
            jButton3.setText("F3-PreRec");
            jButton3.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton3ActionPerformed(evt);
            getContentPane().add(jButton3);
            jButton3.setBounds(195, 34, 90, 23);
            jButton4.setText("F8-Save");
            jButton4.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton4ActionPerformed(evt);
            getContentPane().add(jButton4);
            jButton4.setBounds(290, 34, 90, 23);
            jLabel3.setText("mode : ADD");
            jLabel3.setBorder(new javax.swing.border.TitledBorder(""));
            getContentPane().add(jLabel3);
            jLabel3.setBounds(680, 3, 100, 25);
            setBounds(0, 0, 800, 600);
        // </editor-fold>
        private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
    ......//some coding here.
        private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                             
    ......//some coding here.
        private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    ......//some coding here.
        private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    ......//some coding here.
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new RegisterStudent_ADD().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton3;
        private javax.swing.JButton jButton4;
        private javax.swing.JButton jButton5;
        private javax.swing.JDialog jDialog1;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JLabel jLabel4;
        private javax.swing.JLabel jLabel5;
        private javax.swing.JLabel jLabel6;
        private javax.swing.JLabel jLabel7;
        public javax.swing.JLabel jLabel8;
        private javax.swing.JOptionPane jOptionPane1;
        private javax.swing.JSeparator jSeparator1;
        private javax.swing.JSeparator jSeparator2;
        private javax.swing.JTextField jTextField2;
        private javax.swing.JTextField jTextField3;
        private javax.swing.JTextField jTextField4;
        private javax.swing.JTextField jTextField5;
        // End of variables declaration
    }Ning.

    Use the Action architecture (http://java.sun.com/products/jfc/tsc/articles/actions/):
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.Action;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.KeyStroke;
    public class HotKeyComponent extends JPanel {
         public static void main(String[] args) {
              HotKeyComponent c = new HotKeyComponent();
              UselessAction a1 = new UselessAction("Action 1", "action.1", KeyStroke.getKeyStroke("F1"));
              UselessAction a2 = new UselessAction("Action 2", "action.2", KeyStroke.getKeyStroke("F2"));
              UselessAction a3 = new UselessAction("Action 3", "action.3", KeyStroke.getKeyStroke("F4"));
              c.addButton(a1);
              c.addButton(a2);
              c.addButton(a3);
              JFrame frame = new JFrame("HotKey Test");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setBounds(100, 100, 400, 300);
              frame.add(c);
              frame.setVisible(true);
         public void addButton(Action action) {
              Object command = action.getValue(Action.ACTION_COMMAND_KEY);
              KeyStroke stroke = (KeyStroke)action.getValue(Action.ACCELERATOR_KEY);
              getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(stroke, command);
              getActionMap().put(command, action);
              JButton button = new JButton(action);
              add(button);
         static class UselessAction extends AbstractAction {
              public UselessAction(String name, Object actionCommand, KeyStroke stroke) {
                   putValue(Action.NAME, name);
                   putValue(Action.ACTION_COMMAND_KEY, actionCommand);
                   putValue(Action.ACCELERATOR_KEY, stroke);
              public void actionPerformed(ActionEvent actionEvent) {
                   System.out.println("actionPerformed " + getValue(Action.NAME));
    }The example contains three buttons. You can either click them, or press the key which is mapped to an Action.

  • How to create foreign key automatically?

    I am writing to seek help, in regards creating foreign key automatically, when I insert data into my ''price'' table.  I have 2 tables, one called prices and names.  the relationship between them, if that one name can have many prices and one price
    can have many names (many-to-many). Hence, i have junction table called  "Name_Prices", as shown below in the sample database schema:
    Names
    name_id [pk]
    name
    type
    UploadDate
    Prices
    Price_id [pk]
    name_id [fk]
    price
    uploadDate
    Name_Prices
    name_id REFERENCE names (name_id)
    price_id REFERENCE prices (price_id)
    PRIMARY KEY (name_id, price_id)
    The  price's data input comes in as CSV file everyday. (please see the example below) :
    name name_type price UploadDate
    ALBA MBS 93.5 17/10/2014
    ALESC Trup 58 17/10/2014
    ALESC Trup 52 17/10/2014
    My desire goal/output is to be able to create a functionality, where I can insert the price's data into the database (''prices''), it will automatically insert foreign key in the price
    table (from the names table), and if there is a new price's name, then the database will create a new name id for it, in the name's table, transferring the name, its type, from the CSV input data. 
    In order to achieve this task, where would I start implementing this logic?(in SQL server or application-side) what steps does this involve and is this task achievable, all in sql server side (i.e. store procedure, functions etc..). 
    Apology in advance, if the question is not clear to understand, i happy to follow up with further questions, if required.  
    Any help would be very appreciated. Many thanks

    As noted above, I modified the design:
    Products
    Product_id [pk]
    Product
    type
    UploadDate
    Prices
    Price_id [pk]
    price
    uploadDate
    Product_Prices
    Product_id REFERENCE Products (Product_id)
    price_id REFERENCE prices (price_id)
    PRIMARY KEY (Product_id, price_id)
    Note
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

Maybe you are looking for