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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:05:39+00:00 2026-06-11T01:05:39+00:00

how to check at the start of the app wether there is data in

  • 0

how to check at the start of the app wether there is data in sqlite or not if data is available in data base then it should upload other wise normally work the application

i will upload this data using post and using php for to upload data to server.

     + (void) getInitialDataToDisplay:(NSString *)dbPath {

CereniaAppDelegate *appDelegate = (CereniaAppDelegate *)[[UIApplication sharedApplication] delegate];

if (sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) {

    const char *sql = "select response_Id,question_id,answer_option,answer_text,update_date_time from survey_question_responses";



    sqlite3_stmt *selectstmt;
    if(sqlite3_prepare_v2(database, sql, -1, &selectstmt, NULL) == SQLITE_OK) {

        while(sqlite3_step(selectstmt) == SQLITE_ROW) {

            NSInteger primaryKey = sqlite3_column_int(selectstmt, 0);
            Coffee *coffeeObj = [[Coffee alloc] initWithPrimaryKey:primaryKey];
            coffeeObj.question_Id = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 1)];
            coffeeObj.answer_text = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 2)];
            coffeeObj.answer_option = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt,3)];

            coffeeObj.update_date_time = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 4)];
            int count=[appDelegate.coffeeArray count];

            NSLog(@"count is beofore getting values %d",count);




            [appDelegate.coffeeArray addObject:coffeeObj];



            int countone=[appDelegate.coffeeArray count];

            NSLog(@"count is after getting values %d",countone);

            [coffeeObj release];
        }
       }
     }
     else
    sqlite3_close(database); //Even though the open call failed, close the    database connection to release all the memory.
       }
  • 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-11T01:05:41+00:00Added an answer on June 11, 2026 at 1:05 am

    You can get number of rows present into the database by:

    SELECT COUNT(*) FROM table;
    

    if it returns 0 then your table is empty.

    //update……………….

          const char *sqlQuery="Select count(*)from yourTable";
        if(sqlite3_prepare_v2(database, sqlQuery, -1, &queryStatement, NULL)==SQLITE_OK)
        {
            while (sqlite3_step(queryStatement)==SQLITE_ROW) 
            {
    
                const char *count=(const char *)sqlite3_column_text(queryStatement, 0);
               NSString *rowCount=[NSString stringWithCString:count encoding:NSASCIIStringEncoding];
    
           //here you will get the number of rows in string format;
    
    
            }
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app start by Splash activity screen for 5 seconds Then open
I need to check whether internet is available or not in Android, so I
I found a code that should check wether the application is offline and has
My app needs to check whether user double clicks or not. But I can't
The app I'm coding checks wether there is a special ZIP-File in a Directory
start_check_stop = parser.add_mutually_exclusive_group() start_check_stop.add_argument('-s', '--start', action=start(*what*)) start_check_stop.add_argument('-c', '--check', action=check(*what*)) start_check_stop.add_argument('-t', '--stop', action=stop(*what*)) What do
I want to check whether a date is between start date and end date.
I want to check whether internet connection is enable on the start of the
I'm trying to check to make sure an item is visible before I start
Hola check this code. var watch = new Stopwatch(); watch.Start(); var request = HttpWebRequest.Create(new

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.