Page 1 of 1

[MySql Query Browser]STORED PROCEDURE

Posted: Mon 22 May 2006 15:19
by kelinda72
I need to call the stored procedure below, (made in MYSQL QUERY BROWSER) How you can see it delete all record int the table progetti, and I want add the code in this procedure that after delete records, initialize the autoinc field CODICE from 1. How can i do that?
thanks a lot.

DELIMITER $$
DROP PROCEDURE IF EXISTS `sajob`.`DELPROGETTI` $$
CREATE PROCEDURE `DELPROGETTI`()
BEGIN
DELETE FROM progetti;
//inizialise field codice (1)
END $$

DELIMITER ;

Posted: Mon 22 May 2006 15:44
by Duke
To reset autoinc field you need to alter table properties. For more information, please, refer to MySQL documentation.
This forum is dedicated to Core Lab MySQL Developer product.