Nuther sqLite gotcha
Peter Haworth
pete at mollysrevenge.com
Wed Mar 23 18:44:11 EDT 2011
Another thought on this that might help. The sqlite_master table has a column that holds the table name so you should be able to find the entry you need with a SELECT on column type='table' and column tbl_name=<yourtablename>. No need to search the sql column that way.
Pete Haworth
On Mar 23, 2011, at 3:15 PM, Bob Sneidar wrote:
> Hi all.
>
> If anyone ever wants to get the SQL for creating an existing table in sqLite by querying the sqLite_master table for table entries, be aware that whoever created the table may or may not have enclosed the table name in quotes! So if you are doing a line offset to find let's say "CREATE TABLE devices" and the person who created the table used quotes you will not find that line! Apparently, sqLite records the exact sequel used to create the table, not the sanitized SQL that would be used to do it, like in mySQL. (but I could be wrong about mySQL being sanitized).
>
> You may say, "Why not just search for the table name and be done with it?" Because there may be a column definition in there with all or part of the column name being the table name you are looking for.
>
> I'm sure this is quite obscure, but it just bit me in the buttocks so I thought I'd put that out there.
>
> Bob
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list