I tried do query since one procedure in mysql
I followed the following:
DELIMITER #
CREATE PROCEDURE returndata(IN xtable CHAR(255), IN xcolumn CHAR(255))
BEGIN
IF (xcolumn = 'XALL') THEN
SELECT * FROM xtable;
ELSE
SELECT xcolumn FROM xtable;
END IF;
END;
#
DELIMITER ;
but gives error. any help is acceptable, or I might say if this is possible?
EDIT error to call the procedure:
MariaDB [pruebab]> CALL returndata('test', 'id');
ERROR 1146 (42S02): Table 'pruebab.xtable' doesn't exist