chacham15
chacham15

Reputation: 14281

Find SQLite Column Names in Empty Table/View in an attached database

The same thing as Find SQLite Column Names in Empty Table with the exception that I have a view that is part of an attached database. Because the database is attached the PRAGMA table_info( your_table_name ); solution doesnt work. Furthermore, trying to parse the query string is also ridiculous because it is a view query.

Upvotes: 1

Views: 178

Answers (1)

Igor Tandetnik
Igor Tandetnik

Reputation: 52621

PRAGMA AttachedDbName.table_info(your_table_name)

Another technique: prepare a statement of the form select * from your_table_name;, then use sqlite3_column_count, sqlite3_column_name et al. You don't need to actually run the statement, just prepare it.

Upvotes: 3

Related Questions