Reputation: 1537
I did the following to exclude fields (whose type is 'longblob)' from a table.
It returns @column value alone rather than displaying value of the field.
Ex: if @column = "id, name"
, it returns "id, name"
alone. Rather than displaying values of id & name respectively.
Upvotes: 0
Views: 74
Reputation: 3196
Try this:
SELECT group_concat(COLUMN_NAME) into @column
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'document' AND DATA_TYPE NOT IN ('longblob');
set @stmt := concat('select ', @column , ' from document');
select @stmt;
PREPARE stmt FROM @stmt;
EXECUTE stmt ;
Upvotes: 1