Re: [sqlite] SQLITE is not working in pthread
YES... THERE COULD BE SOME SYNTX ERRORS HERE WHAT I HAVE SENT. Thanks & Regards Pramoda.M.A CREST | KPIT Cummins Infosystems Limited | Bengaluru | Cell: +91 91640 57663 -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Davies Sent: Friday, July 10, 2009 12:52 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLITE is not working in pthread 2009/7/10 Pramoda M. A <pramod...@kpitcummins.com>: > > Hi, > > We r using Fedora Linux 10. Our application is, when any device is inserted, > we will detect that create thread using pthread_create API. Which will find > all MP3 files in the device and extract the metadata present in the mp3 files > and fill a structre and send it to sqlite. > > > > Before that, I will create database like; > . . . > > This will run in thread. But here, "entered" and "entered 2"is printing. > But "entered 3" and "printing 4" both are not printing. > > After that, if I tried to query the database using command line tools, > "Select * from File", it is giving error as > > "encrypted file or is not a database" > > > > Please help me. > > Thanks & Regards > > Pramoda.M.A > Hi Pramoda, Your code as posted fails to compile because of "error C2181: illegal else without matching if": look at 'printf("entered 3");' Does your code work perfectly if not run in a thread? Regards, Simon ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] SQLITE is not working in pthread
Hi, We r using Fedora Linux 10. Our application is, when any device is inserted, we will detect that create thread using pthread_create API. Which will find all MP3 files in the device and extract the metadata present in the mp3 files and fill a structre and send it to sqlite. Before that, I will create database like; int EDB_Init(void) { Printf("entered"); if(sqlite3_open(DATABASE,) == SQLITE_OK) { Printf("entetred 2\n"); if(sqlite3_exec(db,"create table File(Song_id int primary key, path varchar(100), FileType int)", NULL, 0, ) == SQLITE_OK) printf("entered 3"); { if(sqlite3_exec(db,"create table Metadata(Song_id int primary key, Album varchar(30), Artist varchar(30), Title varchar(30), Genre varchar(30), Time int, playlistName varchar(15))", NULL, 0, ) == SQLITE_OK) { sqlite3_close(db); return SUCCESS; } else { sqlite3_free(GucpErrMsg); sqlite3_close(db); return CREATE_METADATA_ERROR; } } else { Printf("printing 4"); sqlite3_free(GucpErrMsg); sqlite3_close(db); return CREATE_FILE_TABLE_ERROR; } } else { printf("NOT Opened DataBase\n"); return DATABASE_OPEN_ERROR; } } This will run in thread. But here, "entered" and "entered 2"is printing. But "entered 3" and "printing 4" both are not printing. After that, if I tried to query the database using command line tools, "Select * from File", it is giving error as "encrypted file or is not a database" Please help me. Thanks & Regards Pramoda.M.A CREST | KPIT Cummins Infosystems Limited | Bengaluru | Cell: +91 91640 57663 -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of pierr Sent: Friday, July 10, 2009 11:59 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] SQLITE is not working in pthread Pramoda M. A wrote: > > Hi All > >Sqlite is not running in pthread. At first time, sqlite_open will > execute in pthread. From next time, no one API is executing. > Please guide me to make SQLite run in pthread. > Please anybody help me. > > Pramoda , Would you please provide some code snip so that we can know what exactly are you doing? -- View this message in context: http://www.nabble.com/SQLITE-is-not-working-in-pthread-tp24410382p24422426.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] SQLITE is not working in pthread
Hi All Sqlite is not running in pthread. At first time, sqlite_open will execute in pthread. From next time, no one API is executing. Please guide me to make SQLite run in pthread. Please anybody help me. Thanks & Regards Pramoda.M.A CREST | KPIT Cummins Infosystems Limited | Bengaluru | Cell: +91 91640 57663 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] SQLITE is not working in pthread
Hi All, I have used pthread_create(fedora 10) to insert data into database. But it is not working. Only sqlite3_open will execute first time. Not other things are executed in the thread. What should I do? Thanks & Regards Pramoda.M.A CREST | KPIT Cummins Infosystems Limited | Bengaluru | Cell: +91 91640 57663 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Error is coming in Linux while openings Databse
If I remove sqlite3_get_table API, it is working fine. Now segfault error is coming. I am running in root only. Data is inserting properly, but unable to query the the database. Thanks & Regards Pramoda.M.A CREST | KPIT Cummins Infosystems Limited | Bengaluru | Cell: +91 91640 57663 -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Martin.Engelschalk Sent: Thursday, July 09, 2009 4:59 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Error is coming in Linux while openings Databse Hi, Does the user under which the application runs have write permission on the Directory the database resides in? Are you sure that the segfault occurs inside sqlite and not in your own code? Martin Pramoda M. A schrieb: > Hi All, > >I am working on Fedora 10. Using C interfaces, I am successfully opening > database. No error while inserting data > Into database. But after insertion, if I try to get data it is giving > segmentation fault error. > When I try to open using in-built sqlite3 commands, "Select * from File", is > it error as > > " SQL error: file is encrypted or is not a database" > > Please anybody help. > > Thanks & Regards > Pramoda.M.A > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Error is coming in Linux while openings Databse
Hi All, I am working on Fedora 10. Using C interfaces, I am successfully opening database. No error while inserting data Into database. But after insertion, if I try to get data it is giving segmentation fault error. When I try to open using in-built sqlite3 commands, "Select * from File", is it error as " SQL error: file is encrypted or is not a database" Please anybody help. Thanks & Regards Pramoda.M.A ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How sqlite will store the data?
But how to get the rows in the same order of insertion? Say, I will insert 2 3 4 and it will store in 2 4 3. But I need in the order 2 3 4. Is it possible? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Michael Schlenker Sent: Friday, May 15, 2009 3:49 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] How sqlite will store the data? Pramoda M. A schrieb: > In which order, SQLite will store the data? In any order it likes, it might use the insertion order if thats convenient. > > I am using SQLite 3.6.5 and which is storing data in some other manner > than I am inserting? > > How to make it to store in the same way as insertion? > You usually don't. Simply use ORDER BY when retrieving your data, it was made for that. Michael -- Michael Schlenker Software Engineer CONTACT Software GmbH Tel.: +49 (421) 20153-80 Wiener Straße 1-3 Fax:+49 (421) 20153-41 28359 Bremen http://www.contact.de/ E-Mail: m...@contact.de Sitz der Gesellschaft: Bremen Geschäftsführer: Karl Heinz Zachries, Ralf Holtgrefe Eingetragen im Handelsregister des Amtsgerichts Bremen unter HRB 13215 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] How sqlite will store the data?
Hi All, In which order, SQLite will store the data? I am using SQLite 3.6.5 and which is storing data in some other manner than I am inserting? How to make it to store in the same way as insertion? Please anybody help me. With Regards Pramoda.M.A ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Giving error While compiling sqlite in Linux
Hi All, I tried to compile sqlite3.6.5 in linux as gcc -c sqlite3.c It is giving error : in pthreadMutexAlloc PTHREAD_MUTEX_RECURSIVE is undeclared... Please help anybody... With Regards Pramoda.M.A KPIT Cummins Infosystems Limited | Bengaluru | Board: +91 80 30783905 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] sqlite3 is giving error while creating object file in Linux
Hi All, I tried to create object file of sqlite3.6.5 using Gcc -c sqlite3.c But it is giving following error. In pthreaMutexAlloc, PTHREAD_MUTEX_RECURSIVE IS UNDECLARED Please can anybody tell me what options has to be used? With Regards Pramoda.M.A KPIT Cummins Infosystems Limited | Bengaluru | Board: +91 80 30783905 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Sqlite3 is not compiling in Linux
Hi All, I tried to compile in Linux. But it is giving error at linking stage as 'unreferenced dlopne dlclose... Can anybody help me? With Regards Pramoda.M.A KPIT Cummins Infosystems Limited | Bengaluru | Board: +91 80 30783905 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] How to delete the rows which is the result of Select operation of another table?
Dear All, I have to delete the rows of one table table but key is the result of select operation of another table? Delete from table1 where ID = ( Select ID from table2 where name like '%sqlite%'); Is it ok? With Regards Pramoda.M.A KPIT Cummins Infosystems Limited | Bengaluru | Board: +91 80 30783905 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] How to Select using Wild Characters?
Hi All, I have to select using wild charcters? How to do it? For eg: I have to select field which should contain "sqlite"... Then *sqlite* is not working... Pleas help me. With Regards Pramoda.M.A KPIT Cummins Infosystems Limited | Bengaluru | Board: +91 80 30783905 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] How to use wild characters to select rows?
Dear All, Please can anybody help me how to use wild characters to select rows? With Regards Pramoda.M.A KPIT Cummins Infosystems Limited | Bengaluru | Board: +91 80 30783905 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Exception Problem - Heap
Hi All, I am getting an exception/error after some data is retrieved. I have copied here the screenshot... After storing 250 rows of data, it is giving exception... How to use malloc functions efficiently? Please help me anybody... ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Hi All
HI , We are using freescale 1.MX31 board and Windows CE OS. We have ported sqlite 3.6.5. But system is hanging after porting. My colleagues saying that malloc functions used by sqlite itself causing the problem. Is it true? Can anybody please help me in this regard? Pramoda.M.A KPIT Cummins Infosystems Limited | Bengaluru ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] How to use BEGIN & COMMIT in my C program?
Hi All, How to use BEGIN and COMMIT in my C program? Main() { BEGIN; Sqlite3_exec(db, - - - -); COMMIT; } Is it valid? Pramoda.M.A KPIT Cummins Infosystems Limited | Bengaluru ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] How to turn off Indexing in SQLite?
Hi All, I am using SQLite and C interface. How to turn off Indexing in SQLite? With Regards, Pramoda.M.A KPIT Cummins Infosystems Limited | Bengaluru ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] 50 inserts takeing 8 seconds
Hi all. My desktop system with taking 8 seconds to insert 100 rows with only one column... I am inserting using Ffor loop (C interface) Can anybody help me? With Regards, Pramoda.M.A KPIT Cummins Infosystems Limited | Bengaluru ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users