Serial Fields
Posted in 2000
I have a question regarding serial fields and one-to-many relationships. We have a USER table (Primary Key=user_id:serial), an ADDRESS table (Primary Key=address_id:serial) and an intermediate table USER_ADDRESS (Foreign Keys: user_id, address_id) to model the 1-to-many relationship. I'm working on a web application that needs to insert a new record on all 3 tables. Because it is web-based, all 3 tables are being updated in one transaction. How can I properly populate the USER_ADDRESS table? Is there a way to find the next sequence number without necessarily "commit"-ing the transaction? How is this normally done in a client-server environment? Thanks in advance! * Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful