| | |
Stored Procedures Help please
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2009
Posts: 4
Reputation:
Solved Threads: 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:
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
Here is the oracle procedure:
sql Syntax (Toggle Plain Text)
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
Last edited by peter_budo; Nov 1st, 2009 at 4:39 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
0
#2 Nov 1st, 2009
Hey.
You can see how MySQL procedures look like in the manual.
In your case it would look something like this:
Note, the DELIMITER commands and the trailing // on END are only required if you are running this through the MySQL CLI, or other such interfaces.
You can see how MySQL procedures look like in the manual.
In your case it would look something like this:
sql Syntax (Toggle Plain Text)
DROP PROCEDURE IF EXISTS `delgroup`; DELIMITER // CREATE PROCEDURE `delgroup`(g_id INT) BEGIN DELETE FROM grouptable WHERE GROUP_ID=g_id; END// DELIMITER ;
Last edited by Atli; Nov 1st, 2009 at 1:01 pm.
Please do not ask for help in a PM. Use the forums.
And use [code] tags!
And use [code] tags!
![]() |
Other Threads in the MySQL Forum
- Previous Thread: MySQL Query - Searching for multiple keywords
- Next Thread: SET datatype
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns cmg communityjournalism contentmanagement contractors copyright count court data database design developer development distinct drupal dui ec2 email enter enterprise eudora facebook form foss gartner gnu government gpl greenit groklaw hiring hyperic images innerjoins insert ip joebrockmeier join journalism keyword keywords kickfire law legal license licensing maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle penelope php priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency virtualization





