I am trying to figure out a method of checking if a view/query exists in my DB using UniScript. But I haven't been able to figure out a way that works on MSSQL, MySQL, SQLite and Access.
Isn't this possible and could someone maybe give a hint as to what to look for.
Check if view/query exists
Re: Check if view/query exists
Hello,
The easiest way to check whether an object exists is using the TUniMetaData component: http://www.devart.com/unidac/docs/devar ... embers.htm . This will allow avoid writing separate queries for each database.
The easiest way to check whether an object exists is using the TUniMetaData component: http://www.devart.com/unidac/docs/devar ... embers.htm . This will allow avoid writing separate queries for each database.
Code: Select all
UniMetaData1.MetaDataKind := 'Tables';
UniMetaData1.Restrictions.Add('TABLE_NAME=T_TABLE');
ShowMessage(IntToStr(UniMetaData1.RecordCount));