RE: [sqlite] Time zone conversion

2006-12-20 Thread Karthick V - TLS , Chennai
Let the time zone given by user +0530 Therefore its 330 minutes / 13200 seconds select datetime( StartTime,'unixepoch','+13200.0 seconds') from mytable --- gives you the local time Select datetime( StartTime,'unixepoch')gives u universal time Where StartTime is an integer(unixtimestamp

RE: [sqlite] Time zone conversion

2006-12-20 Thread Lloyd
Thanks Karthick. My code too works fine... (I made a small typo mistake in query, which executed silently) But I guess your method is the right one. Regards, Lloyd On Wed, 2006-12-20 at 16:54 +0530, Karthick V - TLS , Chennai wrote: Let the time zone given by user +0530 Therefore its

[sqlite] conditional code in trigger

2006-12-20 Thread chetana bhargav
Hi , I have two seperate triggers like, CREATE TRIGGER cnt1 AFTER INSERT ON tbl1 WHEN (new.Id =1 and new.priority 2 ) BEGIN update cnt set Critical = (SELECT Critical from msgs_cnt where Id=1) + 1 where Id=1; end; CREATE TRIGGER cnt2 AFTER INSERT ON tbl1 WHEN (new.Id =1 and

[sqlite] Re: conditional code in trigger

2006-12-20 Thread Igor Tandetnik
chetana bhargav bhargav_chetana-/[EMAIL PROTECTED] wrote: I have two seperate triggers like, CREATE TRIGGER cnt1 AFTER INSERT ON tbl1 WHEN (new.Id =1 and new.priority 2 ) BEGIN update cnt set Critical = (SELECT Critical from msgs_cnt where Id=1) + 1 where Id=1; end; CREATE TRIGGER

Re: [sqlite] Mathematical power operator?

2006-12-20 Thread jt
Hi, Look at the new loadable extension feature: http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions It also describe an example that could be really easy to convert to your sqrt problem. -- Julien - To unsubscribe,

Re: [sqlite] Need a wince test

2006-12-20 Thread Nuno Lucas
On 12/20/06, Brodie Thiesfield [EMAIL PROTECTED] wrote: +static HANDLE loadLibraryUtf8(const char *z){ + WCHAR zWide[MAX_PATH]; + DWORD dwLen = MultiByteToWideChar(CP_UTF8,0,z,-1,zWide,MAX_PATH); + if (dwLen == 0 || dwLen MAX_PATH) return NULL; + return LoadLibraryW(zWide); +} I can't

[sqlite] unable to open database file

2006-12-20 Thread Francesco Andrisani
Hi comunity, i'm writing CGI pages (writeen in ANSI C) with SQLITE3 support, all work fine using SELECT statement, but when i try to exec UPDATE or INSERT statement i've the follow error: unable to open database file I've set all data base fle permission, but it don't work. Thank a lot.

RE: [sqlite] delayed (batch) transactions

2006-12-20 Thread Laszlo Elteto
That may not be good enough. I actually do need the transactions within a few seconds (for consistency and availablility for other clients) - It's just that a few seconds of transaction loss is not a problem (on restart the system would reset to a good state). It seems nobody has ever done this

RE: [sqlite] Need a wince test

2006-12-20 Thread Robert Simpson
-Original Message- From: Brodie Thiesfield [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 19, 2006 9:17 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Need a wince test There are a few problems with your patch. +# ifdef _WIN32_WCE +static HANDLE

Re: [sqlite] unable to open database file

2006-12-20 Thread drh
Francesco Andrisani [EMAIL PROTECTED] wrote: Hi comunity, i'm writing CGI pages (writeen in ANSI C) with SQLITE3 support, all work fine using SELECT statement, but when i try to exec UPDATE or INSERT statement i've the follow error: unable to open database file I've set all data base

Re: [sqlite] delayed (batch) transactions

2006-12-20 Thread Nicolas Williams
On Wed, Dec 20, 2006 at 02:01:12AM +, [EMAIL PROTECTED] wrote: Laszlo Elteto [EMAIL PROTECTED] wrote: I DO need Durability, so I don't want to drop that. In fact, I need and want normal transactional updates - just not immediately flushed to disk. If the information is not flushed to

Re: [sqlite] delayed (batch) transactions

2006-12-20 Thread John Stanton
It is the same problem as trying to get a quart out of a pint bottle. People looking for durability and higher performance might find that using 15,000 RPM disks will do it without affecting durability or requiring an application redesign. Experimentation with multiple disk spindles so that

RE: [sqlite] delayed (batch) transactions

2006-12-20 Thread Laszlo Elteto
Nested transactions would solve my problem - but only if it worked across different connections. As I said there are many transactions from various clients, they may use multiple connections (eg. on a server). I think nested transactions would still be for ONE particular connection only... Laszlo

Re: [sqlite] Need a wince test

2006-12-20 Thread Brodie Thiesfield
Robert, does the patch I provided work as is on Windows CE or not? Robert Simpson wrote: There's some flaws in your arguments, Brodie ... 1. There's no need to do this whole _UNICODE test, only the _WINCE test is needed. All versions of Windows that support unicode also support the ANSI

Re: [sqlite] Need a wince test

2006-12-20 Thread drh
Brodie Thiesfield [EMAIL PROTECTED] wrote: As far as I understand, sqlite changed sometime in the early 3.0 versions such that char* strings (input and output) are always assumed to be UTF-8. [...] Yes. But this is a separate problem. Look at the code in os_win.c, e.g.

Re: [sqlite] delayed (batch) transactions

2006-12-20 Thread Nicolas Williams
On Wed, Dec 20, 2006 at 01:22:06PM -0500, Laszlo Elteto wrote: Nested transactions would solve my problem - but only if it worked across different connections. As I said there are many transactions from various clients, they may use multiple connections (eg. on a server). I think nested

Re: [sqlite] Need a wince test

2006-12-20 Thread Brodie Thiesfield
[EMAIL PROTECTED] wrote: Brodie Thiesfield [EMAIL PROTECTED] wrote: [...] SQLite should never expect strings in any encoding other than UTF-8 or UTF-16. (Note that ASCII is a proper subset of UTF-8 so SQLite will also accept ASCII.) I do not know what CP_ACP is, but if it is not a subset

Re: [sqlite] Mathematical power operator?

2006-12-20 Thread Jeff Godfrey
Julien, Thanks for the pointer. That does indeed look interesting, though I'm not sure it completely solves my problem (though, there may be no good solution to my problem). It would seem that, using the loadable extension feature, I could easily create a compiled version of my necessary

RE: [sqlite] Need a wince test

2006-12-20 Thread Robert Simpson
-Original Message- From: Brodie Thiesfield [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 20, 2006 12:17 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Need a wince test Robert, does the patch I provided work as is on Windows CE or not? Robert Simpson wrote: There's

Re: [sqlite] delayed (batch) transactions

2006-12-20 Thread Dennis Cote
Laszlo Elteto wrote: Nested transactions would solve my problem - but only if it worked across different connections. As I said there are many transactions from various clients, they may use multiple connections (eg. on a server). I think nested transactions would still be for ONE particular

Re: [sqlite] Mathematical power operator?

2006-12-20 Thread Dennis Cote
Jeff Godfrey wrote: I'm curious how others handle this. A. You don't need or use any custom SQL functionality B. You don't use a 3rd party SQLite management tool C. Something else I haven't thought of? Jeff, I think it is mostly A, or B, or at least it alternates between A and B

Re: [sqlite] Need a wince test

2006-12-20 Thread Brodie Thiesfield
Robert Simpson wrote: From: Brodie Thiesfield [mailto:[EMAIL PROTECTED] Robert, you are missing the point. Because of the way this is being defined, there is a need to check for _UNICODE. If you don't then a build with _UNICODE defined will fail. If it was implemented like the rest of the

RE: [sqlite] Need a wince test

2006-12-20 Thread Robert Simpson
-Original Message- From: Brodie Thiesfield [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 20, 2006 4:43 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Need a wince test Robert Simpson wrote: From: Brodie Thiesfield [mailto:[EMAIL PROTECTED] Robert, you are missing

Re: [sqlite] Need a wince test

2006-12-20 Thread Brodie Thiesfield
Robert Simpson wrote: CP_UTF8 doesn't work on most CE platforms and hence your proposed patch doesn't work. Then neither did drh's. Which then only leaves the option of implementing it in os_win.c which I have been wanting to do all along. Robert wrote: Brodie wrote: Robert wrote:

Re: [sqlite] Need a wince test

2006-12-20 Thread drh
win95/nt/ce users, please test check-in [3541] to see if extension loading now works on wince and to make sure that nothing broke on win95/nt. Tnx. http://www.sqlite.org/cvstrac/chngview?cn=3541 -- D. Richard Hipp [EMAIL PROTECTED]

[sqlite] Need yet another wince test

2006-12-20 Thread drh
Wince users, please verify that the code still works after applying patch [3542]. This patch reduces the number of utf8-unicode conversions required on wince. http://www.sqlite.org/cvstrac/chngview?cn=3542 -- D. Richard Hipp [EMAIL PROTECTED]

Re: [sqlite] Need yet another wince test

2006-12-20 Thread drh
Another wince change... Wince users, please verify patch [3543] for me. http://www.sqlite.org/cvstrac/chngview?cn=2123 -- D. Richard Hipp [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED]

Re: [sqlite] Need a wince test

2006-12-20 Thread Brodie Thiesfield
The utf8ToUnicode function uses MultiByteToWideChar(CP_UTF8) which it seems from recent comments isn't supported on all versions of Windows CE. This may need to be changed to use the internal UTF-8 to UTF-16 conversion routines. To be safe, the unicodeToMbcs needs to determine which codepage to

Re: [sqlite] Need a wince test

2006-12-20 Thread drh
Brodie Thiesfield [EMAIL PROTECTED] wrote: To be safe, the unicodeToMbcs needs to determine which codepage to convert to in the WideCharToMultiByte calls. This is done by calling the AreFileApisANSI() http://snipurl.com/arefileapisansi like: UINT codepage = AreFileApisANSI() ? CP_ACP :

Re: [sqlite] Need a wince test

2006-12-20 Thread Uwe Sander
Hi, Am Donnerstag, 21. Dezember 2006 04:03 schrieb [EMAIL PROTECTED]: My compiler does not define CP_OEM. Can somebody please tell me what the literal value of that macro is? I think, the name of the constant is CP_OEMCP, its value is 1. Don't have a CP_OEM on my disk. - Uwe

Re: [sqlite] Need a wince test

2006-12-20 Thread drh
Uwe Sander [EMAIL PROTECTED] wrote: Hi, Am Donnerstag, 21. Dezember 2006 04:03 schrieb [EMAIL PROTECTED]: My compiler does not define CP_OEM. Can somebody please tell me what the literal value of that macro is? I think, the name of the constant is CP_OEMCP, Yes. I figured that out

Re: [sqlite] Mathematical power operator?

2006-12-20 Thread Joe Wilson
One of the strengths of SQLite is having the flexability to hook it up to any language you like. But it would make life easier for everyone if there was some sort of standard built-in simple scripting language to create stored procedures and custom functions within the standard SQLite distro to

Re: [sqlite] Question about SQLite for Symbian

2006-12-20 Thread Joe Wilson
I'd be surprised if a port to a non-mainstream OS was available for free, but you never know. This may be your best bet: see 6.0 Custom Modifications http://www.hwaci.com/sw/sqlite/prosupport.html --- panslaw [EMAIL PROTECTED] wrote: I know that SQLite was written in C and I'm sure it's