Frage

I have wrote a stored procedure in heidisql(Mysql),its running fine and getting desired output there.

I tried to run the same code in phpmyadmin and getting error #1604 .

insert into tmp_table_rule2 (reward_id) select (reward_id) from vbw_redemptions order  by redemption_id desc limit rule2_redemption_count;


select count(id) into set_row_count_rule2_temp_table  from tmp_table_rule2;

Is the portion where am getting error.

Heidisql version - 5.6.14
phpmyadmin version -5.1.54-1ubuntu4 .
War es hilfreich?

Lösung

Check the LIMIT clause using; it is not possible to use identifiers or variables in LIMIT clause on old MySQL versions, see your SELECT statement which used to insert records.

From the documentation (MySQL 5.1) - The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement. LIMIT takes one or two numeric arguments, which must both be nonnegative integer constants (except when using prepared statements).

Also: it is strange that the same script works/doesn't works on the same server.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top