Stored Procedure Insert Problem

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
chelflores
Forum Newbie
Posts: 8
Joined: Tue Jun 24, 2008 7:00 pm

Stored Procedure Insert Problem

Post by chelflores »

My stored procedure doesnt insert new record, when i try the query only, it works

CREATE PROCEDURE insertguest(in_gname VARCHAR(30))
BEGIN
DECLARE gid INT;
SELECT MAX(GuestID) as id FROM guest;
SET gid = id;
SET gid = gid + 1;
INSERT INTO guest(GuestID,Gname) VALUES(gid,in_gname);

END
Post Reply