DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Primary Keys

  1. #1
    Join Date
    Jan 2000
    Location
    Adelphi, Md. USA
    Posts
    28
    Hi Gurus,

    Please clarify regarding the 32 bit primary key implementation.

    If Oracle is running on our NT server, then can Oracle generate 32
    bit primary keys?

    Thanks

  2. #2
    Join Date
    Dec 1999
    Location
    Alpharetta, GA, US
    Posts
    192
    Can you explain some more.
    Oracle is it self 32 bit. now they got the 64 bit version also.

    Good Luck
    Chan
    OCP7.3/8.0/8i/9i
    Sun Certified Sys. Admin

  3. #3
    Join Date
    Jan 2000
    Location
    Adelphi, Md. USA
    Posts
    28

    Binary Primary Keys

    Hi,

    We have several sites where data would be comming from, and we are looking at Oracle generating a binary primary key ensuring the uniqueness of the data belonging to a particular site. The first 12 would be consistent with the site identification and the rest of the key would identify the element. The concept is like generating a composite key but in a 32 bit primary key.

    I hope I am clear as this is a new one on me that the client is requesting. I am not sure that Oracle can do this.

    Thanks

  4. #4
    Join Date
    Jun 2000
    Posts
    417
    I don't think Oracle can automatically generate this key, especially if the first 12 bits are site specific. What you probablly want is a small custom key generator. You could probablly write one in PL/SQL to keep everything inside of Oracle. You could concatentate the 12 bit site id with the 20 bit padded binary value of an oracle sequence if you want the lower 20 bits to just be incrementing.

    Oracle can't be expected to know how to make your custom keys :)

    As an added thought, is there any reason (apart from storage issues) why you can't do this with 2 fields? One field for the site_id and one field for the element_id? You can have primary keys made up of more than one field. It would make querying easier if you wanted to look at all the items from a specific site, etc. Then if they need this value (the 32 bit id), it can be generated inside a query using a procedure similar to what I described above.

    [Edited by pwoneill on 11-20-2000 at 04:17 PM]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width