Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



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
 
 
Register now for full access!
Old 11-01-2009, 05:15 AM Re: Stored Procedures Help please- simple question
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
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!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
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
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
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!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
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.15265 seconds with 12 queries