Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to debug triggers
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
How to debug triggers
Miscellaneous
Thread ID:
00190666
Message ID:
00190666
Views:
36
I am messing around with some small tables, and I wanted a simple way to assign keys. I wanted to calculate the current max key, incriment it and assign it to the new record. If I pass the name of the field as a parameter, I shold be able to use the following stored procedure as my insert trigger:
procedure SPKEY( pcFld )
local laMax(1), lcTbl
lcTbl=dbf()
select max( &pcFld ) from (lcTbl) into array laMax
replace (pcFld) with laMax(1)+1
return .t.
when I try and add a record, I get "Opperator/operand type mismatch" , then "procedure canceled" , "Trigger failed" .

gaerrors (thank you Doug H.) does not have anyting in it, and if I run it from the command window, it works fine.

Can someone guide me as to how to debug shuch a thing? even if there is a better way to assign keys, which I would ofcourse allso be interested in.

Carl

ps thank you all who helped me figure out that outter join is not the same as full join.
Next
Reply
Map
View

Click here to load this message in the networking platform