Bonjour,
Je dois recuperer a partir d'une table FACTURERCLI, la quantite (qtefactcli) d'un produit et mettre a jour la table produit (idprod, qtestock)
j'ai essaye plusieurs choses mais c'est un peu la choucroute :
Code :
- create trigger tgfactcli
- AFTER INSERT
- on FACTURERCLI FOR EACH ROW
- (
- IF new:qtefactcli < (select qtestock from produit pd where pd.idprod = new:idprod;)
- then update produit set qtestock=qtestock-new:qtefactcli from produit pd where pd.idprod=new:idprod;
- end if;
- );
|
Je n'arrive pas à savoir si postgres comprend new:blabal ?
si ce n est pas possible il faut alors que je passe par une procedure et ce que je veux faire sans les new: est ...
si vous pouviez prendre le temps de m'aider
merci d avance
Message édité par GUG le 05-12-2003 à 10:52:18