Subject | Re: [ib-support] update problem |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2002-07-17T05:12:53Z |
On 16 Jul 2002 at 17:16, Ben Johnson wrote:
like that:
CREATE PROCEDURE UpdateProduct AS
DECLARE VARIABLE new_product_nm VARCHAR(200);
DECLARE VARIABLE new_product_id INTEGER;
BEGIN
FOR SELECT id, product_nm
FROM new_product
INTO :new_product_id, :new_product_nm DO
UPDATE product SET product_nm=:new_product_nm
WHERE id=:new_product_id;
END#
SY, Dimitry Sibiryakov.
>UPDATE product P SET product_nm = (select product_nmIf I were you, I'd put this work into a stored procedure. Something
> FROM new_product NP where NP.id = P.id) ;
>
>Is the above SQL statment correct? I just want to replace
>the product name in the product table with the name from
>the new_product table.
like that:
CREATE PROCEDURE UpdateProduct AS
DECLARE VARIABLE new_product_nm VARCHAR(200);
DECLARE VARIABLE new_product_id INTEGER;
BEGIN
FOR SELECT id, product_nm
FROM new_product
INTO :new_product_id, :new_product_nm DO
UPDATE product SET product_nm=:new_product_nm
WHERE id=:new_product_id;
END#
SY, Dimitry Sibiryakov.