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 8745619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:03:38+00:00 2026-06-13T12:03:38+00:00

I have a problem with SQLLite3 update function. I don’t know if my query

  • 0

I have a problem with SQLLite3 update function. I don’t know if my query is wrong or is that something wrong with the function I build.

- (void)updateRowWithID:(NSString *)databaseItem AndWithColumnName:(NSString *)changeColumnName AndWithValue:(NSString *)changeValue
{
    NSString * sql = [NSString stringWithFormat:@"UPDATE tblUsers SET %@ = %@ WHERE ID = %@", changeColumnName, changeValue, databaseItem];

    sqlite3_stmt * statement;
    if(sqlite3_open([[self path]UTF8String], &database) == SQLITE_OK)
    {
        const char *insert_stmt = [sql UTF8String];

        NSLog(@"UPDATE: %@",sql);

        // here it says the something wrong and the application crush.
        if(sqlite3_prepare_v2(database, insert_stmt, -1, &statement, NULL) != SQLITE_OK)
        {
            NSAssert(0, @"ERROR ON INSERTING TO TABLE");
        }
        int success = sqlite3_step(statement);
        if(success)
            NSLog(@"Success");
    }
}

This is the crush log:

2012-10-27 22:07:47.088 myapplication[21778:15803] *** Assertion failure in -[userData updateRowWithID:AndWithColumnName:AndWithValue:], /Users/user/myapplication/userData.m:47
2012-10-27 22:07:47.089 myapplication[21778:15803] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'ERROR ON INSERTING TO TABLE'
*** First throw call stack:
(0x1a70022 0x1600cd6 0x1a18a48 0x133f2cb 0xcfc8 0xfcab 0x1a71e99 0x9ab14e 0x9ab0e6 0xa51ade 0xa51fa7 0xa51266 0x9d03c0 0x9d05e6 0x9b6dc4 0x9aa634 0x224fef5 0x1a44195 0x19a8ff2 0x19a78da 0x19a6d84 0x19a6c9b 0x224e7d8 0x224e88a 0x9a8626 0x2835 0x2735 0x1)
terminate called throwing an exception(lldb) 

Please tell me, what am I doing wrong here?

Thanks!

  • 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-06-13T12:03:39+00:00Added an answer on June 13, 2026 at 12:03 pm

    Call sqlite3_errmsg() to find out what went wrong.

    It’s likely that a table or column name is wrong, or that the database is empty because the file at path does not exist.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a really frustrating problem I have a function that accepts a cursor
I have a problem with SQLite3 on Xcode. the problem is that I have
I have some problem with reading from sqlite3 database. -(void) readMessengesFromDatabase { sqlite3 *database;
i have a problem that i can't solve ! (sqlite3, but i think it
I have problem with my query on C, I’m using the oci8 driver. This
I have a problem with relations while using sqlite3 on rails. First i build
I have an application that is finished except for the problem i am trying
I have problems with a specific query when using the sqlite3_step function: SELECT DISTINCT
I have one function in my objective c code that updates a SQLite table
I am have a problem with SQLITE3. I have created 2 tables persons and

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.