Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: need help with sequence
"Karl Hungus" <nnnnndddddd_at_hotmail.com> wrote in message
news:4fO_b.196$1e3.135830_at_twister.nyc.rr.com...
|
| Im writting a little poll application using oracle, and I want to
| autoincrement the votes.
|
| My table has a column that holds the votes for each person, and is set up
| like this:
|
| person_id number
| votes number
|
| If I wanted to use sequences, would I need to create 10 separate
sequences,
| assuming there are ten people being voted on?
|
| Thanks in advance,
| Karl
|
|
|
typically one sequence is created for each system-assigned PK (or UK) constraint -- so for PERSON_ID you just need one sequence
however, your intention is not quite clear -- do you intend to create a new record for each 'batch' of votes (multiple poll records per PERSON_ID) or do you just want to increment the VOTES column? sounds like you probably need at least three tables: PERSONS, POLLS, POLL_RESULTS
;-{ mcs Received on Tue Feb 24 2004 - 15:17:24 CST
![]() |
![]() |