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?
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"
精彩评论