Re: [sqlite] Re: Re: How do I know what DBs I have attached?

2007-03-10 Thread Gussimulator
I don't know if this helps, but I'll comment anyway! I had a similar issue in the past, and what I did was to develop a small layer with a queue system, which took care of all the database requests and executed them without risking the database integrity nor the data to be processed.

[sqlite] Re: Re: Re: How do I know what DBs I have attached?

2007-03-10 Thread Igor Tandetnik
jose isaias cabrera <[EMAIL PROTECTED]> wrote: jose isaias cabrera <[EMAIL PROTECTED]> wrote: Perhaps, this should be the case. It would not be so hard to keep a table of connections that are attached or open with a table. You don't want an otherwise read-only connection have to write to the

Re: [sqlite] Re: Re: How do I know what DBs I have attached?

2007-03-10 Thread jose isaias cabrera
jose isaias cabrera <[EMAIL PROTECTED]> wrote: Perhaps, this should be the case. It would not be so hard to keep a table of connections that are attached or open with a table. You don't want an otherwise read-only connection have to write to the database. This will harm concurrency. Oh,

[sqlite] Re: Re: How do I know what DBs I have attached?

2007-03-10 Thread Igor Tandetnik
jose isaias cabrera <[EMAIL PROTECTED]> wrote: Perhaps, this should be the case. It would not be so hard to keep a table of connections that are attached or open with a table. You don't want an otherwise read-only connection have to write to the database. This will harm concurrency. Well,

[sqlite] UPDATE colomns based on their values

2007-03-10 Thread jose isaias cabrera
Greetings! So, I would like to update some columns based on whether or not they are null. Some of you folks have helped me with ifnull and IS NULL, and I happened to see coalesce, but none of these are working. If I set the value, they will work, but with the checks, they do not get

Re: [sqlite] Re: How do I know what DBs I have attached?

2007-03-10 Thread jose isaias cabrera
"Igor Tandetnik" wrote, jose isaias cabrera <[EMAIL PROTECTED]> wrote: What I would like to know is, how do I know if I have a db attached already? Realize that a set of attached DBs is a property of a connection (a sqlite3* handle), not some kind of persistent state of the database. You

Re: [sqlite] Compiling the linux package on windows using LCC ?

2007-03-10 Thread Gussimulator
I generated this make with LCC ide, thats why I dont understand the reason of my problem! I tried using GCC but when I run the make with the included makefile I get "nothing to be done for..." . Im getting quite frustrated by now. - Original Message - From: "John Stanton" <[EMAIL

Re: [sqlite] journal - "Unable to open the database file"

2007-03-10 Thread Nuno Lucas
On 3/10/07, Nuno Lucas <[EMAIL PROTECTED]> wrote: On 3/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Joe Wilson <[EMAIL PROTECTED]> wrote: > > --- [EMAIL PROTECTED] wrote: > > > Is there something that the SQLite core can do better? > > > > Perhaps exclusive locks on journal files would

[sqlite] Re: What is wrong with this UPDATE?

2007-03-10 Thread Igor Tandetnik
RB Smissaert <[EMAIL PROTECTED]> wrote: UPDATE A3SQLADC_J SET ADDED_DATE = '' WHERE ADDED_DATE = 0 OR ADDED_DATE IS NULL, START_DATE = '' WHERE START_DATE = 0 OR START_DATE IS NULL near ",": syntax error Make it UPDATE A3SQLADC_J SET ADDED_DATE = (case when ADDED_DATE = 0 OR ADDED_DATE IS

Re: [sqlite] What is wrong with this UPDATE?

2007-03-10 Thread Gerry Snyder
RB Smissaert wrote: UPDATE A3SQLADC_J SET ADDED_DATE = '' WHERE ADDED_DATE = 0 OR ADDED_DATE IS NULL, START_DATE = '' WHERE START_DATE = 0 OR START_DATE IS NULL near ",": syntax error I am sure I have run this before with no trouble. According to the web page, there should be only one WHERE

Re: [sqlite] Compiling the linux package on windows using LCC ?

2007-03-10 Thread John Stanton
From my recollection the lcc make is not syntax compatible with standard make. I have always used the lcc make within its own IDE so that the make file is generated by the lcc IDE. You could use a regular make and just subsitute the CC definition for the lcc compiler. You might find the

Re: [sqlite] are nested joins possible ?

2007-03-10 Thread Stef Mientki
Stef Mientki wrote: thanks guys, for the fast and different responses, I really appreciate that. ... now I need a couple hours to study all your ideas. After studying all your suggestions, I must conclude that my knowledge of SQL is too low to create a real fool proof solution. For the

Re: [sqlite] Compiling the linux package on windows using LCC ?

2007-03-10 Thread Gussimulator
Thanks for the info. Im trying with the LCC ide but I get odd errors while trying to compile: "c:\lcc\bin\make.exe: Commands defined twice for target where.obj near line 87" I was getting a similar error with another file, I remade the project and now Im getting the same error on a different

[sqlite] What is wrong with this UPDATE?

2007-03-10 Thread RB Smissaert
UPDATE A3SQLADC_J SET ADDED_DATE = '' WHERE ADDED_DATE = 0 OR ADDED_DATE IS NULL, START_DATE = '' WHERE START_DATE = 0 OR START_DATE IS NULL near ",": syntax error I am sure I have run this before with no trouble. RBS

Re: [sqlite] journal - "Unable to open the database file"

2007-03-10 Thread drh
Dave Dyer <[EMAIL PROTECTED]> wrote: > > > >The main purpose of the journal is so that if the program > >or OS crashes or there is a power failure, once the machine > >reboots and some other process tries to read the database, > >the other process can see the journal and roll it back. > >Private

[sqlite] Re: journal - "Unable to open the database file"

2007-03-10 Thread Dave Dyer
> >OS designers could think about providing a capability of tagging a file as >private and making it immune to interference from gratuitous activity. Of course, if such a facility existed it would be exploited by viruses to keep the antivirus forces at bay. Quite a conundrum. This kind of

Re: [sqlite] Re: journal - "Unable to open the database file"

2007-03-10 Thread John Stanton
The journal file enables Sqlite to roll back a part-posted transaction on restart and ensure transactional integrity. Dave Dyer wrote: The main purpose of the journal is so that if the program or OS crashes or there is a power failure, once the machine reboots and some other process tries to

[sqlite] Re: journal - "Unable to open the database file"

2007-03-10 Thread Dave Dyer
> >The main purpose of the journal is so that if the program >or OS crashes or there is a power failure, once the machine >reboots and some other process tries to read the database, >the other process can see the journal and roll it back. >Private anonymous mapped objects defeat that purpose, it

Re: [sqlite] journal - "Unable to open the database file"

2007-03-10 Thread Nuno Lucas
On 3/10/07, Nuno Lucas <[EMAIL PROTECTED]> wrote: On 3/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > They are, at least on unix. On unix, both files are opened with > the O_EXCL flag. How do I do the same thing for windows? The code does that already. You just pass 0 on the share

Re: [sqlite] stupid man's manual to sqlite?

2007-03-10 Thread A.J.Millan
>Removing the index is one of the silliest suggestions I've ever >encountered. A book without an index is almost useless, unless of course >you're blessed with a photographic memory. As far as putting in on a CD >or on the web, that's fine as long as a _good_ index is also included in >the book.

Re: [sqlite] Compiling the linux package on windows using LCC ?

2007-03-10 Thread John Stanton
GCC will compile you a library usable with a broad range of C compilers. If you find the gcc library unusable use the makefile as the basis for compiling it using lcc. I use lcc and gcc (mingw) interchangably. GCC has optimization but if you write elegant and efficient C lcc will generate

Re: [sqlite] journal - "Unable to open the database file"

2007-03-10 Thread John Stanton
This is a code snippet for such a function with Windows and Unix. Even here the dreaded NFS raises its ugly head. The Windows code has worked fine, but Windows gurus might find some way to improve it. /*Open the file if possible in the appropriate mode.*/ #if IS_WIN32 mode =

Re: [sqlite] UPDATE base on certain values

2007-03-10 Thread jose isaias cabrera
"Dennis Cote" wrote, jose isaias cabrera wrote: So, there is on way of doing it in one call/instruction as I previously exampled, correct? I will have to do them in many calls, correct? Jose, You can do it in one API call if you put all the update statements into a single string.

Re: [sqlite] journal - "Unable to open the database file"

2007-03-10 Thread John Stanton
After I hit it struck me like a bombshell that the journal has to be there for the next startup to perform its complete function so such a method would fail. A virtual memory based object would only provide transactional support, not crash recovery. Humble pie for breakfast! OS designers

Re: [sqlite] Compiling the linux package on windows using LCC ?

2007-03-10 Thread Gussimulator
GCC?, I need to use the resulting DLL on normal C under windows later on, without having strange dependencies, etc. I'd like to know what am I doing wrong when I try to compile the sources... Do I have to output obj for each source and then somehow link this into the final library? -

Re: [sqlite] Question about shared cache and read_uncommitted

2007-03-10 Thread Dan Kennedy
On Sat, 2007-03-10 at 22:22 +0900, Brownie wrote: > Thanks Dan, > > > That the first database file was ATTACHed instead of being opened > > directly makes no difference. > > A cache of :memory: database also be shared on shared cache mode ? > Or :memory: database of each connections are

RE: [sqlite] stupid man's manual to sqlite?

2007-03-10 Thread Anderson, James H \(IT\)
Removing the index is one of the silliest suggestions I've ever encountered. A book without an index is almost useless, unless of course you're blessed with a photographic memory. As far as putting in on a CD or on the web, that's fine as long as a _good_ index is also included in the book. I

[sqlite] Re: Fwd: database is locked error on Mac OS X

2007-03-10 Thread A. Pagaltzis
* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2007-03-10 17:30]: > Do "configure". Then edit the Makefile that is generated. It would be nice if these options were mapped to `--enable-foo` switches on the configure script… would that take a lot of work? (Alternatively, if you don’t want to do it

Re: Fwd: [sqlite] database is locked error on Mac OS X

2007-03-10 Thread P Kishor
On 3/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: T <[EMAIL PROTECTED]> wrote: > Can someone please tell me (politely ;-) where to put the - > DSQLITE_ENABLE_LOCKING_STYLE=1 > > I tried inserting it arbitrarily in the Makefile.in file but it > didn't seem to make a difference. > Do

Re: Fwd: [sqlite] database is locked error on Mac OS X

2007-03-10 Thread drh
T <[EMAIL PROTECTED]> wrote: > Can someone please tell me (politely ;-) where to put the - > DSQLITE_ENABLE_LOCKING_STYLE=1 > > I tried inserting it arbitrarily in the Makefile.in file but it > didn't seem to make a difference. > Do "configure". Then edit the Makefile that is generated. --

Re: [sqlite] journal - "Unable to open the database file"

2007-03-10 Thread Joe Wilson
--- Joe Wilson <[EMAIL PROTECTED]> wrote: > There's also this - CreateFileTransacted(): > > http://msdn2.microsoft.com/en-us/library/aa363859.aspx > > which has the argument: > > dwShareMode > ... > If this parameter is 0 (zero) and CreateFileTransacted succeeds, > the object

Re: [sqlite] journal - "Unable to open the database file"

2007-03-10 Thread Scott Hess
On 3/10/07, Joe Wilson <[EMAIL PROTECTED]> wrote: There's also this - CreateFileTransacted(): http://msdn2.microsoft.com/en-us/library/aa363859.aspx Doesn't this require Vista? -scott - To unsubscribe, send email

Re: [sqlite] journal - "Unable to open the database file"

2007-03-10 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote: > Joe Wilson <[EMAIL PROTECTED]> wrote: > > --- [EMAIL PROTECTED] wrote: > > > Is there something that the SQLite core can do better? > > > > Perhaps exclusive locks on journal files would help avoid this problem. > > Or are the -journal and etilqs_* files supposed to

[sqlite] collate function / international sort on linux

2007-03-10 Thread jp
Thanks to several posts in this forum, I now have a custom collation defined with sqlite3_create_collation, which uses Window's CompareStringA. I managed to add it to main.c and recompiled sqlite (I finally got my compilation running on Windows with MingW/Msys). For my needs properly does

Fwd: [sqlite] database is locked error on Mac OS X

2007-03-10 Thread T
Can someone please tell me (politely ;-) where to put the - DSQLITE_ENABLE_LOCKING_STYLE=1 I tried inserting it arbitrarily in the Makefile.in file but it didn't seem to make a difference. Don't laugh :-[ ;-) Thanks, Tom From: T <[EMAIL PROTECTED]> Date: 9 March 2007 1:46:21 PM To:

Re: [sqlite] Question about shared cache and read_uncommitted

2007-03-10 Thread Brownie
Thanks Dan, That the first database file was ATTACHed instead of being opened directly makes no difference. A cache of :memory: database also be shared on shared cache mode ? Or :memory: database of each connections are irrelevant ? Regards, 2007/3/10, Dan Kennedy <[EMAIL PROTECTED]>: On

Re: [sqlite] journal - "Unable to open the database file"

2007-03-10 Thread Uwe Sander
Hi, Am Samstag, 10. März 2007 13:26 schrieb [EMAIL PROTECTED]: > purpose. Where do I find out more about "anonymous mapped > objects" for windows? ot sure if this is what John wanted to suggest: http://msdn2.microsoft.com/en-us/ms810613.aspx Note that you can create a mapping using the systems

Re: [sqlite] journal - "Unable to open the database file"

2007-03-10 Thread drh
Joe Wilson <[EMAIL PROTECTED]> wrote: > --- [EMAIL PROTECTED] wrote: > > Is there something that the SQLite core can do better? > > Perhaps exclusive locks on journal files would help avoid this problem. > Or are the -journal and etilqs_* files supposed to be sharable by other > sqlite

Re: [sqlite] journal - "Unable to open the database file"

2007-03-10 Thread drh
John Stanton <[EMAIL PROTECTED]> wrote: > A suggestion for the journal files would be to make them private > anonymous mapped objects. The main purpose of the journal is so that if the program or OS crashes or there is a power failure, once the machine reboots and some other process tries to

Re: [sqlite] stupid man's manual to sqlite?

2007-03-10 Thread A.J.Millan
>I will get back to you about the index. I also would like to invite >anyone else who has any specific things they would like to see changed >in the index to tell me. Assuming I can get a revised index out >electronically, I will make any such changes immediately to the file I >have on-hand. >--

Re: [sqlite] sin and similar functions

2007-03-10 Thread Jakub Ladman
Thank you very much. I am new to this mailing list, so i missed it. Jakub Ladman Dne sobota 10 březen 2007 00:48 Clark Christensen napsal(a): > A poster here, "Mikey C", wrote some math functions and posted them a month > or so ago. You might have a look at >