Hi All,
I have an update trigger written on a table. The stored procedure for the trigger is as follows:
PROCEDURE updTicketTrigger
DIMENSION tcount(1) as Integer
select count(*) from <tablename> where <condition> into ARRAY tcount noconsole
IF (tcount[1]) = 1
tcount[1] = 0
FOR i = 1 TO 500
DO WHILE .t.
&&setting value1 and value2 for field1,field2
ENDDO
INSERT INTO tablename(field1, field2) values(value1, value2)
ENDFOR
ENDIF
RETURN .t.
ENDPROC
On execution of the trigger, the following error message is displayed on the very first insert itself!
Illegal recursion in rule evaluation.
Can't we use loops in triggers?
Any help is greatly appreciated.
Regards.