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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:25:06+00:00 2026-05-23T09:25:06+00:00

I am trying fetch the value from data base But it is not getting

  • 0

I am trying fetch the value from data base But it is not getting
I am trying this code but didn’t get the value ,When i use the Break point on the program
I am having Longitude,Latitude his data type is double in data base

if(sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) 
    {
        NSString *sqlStr = [NSString stringWithFormat:@"select Longitude,Latitude from Location"];
        const char *sqlStatement = [sqlStr UTF8String];
        sqlite3_stmt *compiledStatement;

        if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {
            locations = [NSMutableArray array];

            while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
                int i = sqlite3_step(compiledStatement);
                NSLog(@"%i",i); **//over here i am getting the 101 value in console** And my pointer getting out from here 
                NSString *dLongitude = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)];
                NSString *dLatitude = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 4)];    
                [locations addObject:[NSString stringWithFormat:@"%@ ,%@",dLongitude,dLatitude]];
                NSLog(@"%@",locations);
            }

            result = [locations componentsJoinedByString:@" "]; // same as `fake_location`

            // Get file path here

            NSError *error;
            if ( [result writeToFile:dbPath atomically:YES encoding:NSUTF8StringEncoding error:&error] ) {
                NSLog(@"%@", [error localizedDescription]);
            }
        }
        // Release the compiled statement from memory
        sqlite3_finalize(compiledStatement);
  • 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-23T09:25:07+00:00Added an answer on May 23, 2026 at 9:25 am
        while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
                        int i = sqlite3_step(compiledStatement);
                        NSLog(@"%i",i); **//over here i am getting the 101 value in console** And my pointer getting out from here 
    
                        double longitude = sqlite3_column_double(compiledStatement, 3);
                        double latitude = sqlite3_column_double(compiledStatement, 4);
    
                        NSString *coords = [[[NSString alloc] initWithFormat:@"%f,%f",longitude,latitude] autorelease];
    
                        [locations addObject:coords];
                        NSLog(@"%@",locations);
                    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this code to display image from URL, but it is not
am trying to fetch some data from a form, but i cant for some
I'm trying to fetch Wikipedia pages using LWP::Simple , but they're not coming back.
I'm trying to fetch data from a div (based on his id), using PHP's
I am trying to fetch records from Oracle 9i database whose value are 'FOO
I' trying to get some data from Oracle via ODBC to mySQL database. And
I'm trying to fetch some HTML from various blogs and have noticed that different
I'm trying to fetch some settings from my membership provider in my asp.net application
i am trying to fetch anything that looks like a URL from a string
I'm trying to fetch the most popular tags from all videos in my database

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.