Re: execute multiple queries with mysql c++ connector

From: Luuk <luuk_at_invalid.lan>
Date: Sat, 25 Feb 2017 13:35:59 +0100
Message-ID: <58b179f8$0$755$e4fe514c_at_news.xs4all.nl>


On 25-02-17 06:14, kushal bhattacharya wrote:
> error message is error near the part where ';' is provided and its saying to refer to the manual of mysql but when i run it on phpmyadmin it runs propewrly without showing any arror
>

Do not describe what is going wrong, but copy/paste the error.

This is because it will be hard, bases on your description, to find out which one of the errors described in the docs is talked about. ( https://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html )

like this:
ERROR 1062 (23000): Duplicate entry '5' for key 'PRIMARY'

or this:
ERROR 1366 (22007): Incorrect integer value: 'A' for column 'i' at row 1

Try to create a simple example with te same result, when you can not, or will not provide the real SQL statement.

The code that gives above errors is:
[root_at_test]> DESC test;

+-------+---------+------+-----+---------+----------------+
| Field | Type    | Null | Key | Default | Extra          |
+-------+---------+------+-----+---------+----------------+
| i     | int(11) | NO   | PRI | NULL    | auto_increment |
+-------+---------+------+-----+---------+----------------+
1 row in set (0.00 sec)

[root_at_test]> insert into test(i) values('5');select last_insert_id() as id ; ERROR 1062 (23000): Duplicate entry '5' for key 'PRIMARY' +----+
| id |
+----+
| 0 |
+----+
1 row in set (0.00 sec) Received on Sat Feb 25 2017 - 13:35:59 CET

Original text of this message