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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:29:48+00:00 2026-05-22T16:29:48+00:00

In a sqlite3 database, I’ve a table data with two fields: type and path.

  • 0

In a sqlite3 database, I’ve a table “data” with two fields: type and path. The field type is defined as INTEGER. In this field I insert a NSUInteger value (which will be for example 0 or 1). The problem is that, when I retrieve it, I obtain a “strange” value. I don’t know where I’m wronging.

   if (init_statement == nil) {
        const char *sql = "SELECT type,path FROM data WHERE id=?";
        if (sqlite3_prepare_v2(database, sql, -1, &init_statement, NULL) != SQLITE_OK) {
            NSAssert1(0, @"Error: failed to prepare statement with message '%s'.", sqlite3_errmsg(database));
        }
    }

    sqlite3_bind_int(init_statement, 1, primaryKey);

    if (sqlite3_step(init_statement) == SQLITE_ROW) {
     int type = (int)sqlite3_column_text(init_statement, 0);
     char *relPath = (char *)sqlite3_column_text(init_statement, 1);

    // other stuff
    } 

    // Reset the statement for future reuse.
    sqlite3_reset(init_statement);
  • 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-22T16:29:48+00:00Added an answer on May 22, 2026 at 4:29 pm

    SQLite allows only 64 bit signed integers. You are assigning it an unsigned integer. Change it to NSInteger instead.

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

Sidebar

Related Questions

I have sqlite3 database with example structure and data: CREATE TABLE person(id INTEGER PRIMARY
I'm trying to insert data into my SQlite3 database (this works via the command
Suppose I insert a data point into a sqlite3 database on a nightly basis.
I have this releases table in a SQLite3 database, listing each released version of
I have the following table in a SQLite3 database: CREATE TABLE overlap_results ( neighbors_of_annotation
I am developing an iPhone application that persists data to a SQLite3 database. For
I'd like to run some ALTER TABLE statements on a sqlite3 database. What happens
I'm using a sqlite3 database to store app's data. Instead of building a database
I have a table of events (in a sqlite3 database for what it's worth)
I have SQLite3 database, which is populated with some large set of data. I

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.