Re: Return Values from INSERT
Michael Austin wrote:
> As a DBA and previoulsy a database engineering support engineer, I tend
> to use the data to self-describe the primary key - something like phone
> number (generally unique) instead of relying on a generated key for the
> PK. When I must use this method (generated key) - I use a trigger to
> insert that id into child tables during the insert command so that key
> exists in the child tables.
>
Thanks (to you and to others). The data itself is too unwieldy to use
without an auto-generated key - I would have to combine data from five
different columns of mixed data types to create a unique index out of
it. I don't know if that is a lot of overhead with the way MySQL works
or not, but had a hunch it might be so went with the autogenerated
route. Also makes it more resource friendly when using as the foreign
key in the main table, if I understand what you're saying correctly.
Cheers,
-Taliesin.
|