Mitchell Vincent wrote:

D. Richard Hipp wrote:

On Thu, 2005-06-23 at 15:32 -0400, Mitchell Vincent wrote:

Shoot! I meant to say that I need it to work with 2.8.16 (which was the entire issue!)..

*crosses fingers* any way to make that happen?


Not really.  Version 2 is in maintenance - meaning
bugfixes only.  All new features go into version 3.


Well, I meant any way to accomplish what I'd like to do in version 2 (doesn't matter how)..

Mitchell,

You can accomplish the same thing with something like the SQL below. I have abbreviated your field names, but you should get the idea.

   --use a transaction to ensure it all gets done (or nothing is changed)
   begin transaction

   --create a temporary detail table with the same columns as your
   permanent detail table
   create temp table t_det(c_name, c_id, c_other);

   --copy the data into the temp table from either the customer table
   -- joined by name, or the existing detail table
   insert into t_det select cd.c_name, coalesce(c.id, cd.c_id), cd.c_other
       from c_det as cd left join cust as c using(c_name);

   --delete all the records from the permanent detail table
   delete from c_det;

   --copy the temp table back into the permanent table
   insert into c_det select * from t_det;

   --delete the temp table
   drop table t_det;

   commit transaction

HTH
Dennis Cote

Reply via email to