create PROCEDURE getColumns(tableName VARCHAR,dbName VARCHAR)
BEGIN
declare cur CURSOR for select COLUMN_NAME from information_schema.COLUMNS where table_name = tableName and table_schema = dbName;
for name in cur LOOP
concat(name,",");
end loop;
set name=left(name,LENGTH(name)-1);
END
这是我写的获取每个表的所有的字段,我这哪里有错误。。。学这个存储过程,头有点大呀