Re: [sqlite] Ideal way to check whether a table has a specific column

2009-11-03 Thread David Bicking
ime then to grab the results of the pragma and test the strings therein. David --- On Tue, 11/3/09, Shaun Seckman (Firaxis) wrote: > From: Shaun Seckman (Firaxis) > Subject: [sqlite] Ideal way to check whether a table has a specific column > To: "General Discussion of SQLite Data

[sqlite] Ideal way to check whether a table has a specific column

2009-11-03 Thread Shaun Seckman (Firaxis)
Hello all, I just wanted to find out whether or not this is the most ideal method for determining if a column exists in a table. My current technique is to do execute "pragma table_info(tableName)" then step through the results and perform a string comparison against the "name" co

Re: [sqlite] Ideal way to check whether a table has a specific column

2009-11-03 Thread Adam DeVita
Another way SELECT name, sql FROM sqlite_master WHERE type='table' and name ='yourtable name' the field sql will give you the full table structure as a string. Parse for your desired table name. No statements fail. On Tue, Nov 3, 2009 at 4:37 PM, Igor Tandetnik wrote: > Shaun Seckman (Fir

Re: [sqlite] Ideal way to check whether a table has a specific column

2009-11-03 Thread Igor Tandetnik
Shaun Seckman (Firaxis) wrote: >I just wanted to find out whether or not this is the > most ideal method for determining if a column exists in a table. My > current technique is to do execute "pragma table_info(tableName)" then > step through the results and perform a string comp