Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Nesting error in trigger
Message
De
12/06/2005 20:29:48
Eugene Kolmakov
Millennium Technologies
Vladivostok, Russie
 
 
À
10/06/2005 02:14:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01022038
Message ID:
01022651
Vues:
14
Hi Gregory!

I use such structure for my own reasons. I have a table which stores information about two types of agreements: main agreements and additional agreements belonging to them. They have similar structure so I keep them in one table with the mark indicating if it is a main agreement or additional agreement.
And I use subclass of a Grid object designed to show information in a tree-form. So I need child records to have some information about parents in order to biuld proper indexes for tree-grid sorting.

The last version of trigger code I tried to use was following:

FUNCTION Update_Index_Tags

IF DogType = 1

lcCurrentAlias = ALLTRIM(ALIAS())
lcParentID = ALLTRIM(Key)
lcAgrNum = ALLTRIM(Agreement_Number)
ldAgrDate = Agreement_Date
lcOwnerName = ALLTRIM(Owner_Name)
lcPayerName = ALLTRIM(Payer_Name)
lcShipName = ALLTRIM(Ship_Name)
lcAliasName = SYS(2015)

USE Agreements AGAIN IN 0 ALIAS (lcAliasName)

SELECT (lcAliasName)
Replace Parent_ANum WITH lcAgrNum, Parent_ADate WITH ldAgrDate,;
Parent_Owner WITH lcOwnerName, Parent_Payer WITH lcPayerName,;
Parent_Ship WITH lcShipName FOR ALLTRIM(Parent) == lcParentID
IN lcAliasName)

USE IN (lcAliasName)

IF !EMPTY(lcCurrentAlias)
SELECT (lcCurrentAlias)
ENDIF

ENDIF

RETURN .t.

ENDFUNC

And it raises error. According to VFP help:

"A rule or trigger code caused the original cursor, the cursor from which the rule or trigger was fired, to try to evaluate a rule or trigger recursively. This can occur under the following conditions:

Attempting to move the record pointer or change values in the original cursor.


Attempting to move the record pointer in the BeforeUpdate event for a CursorAdapter object.


Check your rule or trigger code"

What can I do with this?
Eugene
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform