Subject | Re: [firebird-support] Correct use of "UPDATE OR INSERT...." |
---|---|
Author | Eduardo Lopez |
Post date | 2008-02-01T13:50:57Z |
Thanks Sasha, i'm already using a stored procedure, to insert or update an item in a stock table.
Just now, i'm doing a select to find if the records exists and do the corresponding insert or update the quantity of stock.
I think that the new syntax could be more simple and clear, with few lines of code.
Eduardo.
Solicitá tu nueva Tarjeta de crédito. De tu PC directo a tu casa. www.tuprimeratarjeta.com.ar
Just now, i'm doing a select to find if the records exists and do the corresponding insert or update the quantity of stock.
I think that the new syntax could be more simple and clear, with few lines of code.
Eduardo.
> Although I really can't see any reasons you would want to do it this way. Have you considered writing a procedure that would encapsulate your desidered behaviour?Tarjeta de crédito Yahoo! de Banco Supervielle.
> I've tried, but no luck: UPDATE OR INSERT INTO MYTABLE (MY_ID, NAME,
> MY_QTY) VALUES ( 1 , 'Something', OLD.MY_QTY + 7)
>
> You can't use old and new in this context.
> Sasha
Solicitá tu nueva Tarjeta de crédito. De tu PC directo a tu casa. www.tuprimeratarjeta.com.ar