Results 1 to 2 of 2
  1. #1
    waboke is offline Member
    Join Date
    Apr 2010
    Posts
    2
    Rep Power
    0

    Default How to insert random number to database

    I am writing a database application to keep stock and sales how do i fix primary key with random numbers?

  2. #2
    Sno's Avatar
    Sno
    Sno is offline Senior Member
    Join Date
    Apr 2010
    Posts
    196
    Rep Power
    5

    Default

    What you state isn't logical

    a Primary Key is suppose to either be unique or auto-incrementing in most cases

    Why random numbers?

    Stock_Table
    Stock_ID - P - Auto Increment Integer
    Random_ID - Integer - your Random number
    :rolleyes: ~ Sno ~ :rolleyes:
    '-~ B.S. Computer Science ~-'

Similar Threads

  1. Replies: 3
    Last Post: 02-28-2009, 09:17 AM
  2. Generating a random number
    By oridov in forum New To Java
    Replies: 2
    Last Post: 11-29-2008, 05:12 PM
  3. Random number help
    By jgonzalez14 in forum New To Java
    Replies: 5
    Last Post: 09-16-2008, 09:13 AM
  4. Random number
    By jithan in forum Advanced Java
    Replies: 1
    Last Post: 06-13-2008, 01:42 PM
  5. Generate a random number
    By romina in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 05:23 AM

Posting Permissions

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