MySQL Simple query gives "Query was empty". Transaction help needed I think.
Posted
by user129609
on Stack Overflow
See other posts from Stack Overflow
or by user129609
Published on 2010-05-21T03:08:45Z
Indexed on
2010/05/21
3:10 UTC
Read the original article
Hit count: 235
Hi,
I'm trying to do a simple transaction in MySQL
delimiter go
start transaction;
BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND ROLLBACK;
INSERT INTO jext_categories (Name) VALUES ('asdfas');
INSERT INTO jext_categories (Name) VALUES ('asdfas2');
END;
commit;
SELECT * FROM jext_categories;
go
delimiter ;
but I keep getting an error saying query was empty. Could someone please tell me what I am doing wrong, and also, what is the proper format for doing a transaction in MySQL?
Thanks!
© Stack Overflow or respective owner