Note that there are some explanatory texts on larger screens.

plurals
  1. POerror: database is locked in sqlite
    primarykey
    data
    text
    <p>//create database here</p> <pre><code> -(void) createDataBase { docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)objectAtIndex:0]; fullPath = [docPath stringByAppendingPathComponent:@"Recording.sqlite"]; sqlite3_open([fullPath UTF8String], &amp;dbForEmf); } // create table -(void) createTable { if (sqlite3_open([fullPath UTF8String], &amp;dbForE) == SQLITE_OK) { const char* createQuery = "CREATE TABLE IF NOT EXISTS EEE(E_ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, E_NAME TEXT,E_READING TEXT,E_DATE TEXT,E_SIZE TEXT,E_LABLE TEXT)"; int errorCode = sqlite3_prepare(dbForE, createQuery, -1, &amp;prepareStmt, NULL); if (errorCode == 0) { sqlite3_step(prepareStmt); } else { } sqlite3_finalize(prepareStmt); sqlite3_close(dbForE); } else { NSLog(@"data base not Open"); } } // insert data here -(void) insertData { if (sqlite3_open([fullPath UTF8String], &amp;dbForE)==SQLITE_OK) { NSString *insertSql = [NSString stringWithFormat:@"INSERT INTO EEE(E_NAME,E_READING,E_DATE,E_SIZE,E_LABLE) VALUES('%@','%@','%@','%@','%@')",_referenceObject.lastFilePath,_referenceObject.fileString,_referenceObject.dateString,_referenceObject.fileSizeString,_referenceObject.titleOfButtonString]; const char *insert_stmt=[insertSql UTF8String]; sqlite3_prepare_v2(dbForE,insert_stmt,-1,&amp;prepareStmt,NULL); sqlite3_reset(prepareStmt); if (sqlite3_step(prepareStmt)==SQLITE_DONE) { NSLog(@"inserted the values in table"); } else { NSLog(@" not inserted the values in table"); NSLog(@"error: %s", sqlite3_errmsg(dbForE)); } sqlite3_finalize(prepareStmt); sqlite3_close(dbForE); } } </code></pre> <p>hai data is insert on first viewController when ever i goto second viewController and come back to first viewController the data is not inserted error displays database is locked...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload