Connecting Tech Pros Worldwide Help | Site Map

editing existing procedured in mysql

Newbie
 
Join Date: Apr 2009
Posts: 24
#1: May 14 '09
i am using mysql 5.1. i have written a procedure name proc. now i want to edit some codes in it. whats the way out?
i tried writing "create or replace procedure proc", but it shows error .
i tried "drop procedure if exists" but this also shows error.
please tell me what to do.
mwasif's Avatar
Moderator
 
Join Date: Jul 2006
Location: Pakistan
Posts: 718
#2: May 14 '09

re: editing existing procedured in mysql


I never done this on command line (CLI). But you can do this easily with the help of GUI e.g. MySQL Query Browser. Otherwise drop the stored procedure and create again.
Newbie
 
Join Date: Apr 2009
Posts: 24
#3: May 14 '09

re: editing existing procedured in mysql


yes i am using mysql querybrowser. i will tell you what i've got.
if i right click on the procedure name showing under "schemata" in the right window pane , it shows an option as "edit procedure". when i click on that, the procedure opens in a new resulteset tab. i can edit the procedure there. but i cant find how to save the changes made. please help.
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,740
#4: May 15 '09

re: editing existing procedured in mysql


Hi.

This may not help you, seeing as you are using the GUI tool, but when I need to update my procedures via the CLI, I do something like this:
Expand|Select|Wrap|Line Numbers
  1. DELIMITER //
  2.  
  3. DROP PROCEDURE IF EXISTS `ProcedureName`//
  4. CREATE PROCEDURE `ProcedureName`()
  5. BEGIN
  6.     -- Insert new code here
  7. END//
  8.  
  9. DELIMITER ;
  10.  
Newbie
 
Join Date: Apr 2009
Posts: 24
#5: May 16 '09

re: editing existing procedured in mysql


thanx a lot for your concern...it finally worked the way i wanted it to. :)..
Reply