I'm struggling with a MySQL 1241 "Operand should contain 1 column(s)" error.
This is a test stored procedure. I cannot figure out where's the problem. I'm learning MySQL, thanks!
DECLARE c_Property_URL varchar(250) DEFAULT "";
DECLARE finished int DEFAULT 0;
-- declare cursor for property URL
DECLARE curPropertyURL CURSOR FOR SELECT URL FROM `dbmaster`.`KIC_TB_Property`;
-- declare NOT FOUND handler
DECLARE CONTINUE HANDLER
FOR NOT FOUND SET finished = 1;
OPEN curPropertyURL;
getPropertyURL: LOOP
FETCH curPropertyURL INTO c_Property_URL;
SELECT ('property URL is: ',c_Property_URL);
IF finished = 1 THEN
LEAVE getPropertyURL;
END IF;
END LOOP getPropertyURL;
CLOSE curPropertyURL;
You seem to be using tuple syntax in your select-list:
I assume you intended this to be string concatenation, but this is not MySQL's syntax for string concatenation. If you want that, use:
Tuple syntax is allowed in some SQL expressions, but not for scalar expressions in the select-list.