Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread What's wrong?
Tue, Sep 21 2010 6:41 AMPermanent Link

Francisco Fernandez

NewTRON Informatica

Avatar

Hi all.

I have this line in a trigger

EXECUTE IMMEDIATE 'UPDATE ARTICULOS SET EXIST01=1 WHERE CODIGO='+QUOTEDSTR('0001');

The field EXIST01 take value 1 in field EXIST01 of row of CODIGO='0001' but all other rows of table ARTICULOS take NULL values.

Can anyone say me why?

Thank's.
Tue, Sep 21 2010 8:18 AMPermanent Link

Francisco Fernandez

NewTRON Informatica

Avatar

Hi again.

I'm trying and trying and curiosly now is working fine, I change to the definitive code:

EXECUTE IMMEDIATE 'UPDATE ARTICULOS SET EXIST'+NEWROW.ALMACEN+'='+CAST(CAN1 AS VARCHAR)+' WHERE CODIGO='+QUOTEDSTR(NEWROW.ARTICULO);

but when this instruction updates the first time a row of table ARTICULOS I get this error:

ElevateDB Error #700 An error was found in the statement at line 360 and column 23
(Missing SELECT, INSERT...)

curiosly the row is updated fine and the second time I execute the instruction on the same row works fine.

Any idea?

Thank's
Wed, Sep 22 2010 6:53 AMPermanent Link

Francisco Fernandez

NewTRON Informatica

Avatar

Hi.

The mistake was that sometimes CAN1 was taking NULL value.

Thank's and regards.
Image