Skip to content
Advertisement

Mysql procedure does not execute as expected

Using mysql 5.7, when I execute this procedure:

I get

mysql> call tres();
Query OK, 0 rows affected (3.49 sec)

However when I execute the INSERT for a certain values inside the loop range:

I see that the results are inserted without problem.

The table schemas:

And

So what could be wrong here and how can I fix it?

Advertisement

Answer

You need to check the value of x in the procedure, It might be not matched with your topic_id of the forum_post table.

If topic_id not matched then no data will copy to the forum_topicresponder table.

You need to set the proper value of x, (from min to max) depends on topic_id of forum_post table

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement