It is necessary to write a procedure that makes a request, which, in turn, should output all the objects of a particular column. Here is what I tried:
CREATE PROCEDURE AttributeRequest(n CHAR(200))
begin
SELECT n FROM table;
end
But this variable is perceived as the name of the column itself and nothing comes out. Tell me how to make such a request by the attribute of the object, please
I searched a bit, read the answers below, and I managed to implement this task in the following way:
CREATE PROCEDURE AttributeRequest(n CHAR(200))
begin
SET @t =CONCAT("SELECT ",n ," FROM table");
PREPARE e FROM @t;
EXECUTE e;
end