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

Similar Messages

  • How to create window key without using the trillium option

    Hi,
    I am having some problems when trying to create using the window key generator module in ODI data quality.
    I created a business data parser for cleansing my records. This had to pass thru 4 routines, the transformer, parser, window key generator and the matcher routines. The transformer and parser routines have run properly but they window key generator is asking me to specify the window key.( I created the rules for the window key. Like last 3 consonants of last name and 5 digits of some ID). But this is not getting accepted when i am running it and pops an error message.
    I also do not have the trillium module integrated with ODI as of now.
    Can anyone help me with this problem or anyone has faced the same situation and have tried a work around for it.
    Please let me know.
    Thanks,
    Chapanna

    Hi,
    If you are using file-based installation, you can install as non-root user and create domains as usual. You can use asadmin command available at <AS_INSTALL>/bin to do this.
    ex: ./asadmin create-domain domaindir /tmp/justfortest adminport 4850 --adminuser admin domain_nonroot_test
    Did you face any problem doing this in non-root. Unless you have write permissions in domaindir, you won't be facing any problem.
    Hope this clarifies your question.
    Thanks,
    -Balaji.

  • Generating a Primary Key WITHOUT using a Sequence Number

    Hi Everyone:
    I am trying to generate a primary key without using a sequence number or row count. What the user wants is the maximum value of the highest primary key already in the row set plus 1.
    For example, this is a Oracle Table (eg. named BatchSubmit) used to initiate batch job submission, and the primary key is an integer named "Runcard_Number". If there are 4 rows in this table and the Runcard_Numbers are 2, 6, 8 & 12, then the next generated Runcard_Number would be 13.
    I have looked throughout this forum and see how to generate numbers using a DBSequence, but the user does not want that. The numbers mean something to them, and they don't want them randomly assigned other than the max in the rowset plus 1. To do it in SQL it would be - select max(Runcard_Number) + 1 from BatchSubmit;
    I have been looking at using a hasnext loop and moving the maximum value to the new Runcard_Number, but I am very new to JHeadstart/JDev and I do not know where to put this. I am assuming the BatchSubmitImpl.java, but I'm not sure where to put it or which method to utilize
    I would appreciate any assistance.
    Mary
    U o Windsor

    Mary you're in luck, 'cause, I've been playing with the same thing, these days and found that..
    You can do that in two ways (that I know):
    - by calling a stored function that does max+1 (you can look it up in Dev's guide for Forms&4GLDevs 10g chapter 25.5 Invoking Stored Procedures and Functions)
    - by calling hardcoded or dinamicaly written statement, that does the same
    public Number callStatement(String stmt)
    Number id = new Number(0);
    Row idRow = getDBTransaction().createViewObjectFromQueryStmt(stmt).next();
    if(idRow != null)
    Object o = idRow.getAttribute(0);
    if(o != null)
    if(o instanceof Number)
    id = (Number)o;
    else
    throw new JboException("Conversion error!");
    return id;
    You should call it in
    protected void doDML(int operation, TransactionEvent transactionEvent)
    switch (operation)
    case DML_INSERT:
    // call here
    super.doDML(operation, transactionEvent);
    break;
    case DML_UPDATE:
    super.doDML(operation, transactionEvent);
    break;
    case DML_DELETE:
    super.doDML(operation, transactionEvent);
    break;
    Enjoy!
    S. Julijan

  • How to generate new perner number using Abap Code in pa0002. what is the fu

    how to generate new perner number using Abap Code in pa0002. what is the function Module used.

    hi
    define internal number ranges for ur implementation then when u run PA 40  do not input any employee number , system will generate the employee number automatically.
    Regards
    sameer

  • How do i install opensolaris without using the virtual box??

    hi.
    i am new to solaris
    i am currently using a windows XP OS
    i got down the opensolaris cd from SUN
    how do i install opensolaris without using a virtual box ?

    The OpenSolaris CD is a "Live CD". You can boot off of the CD, and either run the OpenSolaris operating system directly, or you can select the "Install" icon on the LiveCD desktop. You can find full instructions here: http://dlc.sun.com/osol/docs/content/IPS/getst1.html
    Do you want to keep your Windows OS on the disk? If so, then you want to follow the instructions for partitioning your disk (unless you already have a spare partition).
    -- Alan

  • How to connect to AD without using ADWS?

    How to connect to AD without using ADWS? Is it possible to do it? If yes, can teach me how to connect to AD and find their attributed?

    Hi Noobycy,
    There are few tools to find AD attributes without ADWS. See options you have below
    1.ADFIND -
    http://www.joeware.net/freetools/tools/adfind/  This is a command Line tool
    2.
    The ADSIEDIT tool
    from the Windows Support Tools is a great tool to "explore" the AD.
    http://technet.microsoft.com/en-us/library/cc731547.aspx
    3. ADUC -
    http://www.boostsolutions.com/blog/how-to-find-attributes-of-objects-in-active-directory/
    Regards, MassonTech

  • Hello! I'm out of the country and all my iWeb information is on my computer at home. Now I need to make changes on the webpage... how can i do that without using the computer i made the page on? Thank you!!

    Hello! I'm out of the country and all my iWeb information is on my computer at home. Now I need to make changes on the webpage... how can i do that without using the computer i made the page on? Thank you!!

    iWeb uses the domain.sites2 files to store its assets.
    You'll find it here :
    ~/Library/Application Support/iWeb/
    where ~ is your Home directory.
    If you take a computer with you, you have to store that file in the same location.
    It's not different from taking documents with you if you want to edit them.
    A solution is to remotely control your computer at home.
    TeamViewer, LogMeIn, Apple Remote Desktop or any VNC application you can use, like "Chicken of the VNC".

  • Note:304522.1 How to Move Queue Tables without using export import

    Trying to use the pkg available in Metalink "Note:304522.1 How to Move Queue Tables without using export import"
    Using the 10.1.0.x and upwards Package, I'm getting the following error on a single consumer queue table with an xmltype payload:
    SQL> exec move_aqt.move('XFORM_TEST_INT','INTERFACE_XML_QUEUE','SMALLBLOCK');
    BEGIN move_aqt.move('XFORM_TEST_INT','INTERFACE_XML_QUEUE','SMALLBLOCK'); END;
    ERROR at line 1:
    ORA-20000: ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.MOVE_AQT", line 652
    ORA-06512: at line 1
    We've tried in multiple environments, always with the same results.
    Trace file shows:
    *** 2006-11-08 10:06:47.154
    *** SERVICE NAME:(SYS$USERS) 2006-11-08 10:06:47.147
    *** SESSION ID:(379.954) 2006-11-08 10:06:47.147
    qtable move procedure starting execution at 08-11-2006 10:06:47 for queue table XFORM_TEST_INT.INTERFACE_XML_QUEUE
    qtable move procedure experienced an exception at 08-11-2006 10:06:47
    qtable move error message ORA-06502: PL/SQL: numeric or value error
    qtable move procedure ended execution at 08-11-2006 10:06:47
    Can anyone help with this? Has anyone used this before successfully (or not successfully). We urgently need this working today to test moving our queue table into a tablespace with a smaller block size for performance reasons in production.
    Thanks for the help!
    Tony

    Thank you,
    Yes we've done that. They've confirmed a problem with the links/scripts on the note. The 10.1 and up version was not really 10.1 and up.
    As they would not have a new version available in time for the move we needed to perform, we switched our approach to using dbms_redefinition instead.
    Thanks for the reply,
    Tony

  • HT4993 how to unlock my passcode without using itunes

    how to unlock my passcode without using itunes

    cannot be done without itunes
    http://support.apple.com/kb/ht1212

  • How to connect from java without using oracle client installation

    hi ,
    Please tell me how to connect from java without using oracle client
    Thanks & Regars

    http://www.orafaq.com/wiki/JDBC#Thin_driver

  • HT4061 I bought my mom an iPad for Christmas this year.  We can't use it as it will not recognize her passwords.  How do I reset it without using passwords.  I want this thing wiped clean, just like it came from the store so that I might start over.

    I bought my mom an iPad for Christmas this year.  We can't use it as it will not recognize her passwords.  How do I reset it without using passwords.  I want this thing wiped clean, just like it came from the store so that I might start over.  This is very frustrating!

    How can I unlock my iPad if I forgot the passcode?
    http://www.everymac.com/systems/apple/ipad/ipad-troubleshooting-repair-faq/ipad- how-to-unlock-open-forgot-code-passcode-password-login.html
    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    You may have to do this several times.
     Cheers, Tom

  • Hey guys i please i need a help on my ipad. i have received an ipad from anonymous person but she has already logged in to iclouds, since i dont know her password how do i sign out without using password on ios 8?

    Hey guys i please i need a help on my ipad. i have received an ipad from anonymous person but she has already logged in to iclouds, since i dont know her password how do i sign out without using her password on ios 8?

    You can't. Your mysterious benefactor must remove the device from her (I guess you know it's a her?) iCloud account by logging into icloud.com, going to Find my iPhone and removing from there.
    Matt

  • How to generate a  number sequence for a column of a Z*table?

    Hi ,
    How to generate a  number sequence for a column of a Z*table?
    plz guide me.
    thanks
    Albert

    1) Use SNRO for defining a number range.
    2) Use FM NUMBER_GET_NEXT for getting the next number with object, sub object etc..
    See one example below.
          CALL FUNCTION 'NUMBER_GET_NEXT'
            EXPORTING
              nr_range_nr                   = c_01
              object                        = c_z_prd_code
    *           QUANTITY                      = '1'
             subobject                     = p_vkorg
    *           TOYEAR                        = '0000'
    *           IGNORE_BUFFER                 = ' '
           IMPORTING
             number                        = in_prd_code
    *           QUANTITY                      =
    *           RETURNCODE                    =
            EXCEPTIONS
                  interval_not_found            = 1
                  number_range_not_intern       = 2
                  object_not_found              = 3
                  quantity_is_0                 = 4
                  quantity_is_not_1             = 5
                  interval_overflow             = 6
                  buffer_overflow               = 7
                  OTHERS                        = 8
    3) You may write these code in main program of the table maintinence
    rgds,
    TM.

  • 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 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

Maybe you are looking for

  • IPod won't sync TV shows!!!!

    Ok, so I bought 3 NCIS episodes. When I tried to sync them, nothing happened. THe songs I purchased after them didn't sync either. I had to move the NCIS down to the bottem of the list to get the rest of the rest of the music to sync. Am I stupid or

  • ICR Process 2 - Parallel Recon by Trading Partner (TP) and TP Profit Center

    Experts, At my current implementation, I would like to reconcile accounts (Process 2) by trading partner, and also by trading partner profit center, essentially reconciling the same data for a period in two different ways. Instead of reconciling data

  • ECC6.0 EHP4 upgrade best approach

    Hi, What will be best approach for the following scenario: Source: OS - Windows2000,32bit DB - Oracle 10g SAP - R/3 4.7Ent,NUC Target: OS - Windwos2008,64bit DB - Oracle 11i SAP - ECC6.0 EHP4,NUC Any suggestions? Thanks and Regards,

  • Routing xml (non-soap) messages in OWSM

    Hi all, Normaly we receive soap message from our business partners. These soap messages are then routed internally (by OWSM) to our services based on content (content based routing). OWSM is used as a proxy. Partners do not refer to a specific servic

  • External  table directory

    hi i am trying external table for my flat files. i make directory through dirctory command .it's created successfully.but at specified location there is no directory where i can put these flat files.plzz help wuts the matter and how i can put these f