I have a stored procedure and function that accepts a varchar as a parameter and i have this code where i am using concat function in the parameters of such function and stored procedure.
DELIMITER //
CREATE PROCEDURE ja_logan_proc()
BEGIN
SELECT id, dest_msisdn, text_message INTO @the_id, @the_number, @the_message FROM incoming_sms where job_status = 0 AND text_message LIKE '%logan%' order by rand() limit 1;
if((select search_number_in_r4(CONCAT(''','@the_number','''))) = 'true')then
call register_lookup_r4(CONCAT(''','@the_id','''),CONCAT(''','@the_number','''));
elseif((select search_number_in_r4(CONCAT(''','@the_number','''))) = 'false')then
select 'nothing to do here';
end if;
END //
DELIMITER ;
This line is identified as the one with an error
call register_lookup_r4(CONCAT(''','@the_id','''),CONCAT(''','@the_number','''));
and this other line
if((select search_number_in_r4(CONCAT(''','@the_number','''))) = 'true')then
What am i doing wrong in the parameters field?.
if((select search_number_in_r4(CONCAT(''','@the_number','''))) = 'true')then
– user3286430 Oct 23 '14 at 10:35#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@the_number','''))) = 'true')then call register_lookup_r4(CONCAT(''','@the_id' at line 6
. – user3286430 Oct 23 '14 at 10:42