db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Legolas Woodland <legola...@gmail.com>
Subject Auto increment fields , evil or good ? I need advice on a design
Date Tue, 22 Nov 2005 20:39:36 GMT
Thank you for reading my post.
here is my question :
using auto increment fields are good or bad ?
what is best practice for them : When to use them , how to use them , when
to avoide them?

consider the following condition :
I have one table which is related to another table in a one-to-one relation.
parent table primary key is auto increment (what should i use if auto
increment is evil?)
now i insert a record into parent Table , i should include parent table
Primary key into child table
to relate it with parent table.
after i insert parent record i should execute a select statement to find the
inserted record Primary key and include it into child table record
My question is :
how i can avoide this select statement execution ?
what should i use instead of That auto increment field ?

Thank you so much.

View raw message