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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:08:13+00:00 2026-05-25T10:08:13+00:00

Possible Duplicate: How to implement Primary Key and Foreign Key Table Data in Class

  • 0

Possible Duplicate:
How to implement Primary Key and Foreign Key Table Data in Class Structure in Iphone Application

How to Select Foreign Key and Primary Key table data for display all data into detailviewcontroller Of rootTableView using this query

select 
    TaskId, TaskName, Category, StartDate, DueDate, Status 
from 
    ToDo, Category 
Where 
    ToDo.TaskId = Category.TaskId.

Thanks in advance….

  • 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-25T10:08:13+00:00Added an answer on May 25, 2026 at 10:08 am

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

        //const char *sql = "select TaskId,TaskName,StartDate,DueDate,Status,CategoryId from ToDo";
    
        const char *sql = "SELECT TaskId,TaskName,StartDate,DueDate,Status,ToDo.CategoryId,CategoryName FROM ToDo LEFT OUTER JOIN Category ON ToDo.CategoryId=Category.CategoryId";
    
        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);
                ToDo *toDoObj = [[ToDo alloc] initWithPrimaryKey:primaryKey];
                toDoObj.taskName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 1)];
                toDoObj.startDate = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 2)];
                toDoObj.dueDate = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 3)];
                toDoObj.status  = sqlite3_column_int(selectstmt, 4);
                toDoObj.categoryId = sqlite3_column_int(selectstmt, 5);
                toDoObj.category = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 6)];
                toDoObj.isDirty = NO;
    
                [appDelegate.todoArray addObject:toDoObj];
                [toDoObj release];
            }
        }
    
    }
    else
        sqlite3_close(database);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to implement “select all” check box in HTML? Select all and
Possible Duplicate: .NET - What’s the best way to implement a catch all exceptions
Possible Duplicate: How to programmatically send SMS on the iPhone? I want to implement
Possible Duplicate: c++ multithread I use c++ to implement a thread class. The code
Possible Duplicate: Interface vs Base class A class implementing an interface has to implement
Possible Duplicate: How to implement a Map with multiple keys? Imagine a table with
Possible Duplicate: How to implement licensing in php downloadable application I am developing a
Possible Duplicate: Uploading and downloading via ftp with iPhone SDK I want to implement
Possible Duplicate: How can I implement decrease-key functionality in Python's heapq? Hi, I'm using
Possible Duplicate: Why does (does it really?) List implement all these interfaces, not just

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.