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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:12:18+00:00 2026-06-17T21:12:18+00:00

this is my sqlite statement: NSString *queryString = @SELECT email.pk, email.sender_name, email.sender_address, search_email.subject, email.datetime,

  • 0

this is my sqlite statement:

NSString *queryString = @"SELECT email.pk, email.sender_name, email.sender_address, search_email.subject, email.datetime, "
"LENGTH(email.attachments), SUBSTR(search_email.body,0,150), email.folder_num, t.threadid, t.numThreads FROM "
"email, search_email ,(select  threadid, min( docid) as docid, count(*) as numThreads from search_email group by threadid) as t       "
"WHERE t.docid = email.pk AND (email.folder_num = ? OR email.folder_num_1 = ? OR email.folder_num_2 = ? OR email.folder_num_3 = ?) AND email.pk = search_email.docid "
"ORDER BY email.datetime DESC;";

all the values i fetch using sqlite3_column_text and sqlite3_column_int work fine.. but for some reason it fails on the threadid:

NSString* temp = @"";
const char *sqlVal = (const char *)sqlite3_column_text(folderSearchStmt, 1);

...
temp = @"";
sqlVal = (const char *)sqlite3_column_text(folderSearchStmt, 8);
if(sqlVal != nil)
    temp = [NSString stringWithUTF8String:sqlVal];
[res setObject:temp forKey:@"threadID"];

if i set a breakpoint on sqlVal, it returns sqlVal = (const char*) 0x266c0a30 "1-87"
but then temp returns (__NSCFString*)0x27f7bff0 @<variable is not NSString>

any ideas?

  • 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-17T21:12:20+00:00Added an answer on June 17, 2026 at 9:12 pm

    Have to reject invalid entries like this:

          const char *_abc = (char *) sqlite3_column_text(statement, 1);  
    
       NSString *_abcTemp;
    
          if (_abc)
              _abcTemp = _abc == NULL ? nil : [[NSString alloc] initWithUTF8String:_abc];
         else 
            _abcTemp = [[NSString alloc] initWithString:@"Not a valid string"];   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SQLite insert statement does not insert the new data i am using this code
This is an extension of this question: SQLite problem selecting two columns as one
This is how i creted my Database using sqlite Pro:~ dd$ sqlite3 db.db SQLite
This loop checks if a record is in the sqlite database and builds a
In this example we have 3 related tables on a SQLite database: CREATE TABLE
This is pretty strange (admitedly, this is my first attempt with python / sqlite),
I have made this code to open a database(created in SQLite browser) stored in
So this is what I have, I have a SQLite database with 3 tables:
One of my tables in my SQLite database is returning this error code below:
I'm using a Java wrapper for SQLite called SQLiteJDBC - this may have some

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.