Oracle Sequences

lsdev

Well-known member
Joined
Jan 20, 2008
Messages
61
Programming Experience
1-3
I have a table with a primary key and I have created a sequence, which works fine in oracle. But what I would like to know is how I can use this in vb.net 2005. I would ideally like to be able to call Client_Seq.nextVal when the add a new client but is pressed on my binding navigator, so that it populates the text box on the form before the form is filled and the data inserted. How can i achieve this?
 
you cant, you dont.. just use a trigger to populate the number, and in VS2005 say that the field is autoincrement

when you click NEW you get a TEMPORARY id made by the client software
you save, the REAL id is written and then returned
the user sees the id
 
you cant, you dont.. just use a trigger to populate the number, and in VS2005 say that the field is autoincrement

when you click NEW you get a TEMPORARY id made by the client software
you save, the REAL id is written and then returned
the user sees the id

Ok just to add how does vb.net deal with autoincremented number in a multi-user environment? is using a sequence the right way to do about it?
So basically using a sequence in the way I need to you get vb to ignore the number it creates and this is replaced with the nextvalue of the sequence?
 
Ok just to add how does vb.net deal with autoincremented number in a multi-user environment? is using a sequence the right way to do about it?
So basically using a sequence in the way I need to you get vb to ignore the number it creates and this is replaced with the nextvalue of the sequence?

Correct. VB uses autoinc nubmers only for its own use and they are replaced with real ids when the record is saved
 
Back
Top