replace into products_stock
select <@WSTOCKOPTIONSID@> , <@KEY@>, '<@STK@>' ,<@FQTYONHAND@> 
@@GO@@
update products set products_quantity = (select sum(products_stock_quantity) from  products_stock where products_id = <@KEY@>)
where products_id = <@KEY@>
@@GO@@

