Thread: How do I perform Insert, Update and Delete sqlite3 commands using C?

  1. #1
    Registered User
    Join Date
    Mar 2012

    How do I perform Insert, Update and Delete sqlite3 commands using C?

    My values come from an HTML which I've already parsed with C. I figured out how to do Select command and was able to print out my table but I can't seem to figure out how to do the Insert, Update and Delete commands. Can anyone give me a sample code please? Thank you

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Documentation on the SQL dialect's syntax and C interface is available from the SQLite website.
    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

  3. #3
    Registered User ledow's Avatar
    Join Date
    Dec 2011
    Take the code that does your SELECT calls, change it so that it has the relevant DELETE or INSERT or UPDATE command instead. Not really that hard. Nothing to do with C, either, you're basically working with SQL when you get to the point that you're sending strings to SQL with SELECT etc. inside them.

    - Compiler warnings are like "Bridge Out Ahead" warnings. DON'T just ignore them.
    - A compiler error is something SO stupid that the compiler genuinely can't carry on with its job. A compiler warning is the compiler saying "Well, that's bloody stupid but if you WANT to ignore me..." and carrying on.
    - The best debugging tool in the world is a bunch of printf()'s for everything important around the bits you think might be wrong.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WPF Delete/Update/Insert Buttons
    By Tester84 in forum C# Programming
    Replies: 1
    Last Post: 12-06-2010, 11:02 PM
  2. Help with insert/delete binary search tree
    By Nazgulled in forum C Programming
    Replies: 39
    Last Post: 03-25-2009, 04:24 PM
  3. MS Access Insert/Update
    By BobDole in forum Tech Board
    Replies: 3
    Last Post: 08-25-2007, 08:45 PM
  4. Insert/Update Database (Urgent)
    By Joey in forum C++ Programming
    Replies: 3
    Last Post: 04-29-2002, 02:09 AM