Reply
Stored Procedures Help please- simple question
Old 11-01-2009, 02:21 AM Stored Procedures Help please- simple question
Novice Talker

Posts: 6
Name: AJ
Trades: 0
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
badmanmc is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 11-01-2009, 05:15 AM Re: Stored Procedures Help please- simple question
chrishirst's Avatar
Super Moderator

Posts: 22,214
Location: Blackpool. UK
Trades: 0
what version of the MySql server? and what storage engine?

SPs are only available from Ver5.0 and transactions (begin ... commit) are only functional if the engine is InnoDb (or DBD).
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-01-2009, 05:29 AM Re: Stored Procedures Help please- simple question
Novice Talker

Posts: 6
Name: AJ
Trades: 0
thanks for the reply comic book guy lol


umm i have mysql version 5.1.39 and whatever the default storage engine is. I have not touched any engine settings. I have vaguely heard of innoDb.

Basically the procedures will be used on the backend of a web application.

So do i just need to change the storage engine on the database and thats it? or does something need to be tweaked on the front end too?


1. how to change storage engine?

2. what is the correct mysql syntax for the procedure i have stated?


thanks a lot for your help!
badmanmc is offline
Reply With Quote
View Public Profile
 
Old 11-01-2009, 05:35 AM Re: Stored Procedures Help please- simple question
chrishirst's Avatar
Super Moderator

Posts: 22,214
Location: Blackpool. UK
Trades: 0
SPs are pretty much the same if you use ANSI SQL
http://dev.mysql.com/doc/refman/5.0/...es-syntax.html

How to change engines may depend on what tools you have to manage the server/database(s)
http://dev.mysql.com/tech-resources/...ne/part_1.html
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-01-2009, 05:43 AM Re: Stored Procedures Help please- simple question
Novice Talker

Posts: 6
Name: AJ
Trades: 0
ok thanks i will try it out. Its still not working for me..im gettin a syntax error but il try troubleshooting and see what i can do. thanks for the reply
badmanmc is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Stored Procedures Help please- simple question
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.11346 seconds with 13 queries