MySQL Forums
Forum List  »  Microsoft SQL Server

Re: VIEW DEFINTION permission
Posted by: Devart Team
Date: September 23, 2010 01:18AM

Let us do it step by step.

1. Connect as 'root' (for example), create a stored procedure and a user:
DELIMITER $$

CREATE DEFINER = 'root'@'localhost'
PROCEDURE test.procedure1()
BEGIN
  SELECT 1;
END$$

DELIMITER;

CREATE USER 'user1'@'%';
GRANT Select ON *.* TO 'user1'@'%';[/code]

2. Connect as 'user1':

Execute SHOW CREATE PROCEDURE command -
SHOW CREATE PROCEDURE test.procedure1;

Field `Create Procedure` contains definition text -
CREATE DEFINER=`root`@`localhost` PROCEDURE `procedure1`()
BEGIN
  SELECT 1;
END

Or refer to information schema -
SELECT ROUTINE_DEFINITION FROM information_schema.routines WHERE ROUTINE_SCHEMA = 'test' AND ROUTINE_NAME = 'procedure1';

Field `ROUTINE_DEFINITION` contains body -
BEGIN
  SELECT 1;
END

Devart Company,
MySQL management tools
http://www.devart.com/dbforge/mysql/

Options: ReplyQuote


Subject
Written By
Posted
September 20, 2010 12:16PM
September 22, 2010 02:04AM
September 22, 2010 08:31AM
Re: VIEW DEFINTION permission
September 23, 2010 01:18AM
September 23, 2010 08:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.