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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:13:31+00:00 2026-05-28T11:13:31+00:00

I have a problem in sqlite wrapper method.. i have defined the below functions

  • 0

I have a problem in sqlite wrapper method.. i have defined the below functions and its showing error.. im not able to solve it. all im trying to do it swap rows in the database. it works fine in sqlite manager(firefox addon) with only sql statement. but here its showing an error so im assuming the way i have defined the functions might be wrong.. can someone put a little light on this issue so tat it helps??

THANKS in advance

// this is how i have defined the function in DB

-(NSMutableArray*)extractActivitytest:(int)pri
{
    [db beginTransaction];
NSString* tSqlString = [NSString stringWithFormat:@"select Activity_Name from Activity where Priority = %d", pri];
FMResultSet *tRecordSet = (FMResultSet*)[db executeQuery:tSqlString];
NSMutableArray *rowArray = [[NSMutableArray alloc] init];
   while ([tRecordSet next])
{

    [rowArray addObject:[tRecordSet stringForColumn:COLUMN_ACT]];

}
return [rowArray autorelease];
[db commit];

}

/// this is how i have called it

 [long1  setTitle:[[[DBManager getInstance]extractActivitytest:1] objectAtIndex:0]  forState:UIControlStateNormal];
[long2  setTitle:[[[DBManager getInstance]extractActivitytest:2] objectAtIndex:0]forState:UIControlStateNormal];
[long3  setTitle:[[[DBManager getInstance]extractActivitytest:3] objectAtIndex:0] forState:UIControlStateNormal];
[long4  setTitle:[[[DBManager getInstance]extractActivitytest:4] objectAtIndex:0]forState:UIControlStateNormal];
[long5  setTitle:[[[DBManager getInstance]extractActivitytest:5] objectAtIndex:0] forState:UIControlStateNormal];
[long6  setTitle:[[[DBManager getInstance]extractActivitytest:6] objectAtIndex:0] forState:UIControlStateNormal];

// this is the ERROR I’m getting

2012-01-06 14:03:20.387 MyDaily6[5657:207] Path= /Users/rega/Library/Application       Support/iPhone Simulator/4.3.2/Applications/5A554560-A01A-4F44-980E-CC200E037CFE/Documents/Goals.sqlite
2012-01-06 14:03:22.490 MyDaily6[5657:207] Error calling sqlite3_step (1: SQL logic error or missing database) SQLITE_ERROR
2012-01-06 14:03:22.491 MyDaily6[5657:207] DB Query: BEGIN EXCLUSIVE TRANSACTION;
2012-01-06 14:03:22.491 MyDaily6[5657:207] Error calling sqlite3_step (1: SQL logic     error or missing database) SQLITE_ERROR
2012-01-06 14:03:22.492 MyDaily6[5657:207] DB Query: BEGIN EXCLUSIVE TRANSACTION;
2012-01-06 14:03:22.492 MyDaily6[5657:207] Error calling sqlite3_step (1: SQL logic error or missing database) SQLITE_ERROR
2012-01-06 14:03:22.493 MyDaily6[5657:207] DB Query: BEGIN EXCLUSIVE TRANSACTION;
2012-01-06 14:03:22.493 MyDaily6[5657:207] Error calling sqlite3_step (1: SQL logic error or missing database) SQLITE_ERROR
2012-01-06 14:03:22.494 MyDaily6[5657:207] DB Query: BEGIN EXCLUSIVE TRANSACTION;
2012-01-06 14:03:22.494 MyDaily6[5657:207] Error calling sqlite3_step (1: SQL logic error or missing database) SQLITE_ERROR
2012-01-06 14:03:22.495 MyDaily6[5657:207] DB Query: BEGIN EXCLUSIVE TRANSACTION;

/// another similar function which is giving same error

-(void)moveupData:(int)value1:(int)value2
{
NSString *stringSQL = [NSString stringWithFormat:@" UPDATE Activity SET Priority = (CASE WHEN Priority = %d THEN %d WHEN Priority = %d THEN %d END) WHERE Priority IN (%d,%d)", value1, value2];
[db executeQuery:stringSQL];
[db commit];

}
// this is how im calling

[[DBManager getInstance]moveupData:moveUp :moveDown];

// ERROR I’m getting

 MOVEDOWN = 42012-01-06 14:03:34.932 MyDaily6[5657:207] Error calling sqlite3_step (1: SQL logic error or missing database) SQLITE_ERROR
2012-01-06 14:03:34.933 MyDaily6[5657:207] DB Query: COMMIT TRANSACTION;
  • 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-28T11:13:32+00:00Added an answer on May 28, 2026 at 11:13 am

    Are you sure your db is open? you should call

    [db open]
    

    And, for the second part, if you want to write to the db, you should use

    [db executeUpdate:stringSQL];
    

    Hope it helps!

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

Sidebar

Related Questions

i have a problem that i can't solve ! (sqlite3, but i think it
I have problem with return statment >.< I want to store all magazine names
i have problem with autorotate on iphone i set up in all classes -
I have a strange problem with sqlite which is driving me crazy. I have
Problem: SQLite assembly referenced in my DAL assembly does not get copied to the
I have one problem with Android SQLite database. I have one table which contains
I have a problem in JDBC driver for SQLite. I am executing a query
I have a problem I need to create table in database SQLite in Android
So, I have an odd problem. I'm working with an SQLite database through javascript
I have a problem with the init() method of a standard NSObject. I wrote

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.