Thread: How to import .txt file into sqlite3 database using C API?

  1. #1
    Registered User
    Join Date
    Apr 2013
    Posts
    5

    How to import .txt file into sqlite3 database using C API?

    any tutorial to learn?thx...

  2. #2
    Registered User
    Join Date
    Apr 2013
    Posts
    5

    How to use function call in C language access in sqlite3 database?

    let say in my C language I have

    pcap_loop(handle,1,ProcessPack, NULL);

    in my main program.In this function can get data that I need...
    how to link ProcessPack function so that to read data and store into sqlite database?
    Last edited by Newbie89; 05-06-2013 at 05:58 AM.

  3. #3
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    use your internet browser to find a tutorial, and dont write baby language words
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Have you read the SQLite 3 documentation for the C API?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    Apr 2013
    Posts
    5
    Quote Originally Posted by laserlight View Post
    Have you read the SQLite 3 documentation for the C API?
    Is it this?



    int sqlite3_exec( sqlite3*, /* An open database */ const char *sql, /* SQL to be evaluated */ int (*callback)(void*,int,char**,char**), /* Callback function */ void *, /* 1st argument to callback */ char **errmsg /* Error msg written here */);

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    There is more to it than that. I suggest that you buy or borrow Chris Newman's book entitled SQLite. Although some of the examples in the book is dated due to better "v2" interfaces being available, the book is otherwise excellent (besides the index, which is not the author's fault).
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #7
    Registered User
    Join Date
    Apr 2013
    Posts
    5
    Quote Originally Posted by rogster001 View Post
    use your internet browser to find a tutorial, and dont write baby language words
    beware your words,you dunno just quit.

  8. #8
    Registered User
    Join Date
    Apr 2013
    Posts
    5
    Quote Originally Posted by laserlight View Post
    There is more to it than that. I suggest that you buy or borrow Chris Newman's book entitled SQLite. Although some of the examples in the book is dated due to better "v2" interfaces being available, the book is otherwise excellent (besides the index, which is not the author's fault).
    thanks for your information.Finally I found the way to work with it

  9. #9
    Registered User
    Join Date
    Jun 2013
    Posts
    1

    how to import .txt or .sql into sqlite3 database

    Hi Newbie89 can u please share the API as i am looking for similar thing...i hav found that it can be done by .read and .import in command line

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to import DLL function from a separate C file
    By high123_98 in forum C++ Programming
    Replies: 7
    Last Post: 11-12-2011, 11:57 AM
  2. Replies: 8
    Last Post: 05-20-2011, 04:22 AM
  3. File import opinion.
    By Kennedy in forum Tech Board
    Replies: 2
    Last Post: 09-22-2006, 05:52 PM
  4. File import problem
    By HAssan in forum C Programming
    Replies: 4
    Last Post: 11-15-2005, 04:13 PM
  5. import xml file to visual c++
    By Psico_Mind in forum C++ Programming
    Replies: 4
    Last Post: 05-22-2005, 10:09 AM

Tags for this Thread