[sqlite] Table within a table??

2009-10-30 Thread mark m
I'm very new to database programming so this question is pretty basic I have data that is currently organized as follows: Each case has several fields that contain only one value. There are several fields that have a pipe-delimited string that represents a work history. Each work history

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread Darren Duncan
Roger Binns wrote: >> In fact this support might even be easier as it may only require >> enhancements to >> the SQL parser, which would generate VM opcodes like for a CHECK constraint, >> unless further work is done to optimize for the presented cases, or to >> enhance >> semantics. > > It

Re: [sqlite] Table within a table??

2009-10-30 Thread Darren Duncan
mark m wrote: > I'm very new to database programming so this question is pretty basic > > I have data that is currently organized as follows: > > Each case has several fields that contain only one value. There are several > fields that have a pipe-delimited string > that represents a work

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Darren Duncan wrote: > But on a newer SQLite that implements the stronger typing support I proposed, > when that feature is active then columns with declared types like INTEGER/etc > would enforce that only values of that type are stored there, I

Re: [sqlite] Table within a table??

2009-10-30 Thread mark m
Thanks very much!! It also occurred to me that I could have a Table named "case1" and another named "case1workhist". The RDBMS wouldn't know they were related but my application could be set up to know this. Here is more detail on my current data organization: Open Cases Case 1... Case

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread John Crenshaw
Been watching this discussion go back and forth, and I'd like to weigh in. I'm generally a HUGE fan of strong typing, but this doesn't do it for me. To me, strongly typed means a compiler catches my type mismatches before the app goes out the door. In this case though, no matter what you do, a

Re: [sqlite] How to input a double num?

2009-10-30 Thread John Crenshaw
> May I use sqlite3_bind_double() and sqlite3_prepare_v2() to solve the > problem. That won't fix it. Your number is too large to fit in any native data type. Even the plain math inside your own program won't work right, because the precision of the number is limited at the C level, not the

Re: [sqlite] Some clarification needed about Unicode

2009-10-30 Thread A.J.Millan
- Original Message - From: "John Crenshaw" To: "General Discussion of SQLite Database" Sent: Thursday, October 29, 2009 10:55 PM Subject: Re: [sqlite] Some clarification needed about Unicode >No, I mean which encoding. You can't give

Re: [sqlite] how to get the Trigger's Raise err in Application

2009-10-30 Thread greensparker
jan Thnks fr ur support. I have included sqlite3.h. But getting the following err. 69: undefined reference to`sqlite3_errmsg' :-1: error: collect2: ld returned 1 exit status How to resolve? Thnks Bala -- View this message in context:

Re: [sqlite] Idea for improving page cache

2009-10-30 Thread John Crenshaw
> Just for the sake of discussion I've attached a performance > graph for various C++ data structures plus the Unrolled LL. > The tests where run on a dell vostro 1400 laptop. As you can > see the graphs show the ULL to be quite efficient for > insert/delete from the front/back of the list. I

Re: [sqlite] Some clarification needed about Unicode

2009-10-30 Thread John Crenshaw
> http://codesnipers.com/?q=utf-8-versus-windows-unicode > > The author asset that .NET is the only platform that offer full UTF-16 > support in the Windows API. The author is half mistaken, as was I. Michael Kaplan and Raymond Chen (big MS names many will recognize) clarified this. For Win2k,

Re: [sqlite] problem with inserting non NULL values into sqlite table

2009-10-30 Thread TTTTT
hey! Thank you very much.. i wanted to insert string and i have forgotten about a fact i need to use these quotes ' '.. that has solved the problem... Thank you.. Nataraj, i am using sqlite3_exec function to get error... and yes, call back is one of arguments passed to the function..

Re: [sqlite] How to input a double num?

2009-10-30 Thread liubin liu
Thank you! I mayn't need the high precision like "212345678901234567890123456.988290112". John Crenshaw-2 wrote: > >> May I use sqlite3_bind_double() and sqlite3_prepare_v2() to solve the >> problem. > > That won't fix it. Your number is too large to fit in any native data > type. Even the

Re: [sqlite] SQLite on a Windows Network

2009-10-30 Thread Simon Slavin
On 30 Oct 2009, at 5:47am, mark m wrote: > I have heard problems with SQLite and NFS but I have no idea if a > standard > Windows shared drive uses NFS or not. Am I o.k. to use SQLite??? Standard Windows drive sharing uses SMB, sometimes called SAMBA. NFS is not involved. Simon.

Re: [sqlite] how to get the Trigger's Raise err in Application

2009-10-30 Thread Jan
If your are on windows try this in your .pro file: win32:LIBS += [yourpath]\libsqlite.lib win32:INCLUDEPATH += [yourpath]\include Check Qt docs on qmake for unix. Jan greensparker schrieb: > jan Thnks fr ur support. I have included sqlite3.h. > But getting the following err. > > 69: undefined

Re: [sqlite] [Windows] Good GUI alternative to sqlite.exe?

2009-10-30 Thread Gilles Ganault
On Mon, 26 Oct 2009 15:07:38 -0400, Sam Carleton wrote: >There is a WONDERFUL Firefox plug-in that I use, I love it! I am guessing >it works on all OS's but I use it on Windows Vista and Windows 7. Thanks. I assume it's the SQLite Manager plug-in:

Re: [sqlite] SQLite on a Windows Network

2009-10-30 Thread Gilles Ganault
On Fri, 30 Oct 2009 01:47:33 -0400, mark m wrote: >I have heard problems with SQLite and NFS but I have no idea if a standard >Windows shared drive uses NFS or not. Am I o.k. to use SQLite??? http://www.sqlite.org/cvstrac/wiki?p=SqliteNetwork

Re: [sqlite] SQLite server for Windows/Linux?

2009-10-30 Thread Gilles Ganault
On Mon, 26 Oct 2009 15:10:05 -0400, Reid Thompson wrote: >may be of interest >http://sqlrelay.sourceforge.net/ Thanks for the link. Unfortunately, it doesn't seem to support Windows yet. ___ sqlite-users mailing list

Re: [sqlite] [Windows] Good GUI alternative to sqlite.exe?

2009-10-30 Thread Ted Rolle
On Fri, 30 Oct 2009 13:25:50 +0100 Gilles Ganault wrote: > On Mon, 26 Oct 2009 15:07:38 -0400, Sam Carleton > wrote: > >There is a WONDERFUL Firefox plug-in that I use, I love it! I am > >guessing it works on all OS's but I use it on Windows Vista

Re: [sqlite] how to get the Trigger's Raise err in Application

2009-10-30 Thread greensparker
Im in Debian Linux., This is my pro file QT += sql LIBS +=/usr/lib/libsqlite.so INCLUDE +=/usr/include HEADERS += mainMenu.h SOURCES += main.cpp \ mainMenu.cpp headers in my mainMenu.cpp file #include "mainMenu.h" #include #include "DBConnection.h" #include// path =

Re: [sqlite] how to get the Trigger's Raise err in Application

2009-10-30 Thread Jan
afaik on unix you need this LIBS += -L/usr/lib -llibsqlite greensparker schrieb: > Im in Debian Linux., > This is my pro file > > QT += sql > LIBS +=/usr/lib/libsqlite.so > INCLUDE +=/usr/include > HEADERS += mainMenu.h > SOURCES += main.cpp \ > mainMenu.cpp > > headers in my

[sqlite] BUG: datatypes conversion logic error

2009-10-30 Thread Alexey Pechnikov
Hello! The documentation speak "Datatypes In SQLite Version 3 The dynamic type system of SQLite is backwards compatible with the more common static type systems of other database engines in the sense that SQL statement that work on statically typed databases should would the same way in

Re: [sqlite] how to get the Trigger's Raise err in Application

2009-10-30 Thread greensparker
Jan, my system dont have any file named llibsqlite , in my filesystem but i have /usr/lib/libsqlite.so /usr/lib/libsqlite.so.0 /usr/lib/libsqlite.so.0.8.6 /usr/lib/libsqlite3.so /usr/lib/libsqlite3.so.0.8.6 my pro file have LIBS += /usr/lib/libsqlite.so INCLUDE

Re: [sqlite] Table within a table??

2009-10-30 Thread P Kishor
On Fri, Oct 30, 2009 at 2:41 AM, mark m wrote: > Thanks very much!!  It also occurred to me that I could have a Table named > "case1" and another > named "case1workhist".  The RDBMS wouldn't know they were related but my > application could be > set up to know this. Expand

Re: [sqlite] [Windows] Good GUI alternative to sqlite.exe?

2009-10-30 Thread Sam Carleton
I believe that is the one. It is possible to run the XULRunner app stand alone. Go to the Firefox web site for details on exactly how to do that. What I did was start up Firefox, go to the add-ins, search for SQLite and install it into Firefox. Then in the tools menu there is a link to start

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread P Kishor
I believe I understand Darren's point (whether or not I care for them is another story). On Fri, Oct 30, 2009 at 2:22 AM, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Darren Duncan wrote: >> But on a newer SQLite that implements the stronger

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread Doug Currie
On Oct 30, 2009, at 10:14 AM, P Kishor wrote: > Actually, there can be one bad effect of Darren's suggestion, now that > I think of it, and that would be for those who don't care for strong > typing. They will end up getting strong typing for all non-UNIVERSAL > columns whether they like it or

[sqlite] How to skip the first field on .import

2009-10-30 Thread Ted Rolle
The first field in my table is ID primary integer autoincrement. I read that if it is set to NULL it defaults to the maximum value possible. Not a Good Thing(tm). How do I let this start out at the default value and auto increment? My column separator is '|'. Ted

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread Scott Hess
On Fri, Oct 30, 2009 at 7:14 AM, P Kishor wrote: > Actually, there can be one bad effect of Darren's suggestion, now that > I think of it, and that would be for those who don't care for strong > typing. They will end up getting strong typing for all non-UNIVERSAL > columns

[sqlite] Sqlite Qt problem

2009-10-30 Thread Nataraj S Narayan
Hi I am using sqlite3 from Qt have added a trigger to a table i have setup an Abort message in the trigger My problem is that i am unable to get the message from a qt app, while i am getting an exact message from Ruby language - "db.execute( "insert into param_details (param_code,param_value)

Re: [sqlite] How to skip the first field on .import

2009-10-30 Thread P Kishor
On Fri, Oct 30, 2009 at 9:35 AM, Ted Rolle wrote: > The first field in my table is ID primary integer autoincrement. First, change the above to ID INTEGER PRIMARY KEY > I read that if it is set to NULL it defaults to the maximum value > possible.  Not a Good Thing(tm). I

Re: [sqlite] BUG: datatypes conversion logic error

2009-10-30 Thread Alexey Pechnikov
Hello! $ sqlite3 SQLite version 3.6.19 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> select 1='1'; 0 sqlite> create table test(a text); sqlite> insert into test values (1); sqlite> select * from test where a='1'; 1 sqlite> select * from test where a=1; 1 So 1

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread Simon Slavin
On 30 Oct 2009, at 2:14pm, P Kishor wrote: > Actually, there can be one bad effect of Darren's suggestion, now that > I think of it, and that would be for those who don't care for strong > typing. They will end up getting strong typing for all non-UNIVERSAL > columns whether they like it or not,

Re: [sqlite] BUG: datatypes conversion logic error

2009-10-30 Thread Pavel Ivanov
> So 1 can be equal to '1' and can be not. It's terrible behaviour. Don't use word 'terrible' for things that you don't understand completely. To understand it read once more about SQLite datatypes, affinity and about cases when datatype is changed automatically in expressions:

[sqlite] Does has FTS3 external tokenizers ability now?

2009-10-30 Thread Alexey Pechnikov
Hello! The feature was planning some times ago. Is this released now? Best regards, Alexey Pechnikov. http://pechnikov.tel/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] BUG: datatypes conversion logic error

2009-10-30 Thread Alexey Pechnikov
Hello! On Friday 30 October 2009 18:03:29 Pavel Ivanov wrote: > Don't use word 'terrible' for things that you don't understand > completely. To understand it read once more about SQLite datatypes, > affinity and about cases when datatype is changed automatically in > expressions:

Re: [sqlite] How to skip the first field on .import

2009-10-30 Thread Griggs, Donald
-Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Ted Rolle Sent: Friday, October 30, 2009 10:36 AM To: sqlite-users Subject: [sqlite] How to skip the first field on .import The first field in my table is ID primary integer

Re: [sqlite] BUG: datatypes conversion logic error

2009-10-30 Thread Pavel Ivanov
You think words "SQLite is backwards compatible" describe implementation in some way? If this sentence is removed from the documentation you will be happier and finally read the whole document to understand how SQLite's type system work in details? I agree that this statement can be a bit too

Re: [sqlite] Does has FTS3 external tokenizers ability now?

2009-10-30 Thread Dan Kennedy
On Oct 30, 2009, at 10:07 PM, Alexey Pechnikov wrote: > Hello! > > The feature was planning some times ago. Is this released now? Yes. See the README.tokenizers file in the full source (tar.gz) distribution for docs. Dan. ___ sqlite-users mailing

[sqlite] How to decide which table is the outer table and which table is the inner table?

2009-10-30 Thread Kristoffer Danielsson
Quote from: http://sqlite.phxsoftware.com/forums/p/1495/6629.aspx SQLite uses only nested loops to implement joins. Given a query like the following: SELECT ... FROM OuterTable O INNER JOIN InnerTable I ON O.Id = I.Id SQlite does something like this: for each row in OuterTable Seek

Re: [sqlite] How to decide which table is the outer table and which table is the inner table?

2009-10-30 Thread Pavel Ivanov
Of course SQLite wasn't changed much in this part since November 2008 but the citation you gave is either wrong or the key words in it are "something like" in phrase "SQlite does something like this". Because SQLite is smart enough to choose smaller table as an outer one and bigger table as an

Re: [sqlite] BUG: datatypes conversion logic error

2009-10-30 Thread Alexey Pechnikov
Hello! On Friday 30 October 2009 18:30:26 Pavel Ivanov wrote: > > You think words "SQLite is backwards compatible" describe > implementation in some way? If this sentence is removed from the > documentation you will be happier and finally read the whole document > to understand how SQLite's type

Re: [sqlite] Does has FTS3 external tokenizers ability now?

2009-10-30 Thread Alexey Pechnikov
Hello! On Friday 30 October 2009 18:39:19 Dan Kennedy wrote: > > The feature was planning some times ago. Is this released now? > > Yes. See the README.tokenizers file in the full source (tar.gz) > distribution for docs. I don't find any about creating tokenizer on Tcl or other lang. Is it

Re: [sqlite] How to decide which table is the outer table and whichtable is the inner table?

2009-10-30 Thread Griggs, Donald
Re: How to decide which table is the outer table and whichtable is the inner table? Possibly relevant: http://www.sqlite.org/lang_analyze.html ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread John Crenshaw
> I believe I understand Darren's point (whether or not I care for them > is another story). Yes, you've understood Darren for the most part, but clearly don't understand the objections. > On Fri, Oct 30, 2009 at 2:22 AM, Roger Binns wrote: > > -BEGIN PGP SIGNED

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread Nicolas Williams
On Fri, Oct 30, 2009 at 01:30:31PM -0400, John Crenshaw wrote: +1 I don't think this proposal can or will be accepted. One reasonable idea, perhaps, would to have a pragma that causes subsequent CREATE TABLE statements to get automatically generated CHECK expressions that enforce typing. Any

Re: [sqlite] BUG: datatypes conversion logic error

2009-10-30 Thread Simon Slavin
On 30 Oct 2009, at 4:31pm, Alexey Pechnikov wrote: > The datatype conversion logic is not correct and is not compatible > with > other RDBMS. It is impossible to be compatible with even the three most popular SQL DBMSs. They are not compatible with one-another. I can show you places

Re: [sqlite] How to skip the first field on .import

2009-10-30 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ted Rolle wrote: > How do I let this start out at the default value and auto increment? > My column separator is '|'. Create a temporary table and import into that. Then copy those values into your permanent table using something like: insert

Re: [sqlite] How to decide which table is the outer table and which table is the inner table?

2009-10-30 Thread Simon Slavin
On 30 Oct 2009, at 4:07pm, Kristoffer Danielsson wrote: > "Some database engines like SQL Server decide which table is the > outer table and which table is the inner table" > > > How do I simulate that behavior in SQLite? A misformed SQL statement > from the user results in unacceptable

Re: [sqlite] using EXCEPT with UNION

2009-10-30 Thread mchulet
Thank you sir Igor Tandetnik wrote: > > mchulet wrote: >> Hi, >>Please need your help in figuring out why this Oracle query does not >> work in SQLite : >> (select * from A minus select * from B) union all (select * from B minus >> select * from B) >> >> I tried the same in SQLite: >>

Re: [sqlite] Table within a table??

2009-10-30 Thread Darren Duncan
mark m wrote: > Thanks very much!! It also occurred to me that I could have a Table named > "case1" and another > named "case1workhist". The RDBMS wouldn't know they were related but my > application could be > set up to know this. > > Here is more detail on my current data organization: > >

Re: [sqlite] SQLite on a Windows Network

2009-10-30 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Simon Slavin wrote: > Standard Windows drive sharing uses SMB, sometimes called SAMBA. SMB stands for Server Message Block - the name of the protocol as originally developed by IBM in 1982. The protocol is extensible in that a dialect is negotiated

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread Nicolas Williams
I should add that a pragma that cause CHECK constraints to be automatically created for enforcing strong typing in subsequent CREATE TABLE statements is rather like having FOREIGN KEY clauses automatically generate triggers. There's precedent, in other words, and it is a simple way to implement

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread Darren Duncan
I think that something several people had missed was that I specifically proposed the strong typing behavior to be activated by a new pragma, and unless people activate that pragma they would get the old behavior, so total backwards compatibility. I see several people then proposed using the

Re: [sqlite] How to skip the first field on .import

2009-10-30 Thread Ted Rolle
On Fri, 30 Oct 2009 12:17:53 -0700 Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Ted Rolle wrote: > > How do I let this start out at the default value and auto increment? > > My column separator is '|'. > > Create a temporary table and import

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread Jay A. Kreibich
On Fri, Oct 30, 2009 at 03:19:59PM -0500, Nicolas Williams scratched on the wall: > I should add that a pragma that cause CHECK constraints to be > automatically created for enforcing strong typing in subsequent CREATE > TABLE statements That's tricky. Values have TYPES. Columns have

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread Nicolas Williams
On Fri, Oct 30, 2009 at 03:59:11PM -0500, Jay A. Kreibich wrote: > On Fri, Oct 30, 2009 at 03:19:59PM -0500, Nicolas Williams scratched on the > wall: > > I should add that a pragma that cause CHECK constraints to be > > automatically created for enforcing strong typing in subsequent CREATE > >

Re: [sqlite] BUG: datatypes conversion logic error

2009-10-30 Thread Alexey Pechnikov
Hello! On Friday 30 October 2009 22:16:27 Simon Slavin wrote: > > I think the text '1' must > > be equal to numeric 1 always like to standart de-facto for RDBMS. > > > Personally I think that 1 and 1.0 are the same, and that '1' is never > the same as either. Some people and some languages

Re: [sqlite] How to input a double num?

2009-10-30 Thread Kees Nuyt
On Fri, 30 Oct 2009 02:47:37 -0700 (PDT), liubin liu <7101...@sina.com> wrote: > Thank you! > > I mayn't need the high precision like > "212345678901234567890123456.988290112". Indeed, you don't. In a previous message you said: >> The project is on power-measurement. So there >> are some big

[sqlite] Another SELECT/JOIN Question.

2009-10-30 Thread Peter Haworth
Trying to implement the following situation involving 4 tables Customers is the "master table" in that the results should end up with one row for each primary key value in it. I need to sum the values of a column in the Sales table, which has a column that joins to the primary key of

Re: [sqlite] BUG: datatypes conversion logic error

2009-10-30 Thread Simon Slavin
On 30 Oct 2009, at 9:47pm, Alexey Pechnikov wrote: > Now SQLite think that 1 is equal to '1' in some causes and think > different in other. Just like every other language, once you get into it you have to learn how the language works to understand what's going on. Your problem is not

Re: [sqlite] Another SELECT/JOIN Question.

2009-10-30 Thread Igor Tandetnik
Peter Haworth wrote: > Trying to implement the following situation involving 4 tables > > Customers is the "master table" in that the results should end up with > one row for each primary key value in it. > > I need to sum the values of a column in the Sales table,

[sqlite] Data loss after vacuum

2009-10-30 Thread chen jia
Hi there, I experienced data loss in one my tables after I execute vacuum command from sqlite3. Before I ran vacuum, this table, firmsret11, has 2338120 rows. After I ran vacuum as follows, $ sqlite3 hq.db SQLite version 3.6.10 Enter ".help" for instructions Enter SQL statements terminated with

Re: [sqlite] Data loss after vacuum

2009-10-30 Thread Simon Slavin
On 31 Oct 2009, at 3:22am, chen jia wrote: > Before I ran vacuum, this table, firmsret11, has 2338120 rows. > > After I ran vacuum as follows, > $ sqlite3 hq.db > SQLite version 3.6.10 > Enter ".help" for instructions > Enter SQL statements terminated with a ";" > sqlite> vacuum; > sqlite> .exit

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread Dan Bishop
Darren Duncan wrote: > Roger Binns wrote: > >>> In fact this support might even be easier as it may only require >>> enhancements to >>> the SQL parser, which would generate VM opcodes like for a CHECK >>> constraint, >>> unless further work is done to optimize for the presented cases, or

Re: [sqlite] Table within a table??

2009-10-30 Thread mark m
O.K. I think I am starting to get the idea. It is just so foreign for me to organize things this way. A master work history table for all cases almost seems confusing. It will just take a bit of adjustment for me to "trust" the database way of doing things. Text files organized in the way I