Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1009401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:55:22+00:00 2026-05-16T08:55:22+00:00

When running the following prepare statement for a SQLite3 db-selecct query I get a

  • 0

When running the following prepare statement for a SQLite3 db-selecct query I get a SQLLite Error 21 “Library routine called out of sequence“:

sqlite3             *lDb;
sqlite3_stmt           *lStmt;
NSNumberFormatter     *lNbrFmt = [[[NSNumberFormatter alloc] init] autorelease];

// Define SQL statement 
NSString *lSql = @"SELECT section, language, title, description"
@"                        selector-x-pos, selector-y-pos, gps-x-pos, gps-y-pos"
@"                   FROM sections"
@"               ORDER BY section ASC";

lSqlResult = sqlite3_prepare_v2(lDb, [lSql UTF8String], -1, &lStmt, NULL);
NSLog(@"%@", [NSString stringWithUTF8String:sqlite3_errmsg(lDb)]);

What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T08:55:23+00:00Added an answer on May 16, 2026 at 8:55 am

    Uopon further investigation I found my mistake. I should have first opened the db before running the prep statement.

    The code should look like this:

    sqlite3             *lDb;
    sqlite3_stmt           *lStmt;
    NSNumberFormatter     *lNbrFmt = [[[NSNumberFormatter alloc] init] autorelease];
    
    // Define SQL statement 
    NSString *lSql = @"SELECT section, language, title, description"
    @"                        selector-x-pos, selector-y-pos, gps-x-pos, gps-y-pos"
    @"                   FROM sections"
    @"               ORDER BY section ASC";
    
    if(sqlite3_open([[fileMethods databasePath] UTF8String], &lDb) == SQLITE_OK) {
        lSqlResult = sqlite3_prepare_v2(lDb, [lSql UTF8String], -1, &lStmt, NULL);
        NSLog(@"%@", [NSString stringWithUTF8String:sqlite3_errmsg(lDb)]);
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 490k
  • Answers 490k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I found the problem It Appears that SQL server CE… May 16, 2026 at 9:54 am
  • Editorial Team
    Editorial Team added an answer Your problem is that vim does not know what does… May 16, 2026 at 9:54 am
  • Editorial Team
    Editorial Team added an answer Remove the space: .ui-button.ui-state-active with the space, the rule says… May 16, 2026 at 9:54 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

After downloading the September 2009 StackOverflow data-dump and running Brent's import query , I'm
I got the following SQLException: invalid options in all7 Upon googling the error message,
After running the following sub (VS debugger), I try to detach the database in
I have sed running with the following argument fine if I copy and paste
disconnect invalidates 1 active statement handle (either destroy statement handles or call finish on
I'm a long running fan of stackoverflow, first time poster. I'd love to see
I have the following scenario: I have a database with a particular MyISAM table
We have a Java code similar to the following: PreparedStatement stmt = connection.prepareStatement(drop login
I have a table which has following fields project_name VARCHAR (100) running_frequency enum ('daily',
I found following sentence in the Xcode 3.2.3 Readme (Posted: August 11, 2010 in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.