views:

160

answers:

1

I am working on an Cocoa project using SQL databases, or CSV/Excel files as the input.

Right now, I have hard-coded the SQL schema for the SQLie files I am importing (For example, the program would know that the first column is a STRING, second column is a INT... etc.). I am wondering if there's any C or Objective-C library or method to automatically identify the field type?

+1  A: 

You can query the database what it's schema is in sqlite(3)

http://www.sqlite.org/pragma.html

Search for "Pragmas to query the database schema"

feihtthief