11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 32 • STORED ROUTINESwww.it-ebooks.infoCALL process_users();END//DELIMITER ;Executing the maintenance() procedure produces the following:+-----------------+| Processing Logs |+-----------------+| Processing Logs |+-----------------+1 row in set (0.00 sec)+------------------+| Processing Users |+------------------+| Processing Users |+------------------+1 row in set (0.00 sec)Modifying a Stored RoutineAt present <strong>MySQL</strong> only offers the ability to modify stored routine characteristics, via the ALTERstatement. Its prototype follows:ALTER (PROCEDURE | FUNCTION) routine_name [characteristic ...]For example, suppose you want to change the SQL SECURITY characteristic of the calculate_bonusmethod from the default of DEFINER to INVOKER:ALTER PROCEDURE calculate_bonus SQL SECURITY invoker;Deleting a Stored RoutineTo delete a stored routine, execute the DROP statement. Its prototype follows:DROP (PROCEDURE | FUNCTION) [IF EXISTS] routine_nameFor example, to drop the calculate_bonus stored procedure, execute the following command:mysql>DROP PROCEDURE calculate_bonus;As of version 5.0.3, you’ll need the ALTER ROUTINE privilege to execute DROP.642

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!