Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old October 1st, 2008, 09:22 AM
Member
 
Join Date: Jul 2007
Posts: 45
Default 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
Reply
  #2  
Old October 1st, 2008, 03:24 PM
Administrator
 
Join Date: Sep 2006
Posts: 11,312
Default

You'll need a sequence since oracle does not have auto increment.
Reply
  #3  
Old October 1st, 2008, 03:35 PM
Member
 
Join Date: Jul 2007
Posts: 45
Default

ok But can i implement this through the designer of vb.net or do i have to recreate the table
Reply
  #4  
Old October 1st, 2008, 04:09 PM
Administrator
 
Join Date: Sep 2006
Posts: 11,312
Default

Quote:
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.
Reply
  #5  
Old October 2nd, 2008, 06:02 AM
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 6,870
Default

you need to use sequence as suggested .
Use the sequenename.nextval to generate a new number and insert the same to the table PK field.
Reply
  #6  
Old October 2nd, 2008, 10:44 AM
Member
 
Join Date: Jul 2007
Posts: 45
Default

if i create a sequence before my pl/sql it doesn't execute the insert statement
Reply
  #7  
Old November 21st, 2008, 04:25 PM
Member
 
Join Date: Jul 2007
Posts: 45
Default

Imanged to get the sequence sorted
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles