[sqlite] Changing the actual data contained based on calculation...

2009-01-21 Thread jose isaias cabrera
Greetings and salutations! Ok, the subject is obscure, so let me explain... I am already doing this programmatically, but, but I would like to have SQLite do it instead. Let us imagine the following table: CREATE TABLE PMTime (id integer primary key, rec integer, date, secs integer);

Re: [sqlite] In memory SQLite

2009-01-21 Thread 钱晓明
use ":memory:" as the path of sqlite file when invoke sqlite3_open. 2009/1/22 Ionut > Hi, > > I am trying to use SQLite in a new operating system. > Right now we don't support a large functionality > Is there a way to make SQLite to work entirely into memory? > (meaning

Re: [sqlite] FTS3 - operator

2009-01-21 Thread Mike Marshall
Thanks Dan, didn't realize that NOT completely replaced -, thought you could use them side by side. All OK now Mike > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Dan > Sent: 21 January 2009 17:14 > To: General

Re: [sqlite] SQLITEBUSYTIMEOUT

2009-01-21 Thread Dave Toll
Some of your writes may be failing with SQLITE_BUSY or SQLITE_LOCKED if others take too long to complete. If this is happening, you should retry the write until it succeeds or increase your busy timeout (or both). Cheers, Dave. -Original Message- From: SATISH

[sqlite] In memory SQLite

2009-01-21 Thread Ionut
Hi, I am trying to use SQLite in a new operating system. Right now we don't support a large functionality Is there a way to make SQLite to work entirely into memory? (meaning that everything should be on main memory, from journals, logs...) Regards, Ionut

Re: [sqlite] FTS3 - operator

2009-01-21 Thread Dan
On Jan 21, 2009, at 11:43 PM, Mike Marshall wrote: > Hi all > > > > Quick question > > > > Should the - operator work in FTS in conjunction with the phrase > operator > > > > i.e. router -"ip address" > sqlite3_step returns SQLITE_ERROR which leads me to believe its > invalid but > the

Re: [sqlite] Date datatype

2009-01-21 Thread Nicolas Williams
On Wed, Jan 21, 2009 at 11:30:58AM -0500, Igor Tandetnik wrote: > One advantage of the string format is that it's visible to the "naked > eye" - when working with the database using generic tools (e.g. for > administration or troubleshooting). It's a pain to run ad-hoc queries > when the

Re: [sqlite] Date datatype

2009-01-21 Thread Igor Tandetnik
Paolo Pisati wrote: > Igor Tandetnik wrote: >> If you use -MM-DD format consistently, then simple string >> comparison just happens to give the same results as date comparison. >> > i'll take this route, but is it the best choice performance-wise? Two other good

Re: [sqlite] Date datatype

2009-01-21 Thread Paolo Pisati
Igor Tandetnik wrote: > If you use -MM-DD format consistently, then simple string comparison > just happens to give the same results as date comparison. > i'll take this route, but is it the best choice performance-wise? -- bye, P. ___

Re: [sqlite] Date datatype

2009-01-21 Thread Hoover, Jeffrey
It depends on the purpose for which you are using SQLite. It sure makes it ugly trying to convert an existing application TO SQLite. Oracle-like TO_DATE and TO_CHAR functions would be a big help. -Original Message- From: sqlite-users-boun...@sqlite.org

Re: [sqlite] Date datatype

2009-01-21 Thread Igor Tandetnik
Hoover, Jeffrey wrote: > You are comparing the values as strings. > > Instead, format your dates as -MM-DD and use the date function to > convert strings to dates for comparison: If you use -MM-DD format consistently, then simple string comparison just happens to give

Re: [sqlite] Date datatype

2009-01-21 Thread Hoover, Jeffrey
that's what date masks are for.. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik Sent: Wednesday, January 21, 2009 10:56 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Date datatype Hoover, Jeffrey

Re: [sqlite] Date datatype

2009-01-21 Thread MikeW
Hoover, Jeffrey writes: > ... > Be nice if it understood some other formats, too, such as 02-JAN-09 or > 11/17/2004... But both those two examples are potentially ambiguous !! MikeW ___ sqlite-users mailing list

Re: [sqlite] Date datatype

2009-01-21 Thread Igor Tandetnik
Hoover, Jeffrey wrote: > Seems the date function could use a lot of work. > > Be nice if it understood some other formats, too, such as 02-JAN-09 Is that January 2nd, 2009 or January 9th, 2002? > or 11/17/2004... If it were 11/12/2004 instead, would it be December 11th or

[sqlite] Question on in-memory database

2009-01-21 Thread Mark Feller
If I put a memory size limit such as SQLITE_MEMORY_SIZE = 8388608 (8MB), is a database created with the :memory: argument created within this chunk of memory, or external? Is it possible to save and load the in-memory database to disk (or in my case, serial or NAND flash)? Thanks!

Re: [sqlite] Date datatype

2009-01-21 Thread Hoover, Jeffrey
Sorry about my previous post. I was wrong. It appears that the DATE function is exceptionally rigid. You MUST use 2-digit months and 2-digits days, using a leading zero for values < 10. Probably need a 4-digit year, too. Seems the date function could use a lot of work. Be nice if it

Re: [sqlite] Date datatype

2009-01-21 Thread Hoover, Jeffrey
You are comparing the values as strings. Instead, format your dates as -MM-DD and use the date function to convert strings to dates for comparison: select date from envelope where date > date('2009-01-20') limit 3; here are some examples: sqlite> select date('2009-07-01')

Re: [sqlite] problems with importing data from c

2009-01-21 Thread baxy77bax
Thank You !! i get it now! robert Igor Tandetnik wrote: > > "baxy77bax" wrote in > message news:21581675.p...@talk.nabble.com >> the problem is that i have this situation: >> >> /*global*/ >> /*for sqlite */ >> sqlite3 *db; >> sqlite3_stmt* insert_stmt; >> >> /*finito

Re: [sqlite] Date datatype

2009-01-21 Thread John Stanton
Sqlite has no date type. Use a floating point number and the Sqlite date functions. Add your own ones to get extra functionality. Paolo Pisati wrote: > It seems i'm having an hard time with dates in sqlite: > > sqlite> .schema > CREATE TABLE `envelope` (`smtp_id` int(10) NOT NULL, `date` date

Re: [sqlite] ambiguous columns with natural join

2009-01-21 Thread Emil Obermayr
On Wed, Jan 21, 2009 at 07:40:53AM -0500, Igor Tandetnik wrote: > > Can you just write "select a.c from a natural join b;" ? Of course, but the DB-application is already written and is used by other DBs also. The application design currently needs the column to be unique without the need to

Re: [sqlite] ambiguous columns with natural join

2009-01-21 Thread Igor Tandetnik
"Emil Obermayr" wrote in message news:20090121123739.gc15...@nobswolf.info > I am not sure what the standard says, but I am used to single columns > after a natural join. So if table a and b are joined through column c > the following statement is valid: > > select c from a

Re: [sqlite] problems with importing data from c

2009-01-21 Thread Igor Tandetnik
"baxy77bax" wrote in message news:21581675.p...@talk.nabble.com > the problem is that i have this situation: > > /*global*/ > /*for sqlite */ > sqlite3 *db; > sqlite3_stmt* insert_stmt; > > /*finito sqlite*/ > > // function : > > Pr (VoidPtr ptr){ > > // 3 variables char a1,

[sqlite] ambiguous columns with natural join

2009-01-21 Thread Emil Obermayr
I am not sure what the standard says, but I am used to single columns after a natural join. So if table a and b are joined through column c the following statement is valid: select c from a natural join b; But I get "SQL error: ambiguous column name: c" Can this behaviour be changed? Will it be

Re: [sqlite] Date datatype

2009-01-21 Thread John Machin
On 21/01/2009 10:09 PM, Paolo Pisati wrote: > It seems i'm having an hard time with dates in sqlite: > > sqlite> .schema > CREATE TABLE `envelope` (`smtp_id` int(10) NOT NULL, `date` date NOT > NULL, `time` time NOT NULL, `mailq_sndr` int(10) NOT NULL, > `delivery_sndr` int(10) NOT NULL,

Re: [sqlite] Date datatype

2009-01-21 Thread Timothy A. Sawyer
I had a tough time myself with dates. Hope the following helps. Dates are actually stored in SQLite in -MM-DD format, with leading 0 and they are stored as strings. What helped me is that I do the date comparison as is in the database - even though they are stored as strings the format is

[sqlite] problems with importing data from c

2009-01-21 Thread baxy77bax
hi, the problem is, i'm trying to modify some c script but i'm not originally c programmer, so c is not my strong side . the problem is that i have this situation: /*global*/ /*for sqlite */ sqlite3 *db; sqlite3_stmt* insert_stmt; /*finito sqlite*/ // function : Pr (VoidPtr ptr){ // 3

Re: [sqlite] Date datatype

2009-01-21 Thread Paolo Pisati
MikeW wrote: > > It's a string comparison, '2009/' is identical in each case > but '1/7' > '01/20' since '1' > '0' > i suspected it, ok. > See also http://www.sqlite.org/lang_datefunc.html > that page shows how to convert date in different formats: does that mean that i have first to

Re: [sqlite] How to port sqlite to uc/os

2009-01-21 Thread MikeW
YIN HUI-XIAN-BHMJ64 writes: > > Hi all: >I want to port sqlite to uc/os without FS supporting. >Is it extremely difficult? > Can someone do me a favor? > Tks. > ___ > sqlite-users mailing list > sqlite-us...@... >

Re: [sqlite] Date datatype

2009-01-21 Thread MikeW
Paolo Pisati writes: > > It seems i'm having an hard time with dates in sqlite: > > sqlite> .schema > CREATE TABLE `envelope` (`smtp_id` int(10) NOT NULL, `date` date NOT > NULL, `time` time NOT NULL, `mailq_sndr` int(10) NOT NULL, > `delivery_sndr` int(10) NOT NULL,

[sqlite] Date datatype

2009-01-21 Thread Paolo Pisati
It seems i'm having an hard time with dates in sqlite: sqlite> .schema CREATE TABLE `envelope` (`smtp_id` int(10) NOT NULL, `date` date NOT NULL, `time` time NOT NULL, `mailq_sndr` int(10) NOT NULL, `delivery_sndr` int(10) NOT NULL, `customer_sndr` int(10) NOT NULL, `rpath` varchar(250) NOT

[sqlite] SQLITEBUSYTIMEOUT

2009-01-21 Thread SATISH
Hi! I am having 10 threads in my application by default my application uses UTF-16, where I use the 10 threads to open the same sqlite file and write in 10 different tables simultaneously.these all threads write around 7000 records in 10 different tables. While a thread opens