postgres table query not getting all names
Mark Wieder
ahsoftware at sonic.net
Fri Jul 14 19:13:51 EDT 2017
On 07/14/2017 03:48 PM, Dr. Hawkins via use-livecode wrote:
> Sometime ago, I wrote my own getTableNames() because
> revDatabaseTableNames() would consistently fail to find them all.
>
> Now, it to is filing.
>
> It is, in essence,
>
> *put* "SELECT table_name FROM information_schema.tables ;" \
>
> & cr into dcmd
>
> *put* revDataFromQuery(,cr,db,dcmd) into tabList
>
> *return* tabList
>
> I have another chunk of code which is now acting up:
>
> *put* getTableNames(dhbkSrvrDb) into dhSrvTbls
>
> *put* "dhStatTbl" into dhtbl_stat
>
> *if* dhtbl_stat is not among the words of dhSrvTbls *then*
>
> *put* "CREATE TABLE " & dhtbl_stat . . . blah blah blah
>
>
> table dhStatTbl already exists, yet the conditional is reached. It
> executes, and throws an error because this table is already there.
>
>
> This is, to be mild, a brutal bug.
>
> Might there be something I'm missing?
>
Just a guess, but the concept of 'word' is pretty slippery.
You might try 'true words' or make a comma-separated list and look among
the items or...
--
Mark Wieder
ahsoftware at gmail.com
More information about the use-livecode
mailing list