Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert trigger fails.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00662034
Message ID:
00662051
Vues:
25
This will not work. I need to call from ADO and have the trigger execute to create a new id.

E.g.

rs.AddNew
rs.fields("name")="some name"
rs.Update

Should automatically create a unique ID.


>See http://www.craigberntson.com/Articles/kb006.htm
>
>
>
>>I am trying to increment the id column of Table1 every time an INSERT occurs. I have put this code in the stored procedures, and call it from the INSERT trigger.
>>
>>I get the message "cursor cannot be updated". Does anyone know how to do this right? Maybe someone has a link to code that does this sort of thing.
>>
>>FUNCTION AutoIncrement()
>>LOCAL xx[1]
>>SELECT MAX(id) FROM table1 INTO ARRAY xx
>>replace id WITH xx[1]+1
>>RETURN .t.
>>
>>Regards,
>>
>>Costas
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform