| | |
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 |
Tag cloud for MySQL
1 agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm data database design developer development distinct drupal ec2 email enter enterprise error eudora facebook form foss gartner gnu gpl greenit groklaw groupware hiring hyperic images innerjoins insert ip joebrockmeier join journalism keywords kickfire laptop law legal linux maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opensource operand oracle pdf php priceupdating query referencedesign reorderingcolumns resultset saas search sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport transparency update





