Re: [sqlite] CREATE TRIGGER IF NOT EXISTS throws error
I think you need 3.3.8 or greater. On Mon, 2007-03-26 at 07:39 +0200, stephan nies wrote: > I am using sqlite 3.3.5 . > > On 3/25/07, Eric Pankoke <[EMAIL PROTECTED]> wrote: > > > > What version of SQLite are you using? I'm not sure the IF EXISTS option > > was present until a certain version of 3.x (though I'm not sure which > > version). > > > > Eric Pankoke > > Founder > > Point Of Light Software > > http://www.polsoftware.com/ > > > > > > -Original Message- > > From: stephan nies [mailto:[EMAIL PROTECTED] > > Sent: Sunday, March 25, 2007 1:47 PM > > To: sqlite-users@sqlite.org > > Subject: [sqlite] CREATE TRIGGER IF NOT EXISTS throws error > > > > Hello, > > when i build a test table with: > > > > CREATE TABLE test(a text); > > > > and try to implement a trigger using: > > > > CREATE TRIGGER IF NOT EXISTS trig_name > > BEFORE INSERT ON test > > FOR EACH ROW BEGIN > > SELECT RAISE(ROLLBACK, 'blabla') > > WHERE NEW.a = 'pong'; > > END; > > > > I get this error message: > > SQL error: near "NOT": syntax error > > > > > > if i omit the "IF NOT EXISTS" everything woks fine. > > According to the Documentation at > > http://www.sqlite.org/lang_createtrigger.html > > SQLite should understand this syntax. > > So what am i doing wrong here? > > > > Thanks, > > Stephan > > > > > > > > > > - > > To unsubscribe, send email to [EMAIL PROTECTED] > > > > - > > > > - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] CREATE TRIGGER IF NOT EXISTS throws error
I am using sqlite 3.3.5 . On 3/25/07, Eric Pankoke <[EMAIL PROTECTED]> wrote: What version of SQLite are you using? I'm not sure the IF EXISTS option was present until a certain version of 3.x (though I'm not sure which version). Eric Pankoke Founder Point Of Light Software http://www.polsoftware.com/ -Original Message- From: stephan nies [mailto:[EMAIL PROTECTED] Sent: Sunday, March 25, 2007 1:47 PM To: sqlite-users@sqlite.org Subject: [sqlite] CREATE TRIGGER IF NOT EXISTS throws error Hello, when i build a test table with: CREATE TABLE test(a text); and try to implement a trigger using: CREATE TRIGGER IF NOT EXISTS trig_name BEFORE INSERT ON test FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'blabla') WHERE NEW.a = 'pong'; END; I get this error message: SQL error: near "NOT": syntax error if i omit the "IF NOT EXISTS" everything woks fine. According to the Documentation at http://www.sqlite.org/lang_createtrigger.html SQLite should understand this syntax. So what am i doing wrong here? Thanks, Stephan - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] SQLite installation problems
Hi, I'm trying to install SQLite in order to use Trac with our SVN repositories. We're running RedHat 4 Ent. I downloaded the source code file sqlite-3.3.13.tgz and followed the README on how to compile but ran into the problem that the header file "tcl.h" could not be found, even though I have the rpm tcl-8.4.7-2 installed it is missing the tcl-devel package so the compile fails when I run make. I see there is another way to get SQLite installed by using the precompiled binaries for linux. but where do I put these files tclsqlite-3.3.13.so, fts2-3_3_13.so and sqlite3_analyzer-3.3.13.bin on my system? Also is there an rpm package for RH4 enterprise? Thanks, Brian
Re: [sqlite] Store and retreive 0D0A (CRLF) in string field
SQLite doesn't truncate anything. Whatever you put in you get out. If you see a truncation, it is either done by whatever wrapper you use on top of SQLite, or simply an artifact of the way you inspect the data (e.g. you look at the string in a debugger, and the debugger just happens to show only the first line). Use sqlite3_column_bytes[16] to convince yourself that SQLite gives you the complete string. Igor Tandetnik Thanks for that rather blunt reply. I had already figured out the data was there by using a professional sqlite tool. Now I just have to figure out how my compiler is handling the returned data. -- View this message in context: http://www.nabble.com/Store-and-retreive-0D0A-%28CRLF%29-in-string-field-tf3461423.html#a9666968 Sent from the SQLite mailing list archive at Nabble.com. - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] using SQLite with flash file systems
On 3/25/07, John Fisher <[EMAIL PROTECTED]> wrote: I note from the home page that "Transactions are atomic, consistent, isolated, and durable (ACID) even after system crashes and power failures". Is this still the case if the database is stored on a flash file system, say JFFS2 with the linux kernel? I am running SQLITE on a JFFS2 filesystem, and the above statement seems to hold just fine. Just make sure SYNCHRONOUS = FULL. - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] using SQLite with flash file systems
I note from the home page that "Transactions are atomic, consistent, isolated, and durable (ACID) even after system crashes and power failures". Is this still the case if the database is stored on a flash file system, say JFFS2 with the linux kernel? - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] Questions on views
Thank you for the reply. Is doing a SELECT EXISTS (...) faster than a SELECT COUNT (... LIMIT 1) or would it be the same (I would expect them to be the same, but that's only my guess)? Regards, Dennis > -Original Message- > From: Dennis Cote [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 24, 2007 1:47 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Questions on views > > Dennis Volodomanov wrote: > > > > Is it quicker (slower or the same) to execute a query on a > view or to > > execute the original query from which this view was created? > > > > I'm basically looking for the best (fastest) way to execute > thousands > > of queries to check whether they return any results or not. At the > > moment I'm doing a COUNT, but I'm hoping to find an easier > way than to > > execute count thousands of times... > > > > > Dennis, > > A query on a view will take a little longer to prepare than > the same query used to define the view, but both should > execute at the same speed since sqlite saves and recompiles > the sql code used to define the view. > > You can check for a result from a query using EXISTS faster > than you can count the number of results. Exists tests stop > as soon as they have found a result, count must find all the results. > > select exists( ); > > HTH > Dennis Cote > > > > -- > --- > To unsubscribe, send email to [EMAIL PROTECTED] > -- > --- > > - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UTF-8 or ISO-8859-1
At 9:42 PM +0200 3/25/07, Ralph Müller wrote: to store (german) Text in a SQLite Database, is it better to use UTF-8 or is ISO-8859-1 more recommendable? It is recommended to use UTF-8 no matter what language text is in the database, since it is fully adaptable to any situation. Also, with SQlite 3, you don't get the second choice. -- Darren Duncan - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UTF-8 or ISO-8859-1
Ralph Müller schrieb: Hi all, to store (german) Text in a SQLite Database, is it better to use UTF-8 or is ISO-8859-1 more recommendable? UTF-8. Frank - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] UTF-8 or ISO-8859-1
Hi all, to store (german) Text in a SQLite Database, is it better to use UTF-8 or is ISO-8859-1 more recommendable? Thx in advance 4 help. Cheers! Ralph PS: Please excuse my terrible english. Thx. - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] CREATE TRIGGER IF NOT EXISTS throws error
What version of SQLite are you using? I'm not sure the IF EXISTS option was present until a certain version of 3.x (though I'm not sure which version). Eric Pankoke Founder Point Of Light Software http://www.polsoftware.com/ -Original Message- From: stephan nies [mailto:[EMAIL PROTECTED] Sent: Sunday, March 25, 2007 1:47 PM To: sqlite-users@sqlite.org Subject: [sqlite] CREATE TRIGGER IF NOT EXISTS throws error Hello, when i build a test table with: CREATE TABLE test(a text); and try to implement a trigger using: CREATE TRIGGER IF NOT EXISTS trig_name BEFORE INSERT ON test FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'blabla') WHERE NEW.a = 'pong'; END; I get this error message: SQL error: near "NOT": syntax error if i omit the "IF NOT EXISTS" everything woks fine. According to the Documentation at http://www.sqlite.org/lang_createtrigger.html SQLite should understand this syntax. So what am i doing wrong here? Thanks, Stephan - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] CREATE TRIGGER IF NOT EXISTS throws error
Hello, when i build a test table with: CREATE TABLE test(a text); and try to implement a trigger using: CREATE TRIGGER IF NOT EXISTS trig_name BEFORE INSERT ON test FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'blabla') WHERE NEW.a = 'pong'; END; I get this error message: SQL error: near "NOT": syntax error if i omit the "IF NOT EXISTS" everything woks fine. According to the Documentation at http://www.sqlite.org/lang_createtrigger.html SQLite should understand this syntax. So what am i doing wrong here? Thanks, Stephan
Re: [sqlite] sqlite segfault using libc library
Rich Rattanni wrote: On 3/24/07, John Stanton <[EMAIL PROTECTED]> wrote: Andrew Finkenstadt wrote: > On 3/24/07, John Stanton <[EMAIL PROTECTED]> wrote: > >> >> Compilers do not terminate strings, library functions do. > > > > You are guaranteed by the C standard that the string referred to by > >>> const char message[] = "this string"; > > > is null-terminated by the compiler. > Of course you are correct. However this string is read only and if you use GNU C and try to write to it you get a kick in the head. - To unsubscribe, send email to [EMAIL PROTECTED] - Yes, and I am not writing to it... I am binding a string like message[] to a sqlite query (using sqlite3_bind_text(stmt, bIndex, value, -1, SQLITE_TRANSIENT); ) requesting that SQL count the length of the string, and SQLite apparently calls strlen(). One of the calls to strlen segfaulted. I was wondering if anyone every had this same error. I figure either sqlite made a mistake, or there is a problem with the libc library (this is an ARM arch). If the consensus is that this is libc's problem I will move this discussion to that list. Of course, I guess I could determine if it is libc's fault by replacing the -1 with strlen(message) and seeing if I see the same problem. You had the answer as to how to resolve your problem all along. - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] Re: Store and retreive 0D0A (CRLF) in string field
fangles <[EMAIL PROTECTED]> wrote: When I have text pasted into an sqlite string field, it is stored okay but when I retrieve a string, it is truncated at the first CR (0D). SQLite doesn't truncate anything. Whatever you put in you get out. If you see a truncation, it is either done by whatever wrapper you use on top of SQLite, or simply an artifact of the way you inspect the data (e.g. you look at the string in a debugger, and the debugger just happens to show only the first line). Use sqlite3_column_bytes[16] to convince yourself that SQLite gives you the complete string. Igor Tandetnik - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] Any way to do this faster?
Simplified I have the following situation: 2 tables, tableA and tableB both with an integer field, called ID, holding unique integer numbers in tableA and non-unique integer numbers in tableB. Both tables have an index on this field and for tableA this is an INTEGER PRIMARY KEY. Now I need to delete the rows in tableB where this number doesn't appear in the corresponding field in tableA. Currently I do this with this SQL: Delete from tableB where ID not in (select tableA.ID from tableA) When table tableB gets big (say some 10 rows) this will get a bit slow and I wonder if there is a better way to do this. RBS - To unsubscribe, send email to [EMAIL PROTECTED] -
SV: [sqlite] sqlite and bcc32
I use SQLite 3.1.15 Build 1.0.1911.21749 -Ursprungligt meddelande- Från: stripe [mailto:[EMAIL PROTECTED] Skickat: den 25 mars 2007 10:22 Till: sqlite-users@sqlite.org Ämne: Re: [sqlite] sqlite and bcc32 using sqlite version 3.3.13. .. extern "C" { #include } ... doesn't help :( -- View this message in context: http://www.nabble.com/sqlite-and-bcc32-tf3458305.html#a9658088 Sent from the SQLite mailing list archive at Nabble.com. - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite and bcc32
using sqlite version 3.3.13. ... extern "C" { #include } ... doesn't help :( -- View this message in context: http://www.nabble.com/sqlite-and-bcc32-tf3458305.html#a9658088 Sent from the SQLite mailing list archive at Nabble.com. - To unsubscribe, send email to [EMAIL PROTECTED] -