Auto Increment

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • truezplaya
    New Member
    • Jul 2007
    • 115

    Auto Increment

    Hey all
    I currently have an application in vb that reads and writes to a oracle table.
    My problem is getting it to write to the table as i wish to have the PK column as auto increment by one.

    Is there any way i can do this through the design mode(of the oracle table) in visual studio?

    The error is just saying that i can't insert a null value in to the PK of the table but if it auto incremented this would dissapear any help would be hugely appreciated

    Cheers
    truez
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    You'll need a sequence since oracle does not have auto increment.

    Comment

    • truezplaya
      New Member
      • Jul 2007
      • 115

      #3
      ok But can i implement this through the designer of vb.net or do i have to recreate the table

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by truezplaya
        ok But can i implement this through the designer of vb.net or do i have to recreate the table
        That may well be better answered in the .NET forum.

        Comment

        • debasisdas
          Recognized Expert Expert
          • Dec 2006
          • 8119

          #5
          you need to use sequence as suggested .
          Use the sequenename.nex tval to generate a new number and insert the same to the table PK field.

          Comment

          • truezplaya
            New Member
            • Jul 2007
            • 115

            #6
            if i create a sequence before my pl/sql it doesn't execute the insert statement

            Comment

            • truezplaya
              New Member
              • Jul 2007
              • 115

              #7
              Imanged to get the sequence sorted

              Comment

              Working...