Results 1 to 2 of 2

Thread: Stored Procedures Help please

  1. #1
    Join Date
    Oct 2009
    Posts
    2

    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

  2. #2
    Join Date
    Nov 2009
    Posts
    3

    Thumbs up hi

    you can do like this


    DELIMITER $$

    DROP PROCEDURE IF EXISTS `yourschemaname`.`delgroup` $$
    CREATE PROCEDURE `yourschemaname`.`delgroup` (g_id in number)
    BEGIN
    DELETE FROM grouptable WHERE GROUP_ID=g_id;

    commit;

    END $$

    DELIMITER ;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •