If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Stored Procedures Help please

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-01-09, 01:18
badmanmc badmanmc is offline
Registered User
 
Join Date: Oct 2009
Posts: 5
Stored Procedures Help please

I have made stored procedures in Oracle...but need to export them to mysql. I have searched on google but cant figure out the syntax.

Here is the oracle procedure:


create or replace procedure delgroup
(g_id in number)

is

begin

DELETE FROM grouptable WHERE GROUP_ID=g_id;

commit;
end;


I jus basically want to delete the group from the group table..depending on which group id (the arguement) the user types in.

How would i do this exact same procedure in mysql?

Please some assistance guys
Reply With Quote
  #2 (permalink)  
Old 11-01-09, 01:42
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,609
What version of MySQL are you targeting? The support for stored procedures varies considerably depending on the MySQL version.

Recent MySQL versions have pretty good support for stored procedures. Go back even a couple of years and the stored procedure support gets sketchy.

-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
  #3 (permalink)  
Old 11-01-09, 01:47
badmanmc badmanmc is offline
Registered User
 
Join Date: Oct 2009
Posts: 5
thanks for the reply

im using the latest version..... 5.1.39

so any ideas on how i would convert that oracle procedure to mysql syntax?
Reply With Quote
  #4 (permalink)  
Old 11-01-09, 07:31
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,609
MySQL 5.4 is the current version. You should probably start with the MySQL documentation for CREATE PROCEDURE. The documentation will let you know what your options are, which may affect some of the choices that you make in coding the procedure.

-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On