Re: [sqlite] Building an SQLite Extension: How to check if a table exists in the database?

2012-03-09 Thread Igor Tandetnik
Wei Song wrote: > I'm developing an SQLite extension which uses a function to set data into a > table. I'd like to know how to check if a table > exists in a database? Just prepare the statement that you are going to use to write the data, and handle any errors. --

Re: [sqlite] SIGBUS error in case of disk full with WAL mode

2012-03-09 Thread Yongil Jang
Dear all, Thank you for your help. I tried -DSQLITE_SHM_DIRECTORY="/dev/shm" option for make file. It works very well. (One line should be added to make "/dev/shm" directory before calling file open) But, I didn't tried to use locking mode because of multiple processes can use same sqlite

Re: [sqlite] Best LINQ provider for SQLite?

2012-03-09 Thread Gour
On Fri, 9 Mar 2012 19:49:32 + Rob Richardson wrote: > If there is a way to search the archives, could someone please show > me? http://dir.gmane.org/gmane.comp.db.sqlite.general Sincerely, Gour -- Whatever action a great man performs, common men follow. And

Re: [sqlite] Building an SQLite Extension: How to check if a table exists in the database?

2012-03-09 Thread Peter Aronson
Er, what do you mean by C Syntax -- SQL isn't C?  If you meant ANSI SQL syntax, you could use: select count(*) from sqlite_master where type='table' and lower(name)=lower('tablename'); Instead.  But since you're accessing a metadata table that only exists in SQLite, this isn't particularly

[sqlite] Best LINQ provider for SQLite?

2012-03-09 Thread Rob Richardson
Greetings! What is the best LINQ provider for SQLite? I'm sorry for posting a question that must have been asked several times in the past, but the archives of this group do not appear to be searchable. If there is a way to search the archives, could someone please show me? RobR

Re: [sqlite] Building an SQLite Extension: How to check if a table exists in the database?

2012-03-09 Thread Wei Song 2
I'd like get the result in C Syntax. How can I do it? Peter Aronson-3 wrote: > > You got to be a bit careful there, SQLite isn't case-sensitive about table > names, but sqlite_master will preserve the case from the CREATE TABLE > statement.  Instead of > > > select count(*) from

Re: [sqlite] Building an SQLite Extension: How to check if a table exists in the database?

2012-03-09 Thread Wei Song 2
Yes, thank you. /Wei Roger Andersson-2 wrote: > > On 03/09/12 19:39, Wei Song wrote: >> Hello, >> >> I'm developing an SQLite extension which uses a function to set data into >> a table. I'd like to know how to check if a table exists in a database? >> > It's hard to say what you need but

Re: [sqlite] Building an SQLite Extension: How to check if a table exists in the database?

2012-03-09 Thread Peter Aronson
You got to be a bit careful there, SQLite isn't case-sensitive about table names, but sqlite_master will preserve the case from the CREATE TABLE statement.  Instead of select count(*) from sqlite_master where type='table' and name='tablename'; You need something like select count(*) from

Re: [sqlite] Building an SQLite Extension: How to check if a table exists in the database?

2012-03-09 Thread Roger Andersson
On 03/09/12 19:39, Wei Song wrote: Hello, I'm developing an SQLite extension which uses a function to set data into a table. I'd like to know how to check if a table exists in a database? It's hard to say what you need but maybe select count(*) from sqlite_master where type='table' and

[sqlite] Building an SQLite Extension: How to check if a table exists in the database?

2012-03-09 Thread Wei Song
Hello, I'm developing an SQLite extension which uses a function to set data into a table. I'd like to know how to check if a table exists in a database? Thanks. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] INSERT OR REPLACE

2012-03-09 Thread Alek Paunov
On 09.03.2012 17:39, Nico Williams wrote: Perhaps a Google summer of code project or something? Perhaps. Unfortunately not :-(. Google people have made a mistake in the past - looking for formal criteria to guarantee the openness of the initiative they included the rule that mentoring

Re: [sqlite] import a txt into sqlite

2012-03-09 Thread Larry Brasfield
On March 9, YAN HONG YE wrote: I have a txt file myteam.txt: ID;name;sex;match;chinese;english;phy;chem;total CY001;cred;male;54;101;101;55;99;695 CY002;rose;female;55;105;95;119;101;693 CY003;helen;male;110;95;65;50;50;613 CY004;jack;female;55;65;110;51;50;641

Re: [sqlite] Strange difference between sqlite 3.7.3 and 3.7.10

2012-03-09 Thread Richard Hipp
On Fri, Mar 9, 2012 at 1:51 AM, Alan Chandler wrote: > > Can you scrub the data (replace numbers with values from random(), and all >> strings with random text?) If not, email the database directly to me. >> >> >> I have done some randomisation and sent it to you

Re: [sqlite] INSERT OR REPLACE

2012-03-09 Thread Nico Williams
On Fri, Mar 9, 2012 at 6:05 AM, Ryan Johnson wrote: > Don't forget stored procedures. I didn't need to pollute the language with procedural extensions in order to make my case, which is why I didn't mention stored procedures :) I figured using stored procs in my

Re: [sqlite] INSERT OR REPLACE

2012-03-09 Thread Marc L. Allen
> That's why you don't make a DBMS (SQL) do the job of a programming > language. Use your programming language to to retrieve the values you > need to make your calculations. Then use your programming language to > figure out the new values and execute the UPDATE commands needed to > make the

Re: [sqlite] What's the best way to organize this database?

2012-03-09 Thread Larry Knibb
One thing to note is that there is an implicit "rowid" for each row already. Making an explicit ID column just adds an alias to it. http://www.sqlite.org/lang_createtable.html#rowid Cheers, Larry On 9 March 2012 21:29, Simon Slavin wrote: > > On 8 Mar 2012, at 5:25pm,

Re: [sqlite] What's the best way to organize this database?

2012-03-09 Thread Simon Slavin
On 8 Mar 2012, at 5:25pm, John Salerno wrote: > On Mar 8, 7:46 am, Simon Slavin wrote: > >> Yes, this would be the 'normalised' form. Something like >> >> artists: id, name, sortOrder >> songs: id, artistID, title >> plays: id, songID, playDate,

[sqlite] Database not readable anymore

2012-03-09 Thread Dirk Geppert
Dear Ladies and gentlemen, I am sending you an sqlite file, that is just not readable anymore. All the tools like the shell (sqlite3.exe) or the sqlite3_analyzer.exe cannot open the database. The error is: disk image is malformed So I cant dump or restore something. Using an hex viewer, the

Re: [sqlite] What's the best way to organize this database?

2012-03-09 Thread John Salerno
On Mar 8, 7:46 am, Simon Slavin wrote: > Yes, this would be the 'normalised' form.  Something like > > artists: id, name, sortOrder > songs: id, artistID, title > plays: id, songID, playDate, playTime Ok, between you and Larry's last post, it's starting to make a lot more

Re: [sqlite] Doing an UPDATE after an INSERT

2012-03-09 Thread Simon Slavin
On 9 Mar 2012, at 11:27am, Christoph P.U. Kukulies wrote: > I'm using System.Data.SQLite and the following problem comes up: > > I'm doing an INSERT of some columns in a TABLE. I have to determine now if > the INSERT was successful. I'm doing this by putting the INSERT in a

Re: [sqlite] INSERT OR REPLACE

2012-03-09 Thread Ryan Johnson
On 08/03/2012 6:15 PM, Nico Williams wrote: On Thu, Mar 8, 2012 at 4:37 PM, Simon Slavin wrote: That's why you don't make a DBMS (SQL) do the job of a programming language. Use your programming language to to retrieve the values you need to make your calculations.

Re: [sqlite] Doing an UPDATE after an INSERT

2012-03-09 Thread Taleeb Anwar
In Sql Server 2005+ you can retrieve the primary key of the last inserted record by using SELECT @@IDENTITY This can then be used to update the row Thanks & Regards Taleeb Anwar *Hum Mashriq Ke "Miskeenon" Ka Dil Maghrib men Ja Atka Hai!!* On Fri, Mar 9, 2012 at 4:57 PM, Christoph P.U.

[sqlite] Doing an UPDATE after an INSERT

2012-03-09 Thread Christoph P.U. Kukulies
I'm using System.Data.SQLite and the following problem comes up: I'm doing an INSERT of some columns in a TABLE. I have to determine now if the INSERT was successful. I'm doing this by putting the INSERT in a try { do the insert...and try the UPDATE } catch { do nothing}; In case the INSERT

Re: [sqlite] Side-by-side with checked out content

2012-03-09 Thread Jos Groot Lipman
Sorry, wrong group. Reposted in the Fossil group ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] TEXT PRIMARY KEY

2012-03-09 Thread Christoph P.U. Kukulies
Am 04.03.2012 15:22, schrieb Kit: 2012/3/4 Christoph P.U. Kukulies: CREATE TABLE dir(filename text, md5sum text, size int, content blob, PRIMARY KEY(filename,md5sum,size)); Coming back to your suggestion using PRIMARY KEY(filename,md5sum,size), how would I address this

Re: [sqlite] Side-by-side with checked out content

2012-03-09 Thread Jos Groot Lipman
Is it possible to see a side-by-side difference between the last checkin and the currently changed file on disk? It would be a great alternative to fossil diff and fossil gdiff This would be much like the wiki preview using /doc/ckout/ -- Jos Groot Lipman

[sqlite] ANN: SQLite Code Factory 12.3 released

2012-03-09 Thread SQL Maestro Group
Hi! SQL Maestro Group announces the release of SQLite Code Factory 12.3, a powerful Windows GUI solution aimed at the SQLite queries and scripts development. The new version is immediately available for download at http://www.sqlmaestro.com/products/sqlite/codefactory/ Please also note that

Re: [sqlite] A possible bug probably partially fixed before

2012-03-09 Thread Max Vlasov
On Fri, Mar 9, 2012 at 12:04 PM, Max Vlasov wrote: > 3.6.10 - > ... actualrndid never gets higher than 900 (wrong) > Sorry, correction, never gets lower than 900 Max ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] A possible bug probably partially fixed before

2012-03-09 Thread Max Vlasov
Hi, I experimented with random numbers recently (with an older version of sqlite) and notice a strange behavior, I tried to reproduce this with the latest version and noticed that it was probably partially fixed, but still returns wrong results for my query. The simplest table possible CREATE