Skip navigation links

MySQL Forums :: Stored Procedures :: ERROR 1136 - driving me nuts


Advanced Search

ERROR 1136 - driving me nuts
Posted by: Mircea Stoinescu ()
Date: November 03, 2005 01:48PM

Hello

I've been trying to debug this stored procedure the whole evening, and I have no more ideas. Please help me, I am sure it's something I am overseeing. The error I am receiving is:

ERROR 1136 (21S01): Column count doesn't match value count at row 1

Here is my code. Where is the problem??? Thank you a lot.

CREATE PROCEDURE test ()
BEGIN
DECLARE i INT;
SET i = 0;
SELECT COUNT(DISTINCT network.MAC) AS total_mac FROM network;
SELECT MAC, AVG(RX) as avg_rx, AVG(TX) as avg_tx, AVG(SNR) as avg_snr, AVG(RTT) as avg_rtt from network WHERE ((TX > 1) AND (RX > 1) AND (SNR BETWEEN 5 AND 50)) GROUP BY MAC;
REPEAT
INSERT INTO network_hour (MAC, rx, tx, snr, rtt) values(MAC, avg_rx, avg_tx, avg_snr, avg_rtt);
SET i = i+1;
UNTIL i >= total_mac
END REPEAT;
END;



Edited 1 time(s). Last edit at 11/03/2005 01:48PM by Mircea Stoinescu.

Options: ReplyQuote


Subject Views Written By Posted
ERROR 1136 - driving me nuts 8485 Mircea Stoinescu 11/03/2005 01:48PM
Re: ERROR 1136 - driving me nuts 5028 Per-Erik Martin 11/04/2005 03:22AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.