Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 18 of 18 total
Thread Error 601
Mon, Jun 30 2008 2:55 PMPermanent Link

Francisco Fernandez
Hi Tim.

I disable triggers from the table and it works fine.

Regards
Mon, Jun 30 2008 4:09 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Francisco,

<< I disable triggers from the table and it works fine. >>

I understand that - but what were the triggers doing ?  IOW, what did the
trigger code look like ?  Was it updating the same table that the triggers
were defined on ?  If so, then you are probably using an older version of
EDB:

http://www.elevatesoft.com/incident?action=viewrep&category=edb&release=1.09&type=f&incident=2601

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Jul 1 2008 3:02 AMPermanent Link

Francisco Fernandez
Hi Tim

Don't worry.

Triggers is triying to update another table called "PROVEEDORES" but don't find the record
in this table, i think this is the cause of the error.

Can i write in the trigger anything like?

TRY
 ...
EXCEPT
 ...
END

Regards.
Tue, Jul 1 2008 4:58 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Francisco


In the manual 7.3 EXCEPTION

BEGIN
EXCEPTION
END

Roy Lambert [Team Elevate]


Tue, Jul 1 2008 11:41 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Francisco,

<< Triggers is triying to update another table called "PROVEEDORES" but
don't find the record in this table, i think this is the cause of the error.
>>

Yes, but it still shouldn't cause a corruption error message.  So, I'm sorry
to be such a pain about this, but if you could at least give me an example
of the trigger, I would really appreciate it.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Jul 1 2008 12:54 PMPermanent Link

Francisco Fernandez
Tim,

No problem, here are the trigger:

Trigger after insert in table COMPRAS


BEGIN
 DECLARE TempCursor CURSOR FOR stmt;
 DECLARE TempCantidad DECIMAL(12,2);
 PREPARE stmt FROM 'SELECT * FROM Proveedores WHERE CODIGO=?';
 OPEN TempCursor USING NEWROW.PROVEEDOR;
 FETCH FROM TempCursor (TOTALC) INTO TempCantidad;
 If TempCantidad IS NULL THEN
   UPDATE TempCursor SET TotalC=NEWROW.TOTALBASE;
 ELSE
   UPDATE TempCursor SET TotalC=TempCantidad+NEWROW.TOTALBASE;
 END IF;
 UPDATE TempCursor SET FECHAULTC=NEWROW.FECHA;
END

Regards
Tue, Jul 1 2008 2:22 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Francisco,

<< No problem, here are the trigger: >>

Thank you very much.  I'll see what I can find out.  I suspect that the
issue is a simple one of the FETCH trying to fetch a row incorrectly or the
UPDATE trying to update the wrong row.  It's virtually impossible for the
engine itself to update the wrong row due to the fact that the engine has to
identify several bits of information about the row being updated or the
update will be rejected.

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Jul 10 2008 8:18 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Francisco,

<< No problem, here are the trigger: >>

I'm not able to reproduce this - would it be possible for you to send me the
database catalog and tables that you're using with this trigger ?  I must be
missing something.

Thanks,

--
Tim Young
Elevate Software
www.elevatesoft.com

« Previous PagePage 2 of 2
Jump to Page:  1 2
Image