Subject Re: [firebird-support] using sql to update record individually
Author Helen Borrie
At 02:54 AM 26/07/2003 +0000, you wrote:
>using sql to update record individually
>
>I have 2 table one is items and the other is invoicedetails
>
>recently I have added an additional field to the invoicedetails,
>which a UNIT2 and CONVERSION. This 2 fields exists on the items
>table. Since the field UNIT2 and conversion is just recently added, I
>want to fill those null fields with values from the items table.
>
>Is there a sql statement to do this job? But not using stored
>procedures.

Yes, using correlated subqueries in two cursors, but it's slow. (SP would
be quicker).

update invoicedetails id
set id.unit2 = (select i1.unit2 from items i1 where i1.itemid = id.itemid),
id.conversion = (select i2.conversion from items i2 where i2.itemid =
id.itemid) ;

heLen


>thanks.
>
>
>
>To unsubscribe from this group, send an email to:
>firebird-support-unsubscribe@yahoogroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/