Subject Re: [firebird-support] Update from select
Author Helen Borrie
At 06:43 PM 22/06/2004 +0100, you wrote:
>Is there any way to do this (ingres) sql in firebird? Short of an SP I can't
>think of one.
>
> EXEC SQL UPDATE tt_spirit_02 t
> FROM bx_house_tillmod_excpt b
> SET bx_modifier_code = b.bx_modifier_code,
> join_made = 'Y'
> WHERE b.outlet_no = :l_cur_hse
> AND b.bxp_code = int4(t.item_code)
> AND b.till_modifier_code = int4(t.modifier_code);

Try this:

UPDATE tt_spirit_02 t
SET t.bx_modifier_code =
(select b.bx_modifier_code
FROM bx_house_tillmod_excpt b
WHERE b.outlet_no = :l_cur_hse
AND b.bxp_code = CAST(t.item_code AS INTEGER)
AND b.till_modifier_code = CAST(t.modifier_code AS INTEGER)),
t.join_made = 'Y';

If it doesn't work then, yep, you're looking at a stored procedure or a
subquery on a view.

/heLen