SQLITE: What do I need after an INSERT statement?

Posted on 2011-05-02
Last Modified: 2012-05-11
I have an INSERT statement, followed by a SQLITE3_EXEC, followed by a SELECT statement and another SQLITE3_EXEC.  I'm getting an SQLERROR 21 (SQLITE_MISUSE) on the EXEC for the SELECT statement.

Line 11 ( is giving me the error...

Am I missing something between the two EXECs?  like a COMMIT, or?
Question by:rmmarsh
    LVL 61

    Expert Comment

    line 9 should be changed from
    L from CardData";

    L from CardData;";

    Author Comment

    Sorry, that didn't fix anything... still getting the 21.
    LVL 61

    Expert Comment


    you need to bind some variable fields in prepared statement
    select ... from ... where ?=... and ?= ,,,


    Author Comment

    That particular SELECT statement is like "SELECT * FROM database"... I want all of the rows returned, although there will be only one...
    LVL 61

    Accepted Solution


        This error might occur if one or more of the SQLite API routines is used incorrectly. Examples of incorrect usage include calling sqlite_exec after the database has been closed using sqlite_close or calling sqlite_exec with the same database pointer simultaneously from two separate threads.

    Author Closing Comment

    thank you for your time... I appreciate it...

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Query performance SQL Server 15 64
    Duplicate + trim records SQL 11 40
    .csv files 5 62
    Linking dictionary and columns together 2 39
    I guess that all of us know that caching the data usually increase the performance, but I worried if all of us are aware about the risk that caching the data provides and how to minimize this.  That’s the reason why I decided to write this short art…
    Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now