Nuther sqLite gotcha
bobs at twft.com
Wed Mar 23 19:01:09 EDT 2011
Well the issue comes into play because I am not the creator of the sqLite database, a company called Spiceworks is. I am reading their schema in order to import columns and even whole tables into my database.
On Mar 23, 2011, at 3:44 PM, Peter Haworth wrote:
> 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.
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode