I can't decide if this is a stupid question or not, but I will take a chance. :)
I am a fairly simple SQL user - I understand the CREATE / DROP and SELECT, INSERT, DELETE tables in their main forms, but not much more. I would like to know if there is a way with SQL to query the table schema?
I have a PC application that uses SQLite, and I am writing a mobile client for it. I do not need all the tables from the PC database, and not all the columns from the tables. In SQLite Spy, I can right-click on the table and select "Show CREATE statement", which generates the SQL needed to recreate the table.
What I would like to do (using the code on a PC) is to get the CREATE statement (or at least the schema) of the SQLite tables that I need, and then edit the rows to include only those columns that I need. They can then be transferred to my mobile application so that it can create a subset database on the device. Is it possible?
EDIT: For those who come for me, looking for a similar answer. Thanks dan04, pointing me in the right direction. Results of use ...
SELECT * FROM sqlite_master
... include a column named 'sql' that includes the CREATE statement. Just what I'm looking for. :)
sql sqlite
Squonk
source share