[sqlite] sqlite FS question

2009-04-01 Thread Sender 23
i like sqlite so far. my data is utf8 and has all the nightmarish junk chars in it, (quotes,!,line_feeds, CR so on.), currently i use mysql and i load data from a file I painstakingly prepare using: load data local infile '/tmp/p.data' into table tableone fields terminated by "^^^--&&&" LINES TER

[sqlite] Converting BLOB Data type to String

2009-04-01 Thread SATISH
Hello Buddies, I have written a string into database by converting into "BLOB Data Type".writing into database is Ok I got a problem when reading from the database to read a blob from the database I am using the function "const void *sqlite3_column_blob(sqlite3_stmt*, int iCol);" this func

[sqlite] Simple example for dummy user writing C code

2009-04-01 Thread My Name
I'm having hard time to store and retrieve data with SQLite. Let's assume I have this structure in my C code to hold my data struct foo {   long a;   float b;   char c[1024];   int d; } so the SQL definition would be CREATE TABLE foo (  a LONG;  b FLOAT;  c VARCHAR(1024);  d INT; ); In real lif

Re: [sqlite] Improving query performance

2009-04-01 Thread D. Richard Hipp
On Apr 1, 2009, at 2:00 PM, John Elrick wrote: > > explain query plan > select DISTINCT RESPONSES.RESPONSE_OID > from DATA_ELEMENTS, RESPONSES, SEQUENCE_ELEMENTS > where > SEQUENCE_ELEMENTS.SEQUENCE_ELEMENT_NAME = :sequence_element_name and > DATA_ELEMENTS.DATA_ELEMENT_NAME = :data_element_name a

Re: [sqlite] select the first 2 rows

2009-04-01 Thread Joanne Pham
Thanks Eric. Joanne   From: Eric Minbiole To: General Discussion of SQLite Database Sent: Wednesday, April 1, 2009 12:02:18 PM Subject: Re: [sqlite] select the first 2 rows > Hi all, > I have a big table and I want only select the first 2 rows. > I have tried

Re: [sqlite] General SQL question...

2009-04-01 Thread Igor Tandetnik
John Elrick wrote: > The following two queries appear to be functionally equivalent...that > is to say the results they produce are identical. Is there any > intrinsic advantage to one over the other? If so, what is that > advantage? The difference is purely stylistical. According to http://sq

[sqlite] General SQL question...

2009-04-01 Thread John Elrick
While experimenting with several different ways of structuring the query referenced in "Improving Query Performance", I mentally raised a question I hope someone can answer. The following two queries appear to be functionally equivalent...that is to say the results they produce are identical.

Re: [sqlite] 2038 year problem

2009-04-01 Thread Clark Christensen
Interesting. I suppose these variable results are because of each system's localtime() function? SQLite version 3.6.12 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> select datetime('2038-12-31 00:00:00'); 2038-12-31 00:00:00 sqlite> select strftime('%s', '203

Re: [sqlite] 2038 year problem

2009-04-01 Thread denisgolovan
01.04.09, 22:42, "Igor Tandetnik" : > select date('2038-12-31T00:00:00'); > and returns the expected value of '2038-12-31'. Show the exact code you > have a problem with. > Igor Tandetnik Yes. I'm sorry. My fault. Wrong format. I used /MM/DD. All works :) -- Regards, Denis Golovan aka

Re: [sqlite] select the first 2 rows

2009-04-01 Thread Eric Minbiole
> Hi all, > I have a big table and I want only select the first 2 rows. > I have tried this : > select top 2 from table; > but it doesn't work! Any help please. > JP Use a LIMIT clause instead of TOP: SELECT * FROM table LIMIT 2; http://www.sqlite.org/lang_select.html ___

[sqlite] select the first 2 rows

2009-04-01 Thread Joanne Pham
Hi all, I have a big table and I want only select the first 2 rows. I have tried this : select top 2 from table; but it doesn't work! Any help please. JP ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman

Re: [sqlite] 2038 year problem

2009-04-01 Thread Igor Tandetnik
denisgolovan wrote: > I'd like to ask a question about 2038 year unix problem. > I've found a mention about it on on > http://www.sqlite.org/cvstrac/wiki/wiki?p=DateAndTimeFunctions wiki > page. > Though I cannot grasp the idea of the following phase: > > "Also, the localtime() C function normally

Re: [sqlite] how to call c/c++ function in trigger

2009-04-01 Thread Simon Chen
Thanks, Igor! You're awesome... Igor Tandetnik wrote: > > Simon Chen wrote: >> I just realized that I need to something a bit more complicated. >> Basically, I need myfunction() to take parameters. The parameters >> should be generated based on the entry inserted, like something below: >> >> c

Re: [sqlite] how to call c/c++ function in trigger

2009-04-01 Thread Igor Tandetnik
Simon Chen wrote: > I just realized that I need to something a bit more complicated. > Basically, I need myfunction() to take parameters. The parameters > should be generated based on the entry inserted, like something below: > > create trigger triggerName before insert on tableName1 > when not m

[sqlite] 2038 year problem

2009-04-01 Thread denisgolovan
Hi I'd like to ask a question about 2038 year unix problem. I've found a mention about it on on http://www.sqlite.org/cvstrac/wiki/wiki?p=DateAndTimeFunctions wiki page. Though I cannot grasp the idea of the following phase: "Also, the localtime() C function normally only works for years between

[sqlite] Improving query performance

2009-04-01 Thread John Elrick
Sqlite 3.6.10 Background I have the following abbreviated case: CREATE TABLE sequence_elements ( sequence_element_oid integer primary key autoincrement, sequence_element_name varchar, definition_parent varchar, instance_parent varchar, soft_deleted_char varchar default 'F' ) C

Re: [sqlite] how to call c/c++ function in trigger

2009-04-01 Thread Gregory A Failing
Just throwing this out there ... how about the 'try / catch' construct in 'c++' ??? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org]on Behalf Of Simon Chen Sent: Wednesday, April 01, 2009 12:40 PM To: sqlite-users@sqlite.org Subject: Re: [sq

Re: [sqlite] how to call c/c++ function in trigger

2009-04-01 Thread Simon Chen
I just realized that I need to something a bit more complicated. Basically, I need myfunction() to take parameters. The parameters should be generated based on the entry inserted, like something below: create trigger triggerName before insert on tableName1 when not myfunction(tableName1.name, t

Re: [sqlite] Binary Format

2009-04-01 Thread Martin Pfeifle
thank you so much, that's really helpful. Best Martin Von: D. Richard Hipp An: General Discussion of SQLite Database Gesendet: Mittwoch, den 1. April 2009, 19:11:00 Uhr Betreff: Re: [sqlite] Binary Format On Apr 1, 2009, at 4:24 AM, Martin Pfeifle wrote: >

Re: [sqlite] Binary Format

2009-04-01 Thread D. Richard Hipp
On Apr 1, 2009, at 4:24 AM, Martin Pfeifle wrote: > Hi, > we do use SQLite in a standardisation initiative and have to state > which binary file-format of sqlite is used. > Up to now, I was of the opinion that all sqlite versions 3.x use the > same binary sqlite file > format but only differ in

Re: [sqlite] Binary Format

2009-04-01 Thread Martin Pfeifle
thank you. Best Martin Von: Jay A. Kreibich An: General Discussion of SQLite Database Gesendet: Mittwoch, den 1. April 2009, 15:52:08 Uhr Betreff: Re: [sqlite] Binary Format On Wed, Apr 01, 2009 at 08:24:29AM +, Martin Pfeifle scratched on the wall: > Hi, >

Re: [sqlite] Insert performance in 3.6.11 vs. 3.5.5

2009-04-01 Thread Kees Nuyt
On Wed, 1 Apr 2009 06:08:47 +0200, Günter Obiltschnig wrote: >Well, seems that was a false alarm. We were not able to reproduce this >on other systems - there the 3.6.11 release even performed slightly >better than 3.5.5. Still no idea what caused this, as now even the >original system no l

Re: [sqlite] how to call c/c++ function in trigger

2009-04-01 Thread Igor Tandetnik
Simon Chen wrote: > Another question is, if the c/c++ function takes 10 seconds to > finish, when another process queries the exact entry being modified, > what will be returned? Either the old data, or the busy error - depending on whether your writing connection had to spill from in-memory cac

Re: [sqlite] how to call c/c++ function in trigger

2009-04-01 Thread Simon Chen
Another question is, if the c/c++ function takes 10 seconds to finish, when another process queries the exact entry being modified, what will be returned? Maybe the old data? Is it possible to lock this entry so that either the new value (when check passes) or old value (when check fails) will be

Re: [sqlite] Binary Format

2009-04-01 Thread Jay A. Kreibich
On Wed, Apr 01, 2009 at 08:24:29AM +, Martin Pfeifle scratched on the wall: > Hi, > we do use SQLite in a standardisation initiative and have to?state > which?binary?file-format of sqlite is used. > Up to now, I was of the opinion that all sqlite versions 3.x use the same > binary sqlite file

Re: [sqlite] .genfkey in 3.6.12

2009-04-01 Thread Frank van Vugt
Hi, > > I noticed that the (recommended) amalgation version 3.6.12 does not > > contain > > the new .genfkey functionality, while the (not recommended) full > > version does. > > > > Is this on purpose? > > No, that was a mistake. It has now been fixed. Please download the > sqlite-amalgamation-

Re: [sqlite] .genfkey in 3.6.12

2009-04-01 Thread D. Richard Hipp
On Apr 1, 2009, at 4:50 AM, Frank van Vugt wrote: > Hi, > > I noticed that the (recommended) amalgation version 3.6.12 does not > contain > the new .genfkey functionality, while the (not recommended) full > version does. > > Is this on purpose? No, that was a mistake. It has now been fixed

[sqlite] Email address to post on mailing list

2009-04-01 Thread nishshanka sirisena
Hi. -- Email - nishshanka...@gmail.com Thanks. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] .genfkey in 3.6.12

2009-04-01 Thread Frank van Vugt
Hi, I noticed that the (recommended) amalgation version 3.6.12 does not contain the new .genfkey functionality, while the (not recommended) full version does. Is this on purpose? -- Best, Frank. ___ sqlite-users mailing list sqlite-users@sqlite

Re: [sqlite] Binary Format

2009-04-01 Thread Martin.Engelschalk
Hi, from the website http://www.sqlite.org/oldnews.html: The file format for version 3.3.0 has changed slightly to support descending indices and a more efficient encoding of boolean values. SQLite 3.3.0 will read and write legacy databases created with any prior version of SQLite 3. But datab

[sqlite] Binary Format

2009-04-01 Thread Martin Pfeifle
Hi, we do use SQLite in a standardisation initiative and have to state which binary file-format of sqlite is used. Up to now, I was of the opinion that all sqlite versions 3.x use the same binary sqlite file format but only differ in the library functionality. Can somebody confirm that the binar