Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- drop procedure if exists genererMouvement;
- delimiter //
- create procedure genererMouvement(_idCmd int(5))
- begin
- declare fin int default 0;
- declare _idLigne int ;
- declare _qtc int;
- declare cursorMouv cursor for
- select idLigne, qtc from lignesCmd where idCmd=_idCmd;
- declare continue handler
- for not found set fin = 1;
- open cursorMouv;
- Fetch cursorMouv into _idLigne, _qtc ;
- while fin != 1
- do
- insert into mouv values (
- null,
- _idLigne,
- curdate(),
- 's',
- _qtc
- );
- Fetch cursorMouv into _idLigne, _qtc ;
- end while;
- close cursorMouv;
- end //
- delimiter ;
- insert into articles values (
- null,
- _idTVA,
- _codeArt,
- _libelle,
- _qteStock,
- _pubv,
- _pua,
- _dureeAppro,
- _qteAlerteStock
- );
- end if ;
- end //
- delimiter ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement