I have a store procedure in mysql as follows:
CREATE PROCEDURE nome_procedure(campo VARCHAR(15))
BEGIN
SELECT id as id, campo as value
FROM tabela
etc etc etc...;
END $$
However, since the parameter I am passing is of type VARCHAR, it returns me the name of the field that I pass in the result. That is, it's like I've done the select like so:
SELECT id as id, 'nome_campo' as value
But what I wanted was:
SELECT id as id, nome_campo_que_eu_passei as value
How to make this return be correct?