Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Updating views error
Fri, May 15 2009 4:52 AMPermanent Link

Tiago Ameller
MAEXPEDI is a table. VWEXPEDIACTUAL is  a view defined as:

SELECT * FROM MAEXPEDI WHERE HISTORICO = FALSE
ORDER BY HISTORICO, ANO, CODIGO

Running this statement works always fine:

UPDATE MAEXPEDI
SET CONTABILIZADO = TRUE
WHERE FECHAFACTURA BETWEEN DATE '2009-04-01' AND DATE '2009-04-30'
AND CONTABILIZADO = FALSE

But this:

UPDATE VWEXPEDIACTUAL
SET CONTABILIZADO = TRUE
WHERE FECHAFACTURA BETWEEN DATE '2009-04-01' AND DATE '2009-04-30'
AND CONTABILIZADO = FALSE

fails when all or some records follow "CONTABILIZADO = FALSE". The error is:
ElevateDB Error #1009 The cursor is constrained and this row violates the current cursor constraint condition(s)

I think is not the expected behaviour?
Fri, May 15 2009 12:46 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Tiago,

<< fails when all or some records follow "CONTABILIZADO = FALSE". The error
is:
ElevateDB Error #1009 The cursor is constrained and this row violates the
current cursor constraint condition(s) >>

What does the view definition look like ?  If you defined the view as
constrained (WITH CHECK OPTION), then this error is normal if any of the
updates causes the row to no longer satisfy the WHERE clause of the view.
Do you have any update triggers defined on the base table referenced by the
view ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, May 15 2009 1:29 PMPermanent Link

Tiago Ameller
Tim,

<What does the view definition look like ?  If you defined the view as
constrained (WITH CHECK OPTION), then this error is normal if any of the
updates causes the row to no longer satisfy the WHERE clause of the view. >

Ok, but the view WHERE has nothing about the UPDATE does. Here is the weird thing.

<Do you have any update triggers defined on the base table referenced by the
view ?>

Yes. BeforeUpdate looks like this:

BEGIN
 SET NEWROW.Cliente = NULLIF(TRIM(BOTH ' ' FROM UPPER(NEWROW.Cliente)),'');
 SET NEWROW.NombreCliente = NULLIF(TRIM(BOTH ' ' FROM NEWROW.NombreCliente),'');
 SET NEWROW.FacturarA = NULLIF(TRIM(BOTH ' ' FROM UPPER(NEWROW.FacturarA)),'');
 SET NEWROW.AvisosyCobros = NULLIF(TRIM(BOTH ' ' FROM UPPER(NEWROW.AvisosyCobros)),'');
 SET NEWROW.Asunto = NULLIF(TRIM(BOTH ' ' FROM NEWROW.Asunto),'');
END

--
Tim Young
Elevate Software
www.elevatesoft.com
Sat, May 16 2009 2:02 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Tiago,

<< Ok, but the view WHERE has nothing about the UPDATE does. Here is the
weird thing. >>

Yes, I know, which is why I asked about the triggers.  Could you send me the
relevant database catalog and table(s) ?

I'll run it here and see if I can figure out what the issue is.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image