开发者

MySQL Simple query gives "Query was empty". Transaction help needed I think

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 (Na开发者_如何转开发me) 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!


DECLARE is supported only in stored routines

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜