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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:03:18+00:00 2026-06-05T14:03:18+00:00

-(NSMutableArray*) fetchMakeNamesYear1:(int) year1 Year2:(int) year2 compileStaement: (sqlite3_stmt*)compiledStatement { NSMutableArray *makeNames=[NSMutableArray array]; NSString *selectQuery=[NSString stringWithFormat:@SELECT

  • 0
-(NSMutableArray*) fetchMakeNamesYear1:(int) year1 Year2:(int) year2 compileStaement:    (sqlite3_stmt*)compiledStatement
{
    NSMutableArray *makeNames=[NSMutableArray array];
    NSString *selectQuery=[NSString stringWithFormat:@"SELECT DISTINCT Make FROM Inventory  WHERE   [Year] BETWEEN 2009 AND 2012 AND Make IS NOT NULL ORDER BY Make",year1 ,year2 ];
//   if (sqlite3_exec(((StorageManager*)[StorageManager sharedStorageManager]).database,  [selectQuery cStringUsingEncoding:NSUTF8StringEncoding], NULL, NULL, NULL) == SQLITE_OK) 
//   {
//       
//   }
    if(sqlite3_prepare_v2(((StorageManager*)[StorageManager sharedStorageManager]).database,  [selectQuery UTF8String] , -1, &compiledStatement, NULL) != SQLITE_OK) 
    {
        return nil;

    }
    while (sqlite3_step(compiledStatement) == SQLITE_ROW)
   {

        NSLog(@"return TYpe: %d",sqlite3_column_type(compiledStatement, 5));

        if (sqlite3_column_text(compiledStatement, 5)!= NULL)
        { 
            **NSString *makeName = [NSString  stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 6)];**
            [makeNames addObject:makeName];

        } 
       sqlite3_reset(compiledStatement);   
}
[self finalize:compiledStatement];

return  makeNames  ;

}

The value returned by the sqlite3_column_text(compiledStatement, 5) is NULL.

In my database the data type of the column no 5 is nvarchar[50].

Its column name is “Make”

My table name is “Inventory”

In above example I have hardcoded value for to and from year.

I tried the same sql query in the sqlite manager , and I found the data is showing for all make names.
I also found that the sqlite3_column_type(compileStatement,5) retuns 5 (SQLITE_NULL 5) but according to my Column type it should be 3 (SQLITE_TEXT 3)

Can someone give an insight of above behavior ?

  • 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-05T14:03:21+00:00Added an answer on June 5, 2026 at 2:03 pm

    You are using the wrong column index in sqlite3_column_text() – column 5 doesn’t exist in your query, try 0 instead (see SQLite documentation )

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

Sidebar

Related Questions

NSMutableArray *array = [[NSArray alloc] initWithObjects:@Apranax Forte, @Actified, @Zostex 125 MG, @Zoprotec 30 MG,
-(NSMutableArray *)processResult:(NSArray*)matchArray removeString:(NSString *)removeStr{ NSString *newLink; NSMutableArray *result = [[NSMutableArray alloc] initWithCapacity:[matchArray count]]; //doing
I have NSMutableArray day which contain (6 NSMutable arrays) arrays contain class Lesson{ NSString
NSMutableArray*array = [[NSMutableArray alloc]init]; NSArray*Somearray = [NSArray arrayWithObjects:1st Object,2ndObject,3rd Object,4th object,5th Object,nil]; In the
NSMutableArray *tempMutableArray = [[NSMutableArray alloc] init]; if (street != NULL) { [tempMutableArray addObject:(NSString *)street];
NSMutableArray *tempArr = [[NSMutableArray alloc] init]; if (self.subCategory) { for (int i = 0;
I have NSMutableArray* names , which contains NSStrings. I want to sort the array
What NSMutableArray methods correspond to these Javascript Array methods? shift(); unshift(); slice(); splice();
When I initialize self.nsmutableArray = [NSMutableArray array]; in my viewDidLoad method NSMutableArray initialize correctly
identifierListController.nameArray = [[NSMutableArray alloc] initWithArray:nameArrayT copyItems:YES]; namearray is array of view controllers. I am

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.