Wednesday 15 April 2015

MySQL execute function inside query -



MySQL execute function inside query -

i wrote mysql query this

select concat(b.functionname,'(',id,')') output ( select id test _table ) bring together my_all_functions_table b on a.fid = b.id;

what wanted execute function after fetching name table. function name stored in my_all_functions_table , fetched function name , tried execute function within query. instead of executing function, query returned function phone call string. i.e. if function name func returned select 'func('id')' string expected function execute. can tell missing here.

please seek this:

set @_query_text = concat('select ', (select concat(b.functionname,'(',id,')') output ( select id test _table ) bring together my_all_functions_table b on a.fid = b.id)); prepare qry @_query_text; execute qry;

i hope helps.

mysql

No comments:

Post a Comment