my query execute and return a value and i need to use the return value in the same procedure, how to use it ?
my code is
set @table_name_count = CONCAT('SELECT COUNT(*) into @xcount ', CONCAT( ' FROM ' ) , concat( table_name),concat( ' where issueNumber=',concat('30030'),concat( ' and ISSNcode='),CONCAT('112640402')));
PREPARE statement from @table_name_count;
EXECUTE statement;
DEALLOCATE PREPARE statement;
select 'hello4' from dual;
IF xcount > 0 and xcount<>NULL THEN
DELETE from table_name where issueNumber='30030' and ISSNcode='112640402' ;
END IF ;
here i need to use the @xcount in the conditions
IF xcount > 0 and xcount<>NULL THEN
DELETE from table_name where issueNumber='30030' and ISSNcode='112640402' ;
END IF ;