I found a couple of forum posts/arguments on this topic, but no solutions from what I can see. I have tried a number of variations to the following, with no luck. It compiles without issue, but shoots MySQL version errors with every attempt:
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = ‘table_name’ AND COLUMN_NAME = ‘FIELDNAME’) BEGIN select fieldname from table_name
END
Has anyone ever had any luck making something like this work? (not looking to retain compatibility with MivaSQL)
Thanks,
Dan
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = ‘table_name’ AND COLUMN_NAME = ‘FIELDNAME’) BEGIN select fieldname from table_name
END
Has anyone ever had any luck making something like this work? (not looking to retain compatibility with MivaSQL)
Thanks,
Dan
Comment