> On 6 May 2015, at 16:00, Mike Kerner <mikeker...@roadrunner.com> wrote:
> 
> Neither the PRAGMA nor the SELECT name FROM sqlite_master WHERE
> type='table' AND name='table_name' rely on that function.

I have used your suggestion to modify my original function to:

function doesTableExist tTableName
   put replaceText(tTableName,"'","''") into tTableName
   put merge("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 
'[[tTableName]]'") into tSQL
   put revDataFromQuery(tab, return, the uDB of stack "THFinancials", tSQL) 
into tData
   if tData = tTableName then
      return true
   else
      return false
   end if
end doesTableExist

Yours actually returns the table name if it exists whereas my suggestion 
returned the count of either 0 or 1.

I have adopted your suggestion because it actually returns the table name 
originally passed in.

All the best

Terry
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to