[sqlite] CSV excel import

2015-07-30 Thread Oliver Peters
Sylvain Pointeau writes: > > I understood from the mailing list, that CSV is not a defined format, then > let's propose another format, well defined, the Excel one (which is in my > experience a format to is good every time I had to exchange CSV files). > > Then why don't you propose an

Re: [sqlite] Can't create empty database

2012-06-25 Thread Oliver Peters
Am 25.06.2012 10:01, schrieb L Anderson: Googling on how to create a sqlite database (empty one) it appears I need only do 'sqlite3 test.db'. However, when I try that I get: ->sqlite3 test.db SQLite version 3.7.13 2012-06-11 02:05:22 Enter ".help" for instructions Enter SQL statements

Re: [sqlite] is SQLite the right tool to analyze a 44GB file

2012-05-03 Thread Oliver Peters
Am 03.05.2012 19:59, schrieb peter korinis: I have R but really haven't used it much. I know it's a great stats package and great for data reduction ... but I want to perform queries against my 44GB of data, filtering records by a variety of attributes, comparing those subsets in a variety of ad

Re: [sqlite] is SQLite the right tool to analyze a 44GB file

2012-05-03 Thread Oliver Peters
Am Do 03 Mai 2012 15:35:46 CEST schrieb Warren Young: On 5/1/2012 2:06 PM, peter korinis wrote: Is SQLite the wrong tool for this project? Probably. SQLite is a data storage tool. With enough SQL cleverness, you can turn it into a data *reduction* tool. But a data analysis tool? No, not

Re: [sqlite] is SQLite the right tool to analyze a 44GB file

2012-05-02 Thread Oliver Peters
Am 01.05.2012 22:06, schrieb peter korinis: I'm new to SQLite . not a programmer . not a DBA . just an end-user with no dev support for a pilot project (single user, no updates, just queries). I want to analyze the data contained in a 44GB csv file with 44M rows x 600 columns (fields all<15

Re: [sqlite] sqlite3 command line shell bug?

2012-03-20 Thread Oliver Peters
Am 20.03.2012 21:28, schrieb Baruch Burstein: I just noticed that the dot-commands are tested by the length of the input, not of the correct term. For example, '.e' will match '.exit' (it would also match '.explain', except it matches '.exit' first). Is this intended behavior? And if so, why

Re: [sqlite] GUI for SQLite

2012-03-07 Thread Oliver Peters
Am 07.03.2012 22:47, schrieb Rose, John B: We are new to SQLite and have experimented with a few GUIs, Firefox plugin, SQLite DB Browser, and Navicat. Is there a single GUI that is considered the best, with the most features? I prefer

Re: [sqlite] TEXT PRIMARY KEY

2012-03-02 Thread Oliver Peters
Am 02.03.2012 11:03, schrieb Oliver Peters: sorry I meant CREATE TABLE test( a TEXT PRIMARY KEY ); (without INTEGER, usually I write INTEGER and not TEXT :-) ) Am 02.03.2012 10:44, schrieb Christoph P.U. Kukulies: When defining a column TEXT PRIMARY KEY (is that possible on TEXT?), yes

Re: [sqlite] TEXT PRIMARY KEY

2012-03-02 Thread Oliver Peters
Am 02.03.2012 10:44, schrieb Christoph P.U. Kukulies: When defining a column TEXT PRIMARY KEY (is that possible on TEXT?), yes would this imply uniqueness? yes Or would I have to write something like TEXT PRIMARY KEY UNIQUE ? no and that doesn't make sense I'd say [...] simply

Re: [sqlite] one table versus multiple

2012-02-24 Thread Oliver Peters
Am Fr 24 Feb 2012 13:56:47 CET schrieb Rita: I was wondering if its better to have a single table or multiple tables for something I am doing. I have close to 3 millions rows in a single table and here is how it looks: t,user,price 1330087935,vberry,180.00 1330087935,mson,10.7

Re: [sqlite] Inserts get slower and slower

2012-02-08 Thread Oliver Peters
Am 08.02.2012 23:08, schrieb Steinar Midtskogen: Hello I'm having trouble with one table in my database. When I build my database from scratch using millions of inserts, one table causes problems. Inserts get slower and slower. I have about 830,000 inserts for that table. It gets to 300,000

Re: [sqlite] sqlite-users Digest, Vol 49, Issue 16

2012-01-17 Thread Oliver Peters
Am 17.01.2012 11:20, schrieb Oliver Peters: Am 17.01.2012 10:50, schrieb YAN HONG YE: how to add average value replace the ? to the end of line of this following database: ID name sex match chinese english phy chem total CY001 cred male 104 112 101 85 99 697 CY002 rose female 87 105 98 119 101

Re: [sqlite] sqlite-users Digest, Vol 49, Issue 16

2012-01-17 Thread Oliver Peters
Am 17.01.2012 10:50, schrieb YAN HONG YE: how to add average value replace the ? to the end of line of this following database: ID namesex match chinese english phy chemtotal CY001 credmale104 112 101 85 99 697 CY002 rosefemale 87

Re: [sqlite] sql/tcl script

2012-01-16 Thread Oliver Peters
Am 16.01.2012 20:34, schrieb Bill McCormick: Oliver Peters wrote, On 1/16/2012 1:02 PM: Am 16.01.2012 19:59, schrieb Bill McCormick: James Pearson wrote, On 1/16/2012 12:28 PM: If it's just for setting up databases, tables, etc, why not just use a sql script? Throw all your database object

Re: [sqlite] sql/tcl script

2012-01-16 Thread Oliver Peters
Am 16.01.2012 19:59, schrieb Bill McCormick: James Pearson wrote, On 1/16/2012 12:28 PM: If it's just for setting up databases, tables, etc, why not just use a sql script? Throw all your database object creation sql into a file and then execute that file from within sqlite using the ".read

Re: [sqlite] 3.7.9 Import problem - a test case

2012-01-16 Thread Oliver Peters
) something like - "DELIMITED BY ',' ENCLOSED BY ' " ' ? On Mon, Jan 16, 2012 at 8:32 AM, Oliver Peters<oliver@web.de> wrote: Am 16.01.2012 17:10, schrieb Udi Karni: Simon - thanks - but this used to work on 3.7.7.1 (I believe was the last version I downloaded and unfort

Re: [sqlite] 3.7.9 Import problem - a test case

2012-01-16 Thread Oliver Peters
ng started with sqlite3) Oliver On Mon, Jan 16, 2012 at 8:32 AM, Oliver Peters <oliver@web.de <mailto:oliver@web.de>> wrote: Am 16.01.2012 17:10, schrieb Udi Karni: Simon - thanks - but this used to work on 3.7.7.1 (I believe was the last

Re: [sqlite] 3.7.9 Import problem - a test case

2012-01-16 Thread Oliver Peters
Am 16.01.2012 17:10, schrieb Udi Karni: Simon - thanks - but this used to work on 3.7.7.1 (I believe was the last version I downloaded and unfortunately replaced with the latest...) afaik this never worked with the original CLI (might be that you have used a fork that can do this) I see 3

Re: [sqlite] Database Diagram

2011-12-06 Thread Oliver Peters
Am Dienstag, den 06.12.2011, 04:45 -0800 schrieb priya786: > Hello i want to know how to get the database diagram from sqlite.Please tell > me the solution.Thanks in Advance. for ER diagrams i.e. - dia (http://live.gnome.org/Dia, linux and ms) - yED

Re: [sqlite] Compute percentage?

2011-06-29 Thread Oliver Peters
Oliver Peters <oliver.pet@...> writes: I definitely need glasses for my glasses AS cnt_all_people belongs after COUNT(zip) so this is correct SELECT a.zip, a.cnt_people_in_town, b.cnt_all_people ( SELECT zip, COUNT(zip) AS cnt_people_in_town FROM people GROUP BY zip ) a CROSS JOIN (

Re: [sqlite] Compute percentage?

2011-06-29 Thread Oliver Peters
Gilles Ganault writes: SELECT a.zip, a.cnt_people_in_town, b.cnt_all_people ( SELECT zip, COUNT(zip) AS cnt_people_in_town FROM people GROUP BY zip ) a CROSS JOIN ( SELECT COUNT(zip) FROM people AS cnt_all_people ) b ; percent for you greetings oliver

Re: [sqlite] sqlitebrowser - anyone compiled a recent one?

2011-06-09 Thread Oliver Peters
Christoph P.U. Kukulies writes: [...] > > Thanks. I was prepared to receive alternate suggestions :) > I wanted to have hands on and control over a browser with which > can follow sqlite versions quicker. > > Sqlitebrowsers tend to lag behind the Sqlite development. > > Is the one

Re: [sqlite] sqlitebrowser - anyone compiled a recent one?

2011-06-09 Thread Oliver Peters
Christoph P.U. Kukulies writes: > > I tried sqlitebrowser 2.0 b1.exe from Sourceforge (the Windows binary) > on some newer > sqlite databases 3.7 or sth. and it could not open it. > [...] If you don't insist to use sqlitebrowser I can recommend sqlitespy

Re: [sqlite] Better way to get records by IDs

2011-05-20 Thread Oliver Peters
jose isaias cabrera writes: > > > Greetings. > > I would like to get a bunch of records of IDs that I already know. For > example, this table called Jobs, > rec,...,data,... > 1,...,aaa,... > 2,...,zzz,... > ... > ... > 99,...,azz,... > [...] What about SELECT * FROM table

Re: [sqlite] Request for help with SQLite Query to return missing Date/Time Ranges

2011-04-21 Thread Oliver Peters
Andrew Lindsay writes: [...] > I am trying to search an SQL database that is meant to have entries logged > every minute for a period of approximately 15 months. > > I want to create a query that will search through the database and tell me > for which periods I do not have

Re: [sqlite] SQLite version 3.7.6

2011-04-12 Thread Oliver Peters
writes: > > SQLite version 3.7.6 is not available from the website: > http://www.sqlite.org/ [...] really not ;-) ? Please don't disappoint your followers. greetings Oliver ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Need help

2011-03-31 Thread Oliver Peters
Igor Tandetnik writes: > > Balasubramani Vivekkanandan wrote: > >I am very new database development and sqlite. I have a requirement > > where I want to restrict the size of my integer primary key to 3 bytes. > > In my database, entries will be added and

Re: [sqlite] Need help

2011-03-31 Thread Oliver Peters
Igor Tandetnik writes: > > Balasubramani Vivekkanandan wrote: > >I am very new database development and sqlite. I have a requirement > > where I want to restrict the size of my integer primary key to 3 bytes. > > In my database, entries will be added and

Re: [sqlite] INSERT INTO SQLite from a FixedLength text file

2011-03-30 Thread Oliver Peters
writes: > > > If we import the same text file into a MS Access database using INSERT INTO MDE SELECT * FROM > > [Text;Database=C:\\folder].[filename.txt], it takes about a minute and half but because SQLite does > not support that, I have to > > use the insert into statement for

Re: [sqlite] INSERT INTO SQLite from a FixedLength text file

2011-03-30 Thread Oliver Peters
writes: > > > Thank you for the responses. > If we import the same text file into a MS Access database using INSERT INTO MDE SELECT * FROM > [Text;Database=C:\\folder].[filename.txt], it takes about a minute and half but because SQLite does > not support that, I have to use the

Re: [sqlite] INSERT INTO SQLite from a FixedLength text file

2011-03-30 Thread Oliver Peters
writes: > > I know you can insert into MS Access from a FixedLength text file using schema.ini with this: > INSERT INTO MDE SELECT * FROM [Text;Database=C:\\folder].[filename.txt] > > Is this supported in SQLite. I have tried many syntax and getting syntax error. I am not sure if

Re: [sqlite] connect to sqlite using OLE-DB or ODBC

2011-03-28 Thread Oliver Peters
Andi Suhandi writes: > > Hi guys, > > I am a newbie in sqlite. Is it possible to connect sqlite db using > OLE-DB or ODBC ? > If possible, what do i need ? > for ODBC (M$,Linux,Mac) go to http://www.ch-werner.de/sqliteodbc/ greetings oliver

Re: [sqlite] Capitalisation

2011-03-25 Thread Oliver Peters
J Trahair writes: [...] > SELECT * FROM Customers WHERE CustomerCode = 'tra001' > that is, with tra001 in > lower case, SQLite *does not find the record*. [...] use LIKE (http://www.sqlite.org/lang_expr.html#like) SELECT * FROM Customers WHERE CustomerCode LIKE 'tra001'

[sqlite] DELETE and alias

2011-03-15 Thread Oliver Peters
Hello, I tried the following with the CLI (3.7.5 under WinXP): CREATE TABLE a( id INTEGER PRIMARY KEY AUTOINCREMENT, sometext TEXT); INSERT INTO "a" VALUES(1,'hannes'); INSERT INTO "a" VALUES(2,'walther'); INSERT INTO "a" VALUES(3,'homer'); CREATE TABLE b( id INTEGER PRIMARY KEY); INSERT INTO

Re: [sqlite] how to get a reliable Integer from a Real?

2011-02-02 Thread Oliver Peters
Charles Samuels <charles@...> writes: > > On Wednesday, February 02, 2011 11:06:59 am Drake Wilson wrote: > > Quoth Oliver Peters <oliver.pet@...>, on 2011-02-02 18:25:04 +: > > > I'm on Win XP with sqlite 3.7.5 and trying to get cents from euro but

Re: [sqlite] how to get a reliable Integer from a Real?

2011-02-02 Thread Oliver Peters
Igor Tandetnik <itandetnik@...> writes: > > On 2/2/2011 1:25 PM, Oliver Peters wrote: > > sqlite> SELECT CAST(2.3*100 AS INTEGER); > > 229<- S T R A N G E result > > select cast(round(2.3*100) as integer); > I knew you know it. thx a lot you're still

[sqlite] how to get a reliable Integer from a Real?

2011-02-02 Thread Oliver Peters
Hello, I'm on Win XP with sqlite 3.7.5 and trying to get cents from euro but sometimes I get a strange result: SQLite version 3.7.5 Enter ".help" for instructions Enter SQL statements terminated with a " sqlite> SELECT CAST(2.1*100 AS INTEGER); 210 sqlite> SELECT CAST(2.2*100 AS INTEGER); 220

[sqlite] sqlite3 version 3.7.5: documentation of the "-heap" option

2011-01-31 Thread Oliver Peters
in the 3.7.5 releaselog (http://sqlite.org/releaselog/3_7_5.html) it is written that the "-heap" option was added to the CLI but if I follow http://sqlite.org/sqlite.html there is no further explanation. calling doesn't uncover information about this option too Oliver

Re: [sqlite] long running INSERT (up to now ~ 11 hours and still working)

2011-01-12 Thread Oliver Peters
Hello, [...] deleting PRAGMA foreign_keys = ON; led to a miracle: everything completed after 30 minutes. Because of the enormous difference (~ 24h without finish compared to 30 minutes) I can imagine that there are ways to otimize the speed with the use of FKs - but that seems to be a

Re: [sqlite] long running INSERT (up to now ~ 11 hours and still working)

2011-01-12 Thread Oliver Peters
Dan Kennedy writes: [...] > > > > Most INSERTS are done into the table Verteilerdaten (>10,000,000). > > I think the time depends heavily on the activated FOREIGN KEYs - is > > my assumption correct and is this a behaviour I only can avoid by not > > switching this PRAGMA on?

Re: [sqlite] long running INSERT (up to now ~ 11 hours and still working)

2011-01-11 Thread Oliver Peters
Hello, Simon Slavin writes: > >[...] > > It that takes 11 hours, that means you're taking about 4ms per INSERT. I don't know if this is unusually high. > You might like to try 'PRAGMA synchronous = OFF' > > > > > sqlite3

[sqlite] long running INSERT (up to now ~ 11 hours and still working)

2011-01-11 Thread Oliver Peters
Hello, I'm on WinXP and using sqlite 3.7.4 with the CLI. I try to insert ~ 10,100,000 records into a schema with different tables (http://pastebin.com/cbsPHNEj). The db file has already 1.9 GB when I start the INSERTs via sqlite3 -bail extra.db3 < inserts.sql The statements in inserts.sql look

Re: [sqlite] Trigger and reference to temporary table - incomplete documentation?

2010-12-06 Thread Oliver Peters
Am Montag, den 06.12.2010, 22:13 + schrieb Simon Slavin: > On 6 Dec 2010, at 10:00pm, Oliver Peters wrote: > > > [...] > > > >> The wording is not completely correct indeed. > >> In general, views, triggers, and foreign key constraints can only >

Re: [sqlite] Trigger and reference to temporary table - incomplete documentation?

2010-12-06 Thread Oliver Peters
[...] > The wording is not completely correct indeed. > In general, views, triggers, and foreign key constraints can only > use objects within the same schema (=database). > > That makes sense, because SQLite (and you) cannot guarantee the > other database file is attached when the view is

[sqlite] Trigger and reference to temporary table - incomplete documentation?

2010-12-06 Thread Oliver Peters
Hello, I've tried to create this trigger: -- CREATE TRIGGER log_DELETE_staff AFTER DELETE ON staff FOR EACH ROW BEGIN INSERT INTO

Re: [sqlite] import and convert table to schema?

2010-11-26 Thread Oliver Peters
Wouter Overmeire writes: [...] > If I compare the speed of doing this for one file to an import statement in sqlite itself there is a big > difference, '.import' is much faster [...] Use transactions like this (will be much faster): BEGIN TRANSACTION; INSERT ; INSERT ;

Re: [sqlite] change sqlite table column type

2010-11-15 Thread Oliver Peters
Jay A. Kreibich writes: [...] > > You can also live dangerously and set "PRAGMA writable_schema=1", > allowing you to UPDATE the sqlite_master table directly. > >-j > is this PRAGMA documented? Can't find it here http://www.sqlite.org/pragma.html What do I achieve by

Re: [sqlite] change sqlite table column type

2010-11-15 Thread Oliver Peters
lizhe writes: > > > Dear Sir: > I have a table type is blob,I think update integer type, > How to solve my trouble? "alter" SQL? [...] use the CLI (sqlite3) and your favourite editor: sqlite3 yourdatabase .output file.sql .dump .q edit file.sql sqlite3 yournewdatabase <

Re: [sqlite] Pulling records within a certain date range

2010-11-01 Thread Oliver Peters
J. Bobby Lopez writes: [...] > I'm having some trouble understanding how I would pull records within a > specific date range (last five days for example). [...] a little prototyping: SELECT yourfield01, yourfield02,... FROM yourtable WHERE julianday('now', '-6days') <

Re: [sqlite] gui for data entry

2010-10-12 Thread Oliver Peters
Graham Smith writes: [...] > Mmmm, still stuck on 3.2.1 with current release of Ubuntu (the OS I > use most of the time, followed by my Mac), so interesting to hear your > views on 3.2.1. > I use OOo under WinXP and had a problem related to 3.2.1 in connection with UNIQUE

Re: [sqlite] gui for data entry

2010-10-12 Thread Oliver Peters
ahh I forgot: the best is to take OOo 330 m9 that is a milestone without all former illnesses - believe me I suffered a lot D o n' t use 3.2.1!!! Oliver ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] gui for data entry

2010-10-12 Thread Oliver Peters
Graham Smith writes: [...] > > Thanks, I did consider this, but the last time I tried, it was very > clunky, and crashed a lot, but I will have another look since you > have suggested it. [...] works fine now but take the latest odbc driver from here:

Re: [sqlite] gui for data entry

2010-10-12 Thread Oliver Peters
Graham Smith writes: > > There are several GUI editors for SQLite, but is there one that allows > creation of simple forms to allow data entry. Although some allow > adding data to a single table, none that I have looked at seem to > allow a new record to be added when it

Re: [sqlite] String field as primarykey

2010-10-12 Thread Oliver Peters
Durga D writes: [...] > But performance issue is there. > > Is there anyway to optimize this? > maybe you should try PRAGMA journal_mode = OFF; Oliver ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] how do I load a csv file or what is the simplest text file to load into sqlite3?

2010-10-08 Thread Oliver Peters
joshua wojnas writes: > > how do I load a csv file or what is the simplest text file to load > into sqlite3? 1. sqlite3 yoursqlitedatabasename 2. .import yourtextfile yourtablename (see .h for documentation) ready but what you need is: - an existing sqlitedb (step1 already

Re: [sqlite] Accented characters and ODBC

2010-10-01 Thread Oliver Peters
Greg Bryant writes: just saw that you usually should install 3 different ODBC-drivers and 1 of them is called SQLite ODBC (UTF-8) Driver. Maybe you should give it a try before asking the programmer greetings ___ sqlite-users

Re: [sqlite] Accented characters and ODBC

2010-10-01 Thread Oliver Peters
Greg Bryant writes: [...] > Does anyone have any pointers on where I can look to figure > this out? [...] maybe the friendly driver programmer is willing to help you if you send a bug report http://www.ch-werner.de/sqliteodbc/html/index.html greetings Oliver

Re: [sqlite] Need help with self-join (I think)

2010-09-25 Thread Oliver Peters
Igor Tandetnik writes: [..] > > See how you like this one: > > select * > from (select distinct year from Test) as AllYears > join (select distinct name from Test) as AllNames > left join Test t on (t.year=AllYears.Year and t.name=AllNames.name) > left join

Re: [sqlite] Need help with self-join (I think)

2010-09-24 Thread Oliver Peters
Am 25.09.2010 01:47, schrieb Kristoffer Danielsson: [...] > > Because, given a certain algorithm, generating statistics will become a lot > easier if each value combination is represented in the returned row set. > really? NULL means there are no values present or there are unknown values -

Re: [sqlite] Need help with self-join (I think)

2010-09-24 Thread Oliver Peters
Kristoffer Danielsson writes: > > > Ah, this one's easier to follow. What do you mean by "in this case"? What was the condition that made it the point was not to remove something but to take into consideration that there has to be a JOIN on the TestIDs (in this case

Re: [sqlite] Need help with self-join (I think)

2010-09-24 Thread Oliver Peters
sry, a little mistake - here's the correction: SELECT DISTINCT t.Year, b.Name, (SELECT SomeValue FROM Test INNER JOIN Test2 WHERE Year = t.Year AND Name = b.Name) AS SomeValue FROM Test t CROSS JOIN (SELECT DISTINCT Name FROM Test) b ; (results don't differ - in this case!) Oliver

Re: [sqlite] Need help with self-join (I think)

2010-09-24 Thread Oliver Peters
Kristoffer Danielsson writes: SELECT DISTINCT t.Year, b.Name, CASE WHEN (SELECT TestID FROM Test WHERE Year = t.Year AND Name = b.Name) IS NULL THEN NULL ELSE (SELECT SomeValue FROM Test2) END AS SomeValue FROM Test t CROSS JOIN (SELECT DISTINCT Name FROM Test) b ;

Re: [sqlite] Query to compare two sqlite databases

2010-09-24 Thread Oliver Peters
Oliver Peters <oliver@...> writes: sry > > the result is what is not in table01 > I meant: the result is what is in table01 but NOT in table02 Oliver ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.o

Re: [sqlite] Query to compare two sqlite databases

2010-09-24 Thread Oliver Peters
Am 24.09.2010 20:41, schrieb John Reed: > Hello, > > I compare an application every few days which has sqlite as it's client > database. > I look at the content and check whether documents have made it into the > application after it has been built. I also check the metadata in the sqlite >

Re: [sqlite] VACUUM can actually increase the DB file?

2010-09-21 Thread Oliver Peters
[...] > Can you please run sqlite3_analyzer [...] on both > the original database and the database after VACUUM > and send me the output? done, send 2 txt-files greetings Oliver ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] what could be the reason that natural join stops working ?

2010-09-14 Thread Oliver Peters
your version of sqlite? your OS? your backend? What exactly have you done before the Natural Join stopped working? Oliver Am Dienstag, den 14.09.2010, 23:41 +0200 schrieb Stef Mientki: > hello, > > after modifying some tables, natural join stopped working ??? > > I've 2 tables, each with a

[sqlite] documentation errors

2010-09-14 Thread Oliver Peters
doubled words - http://www.sqlite.org/lang_createtrigger.html "occurs on on one or more specified columns of a table." needless round bracket -- http://www.sqlite.org/lang_conflict.html " ( IGNORE " Oliver ___

Re: [sqlite] Increment counter or insert row in one statement

2010-09-07 Thread Oliver Peters
Simon Slavin writes: > > This is the last message I'm sending to you. > slow down - life can be so easy http://www.youtube.com/watch?v=bf3ohrAIetg greetings Oliver ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Stitching together Text Files into a New Database

2010-08-25 Thread Oliver Peters
Lorenzo Isella writes: [...] if you've no idea where a db can help you and if you don't have time to investigate this and the possibilities a db offers you my suggestion is: import your 3 or 5 files into a spreadsheet, add a column for your different campaign and that's it

Re: [sqlite] rowid column as a FOREIGN KEY

2010-08-23 Thread Oliver Peters
Pavel Ivanov writes: > > > I can't understand why is it a bad practice to use database-provided >>features? > > You can use it when you are selecting. And even in this case you > should use caution because without explicit column declared by you > SQLite can change rowids without

Re: [sqlite] rowid column as a FOREIGN KEY

2010-08-23 Thread Oliver Peters
inst writes: > > Do anyone encounter this problem or I just did something wrong? > If you've an example (CREATE & INSERT/DELETE statements or whatever clarifies what you do) the possibility that someone can give you a quick and meaningful answer will increase enormous. My

Re: [sqlite] .import FILE TABLE

2010-08-11 Thread Oliver Peters
Larry Siden writes: > > What is the format of the file? I cannot find it documented anywhere. It is a csv file with the same fields in the same order as your table has. You can set the separator of the csv this way .separator \t (\t == tab, default is |) Oliver

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Oliver Peters
Igor Tandetnik writes: [...] > > Why would you want to fail statements that end up not violating any > constraints? The idea is to prevent that somebody can change the table staff that is not already in the table. Therefore I create the first user by not switching on foreign

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Oliver Peters
Dan Kennedy writes: > > > why returns the "INSERT INTO a" not an error while the "INSERT INTO > > b" does? How > > corresponds this behaviour to the concept of FOREIGN KEYS? > > > CREATE TABLE a( > >idINTEGER PRIMARY > >

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Oliver Peters
[...] To my mind the simplified question is: why returns the "INSERT INTO a" not an error while the "INSERT INTO b" does? How corresponds this behaviour to the concept of FOREIGN KEYS? I wrote the code into file.sql (encoding=utf8, if this matters) and started sqlite3 -bail test.db3 <

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Oliver Peters
I use the standard windows binary from http://www.sqlite.org/sqlite-3_7_0_1.zip and if I do the recommended test I get >sqlite3 SQLite version 3.7.0.1 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> pragma foreign_keys; 0 sqlite> pragma foreign_keys=ON; sqlite>

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Oliver Peters
Igor Tandetnik <itandet...@...> writes: > > Oliver Peters <oliver@...> wrote: > > This sql code works in the two cases but AFAIK it shouldn't in the second > > > > PRAGMA foreign_keys = ON; > > > > CREATE TABLE staff_02( > > id

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Oliver Peters
and the added , after UNIQUE(code) doesn't change anything (oh what a day ;-) ) Oliver ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Oliver Peters
This sql code works in the two cases but AFAIK ;-) it shouldn't in the second Am I right? CREATE TABLE staff_01( idINTEGER PRIMARY KEY AUTOINCREMENT, id_staff_editor INTEGER NOT NULL,

Re: [sqlite] foreign key error 01

2010-08-09 Thread Oliver Peters
Oliver Peters <oliver@...> writes: sorry, my FK-clause was wrong (forgot the _01 & 0_2) my mistake (but the next thread will show the true error) Oliver ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-b

[sqlite] foreign key error 01

2010-08-09 Thread Oliver Peters
Hello environment --- OS : Win XP (every patch) sqlite : 3.7.0.1 reproduction CREATE TABLE staff_01( idINTEGER PRIMARY KEY AUTOINCREMENT, id_staff_editor

Re: [sqlite] sqlite3-dbf - converter of XBase / FoxPro tables to SQLite

2010-08-06 Thread Oliver Peters
Alexey Pechnikov writes: > > This is not tested enough but it's work for me. May be it's > interesting for somebody. > > http://sqlite.mobigroup.ru/wiki?name=sqlite3-dbf > I'm only a heavy user (!= programmer) so if you have an extension for directly importing dbf-files into

Re: [sqlite] Inserting a large amount of data into a large indexed table

2010-08-03 Thread Oliver Peters
Am Dienstag, den 03.08.2010, 23:24 +0100 schrieb Paul Sanderson: [...] > I want the process to be as quiick as > possible (although I know it will take minutes). The process at the > moment is to drop the indexes, add the new rows and then reindex. > > Is this the best/fastest way of achieving

Re: [sqlite] How to select an entry that appears l t;=n times and only show n times if it appears mor e than n times?

2010-07-02 Thread Oliver Peters
o.k., got it - next time I'll read twice (at least ;-) ) ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How to select an entry that appears =n times and only show n times if it appears more th an n times?

2010-07-02 Thread Oliver Peters
Peng Yu writes: > > Hi, > > SELECT DISTINCT type_id FROM foods; > > If I use 'distinct', any entry that shows up greater or equal to one > time will only appear once. But I want to select an entry that appears > <=n times and only show n times if it appears more than n times. I

Re: [sqlite] alternative to UNIQUE CONSTRAINT

2010-06-30 Thread Oliver Peters
Pavel Ivanov writes: [...] > You should say at this point "That has to be an error in > OpenOffice", go find some OpenOffice bug tracker or OpenOffice-related > discussion list and bring this issue to their attention. [...] all people interested in solving this bug will find a

Re: [sqlite] alternative to UNIQUE CONSTRAINT

2010-06-29 Thread Oliver Peters
Darren Duncan writes: [...] > > Try making all of your column definitions NOT NULL and see if that makes any > difference. That is, see if this works: > > CREATE TABLE wasdoesntwork( > idINTEGER PRIMARY KEY AUTOINCREMENT, > someint INTEGER NOT NULL,

Re: [sqlite] alternative to UNIQUE CONSTRAINT

2010-06-28 Thread Oliver Peters
Pavel Ivanov writes: [...] > And as no one experienced problems like yours before then I guess we > can switch contexts and now "frontend" will mean the app that uses > this ODBC driver (probably you use it through some wrapper or > something else is standing in the way). o.k. -

Re: [sqlite] alternative to UNIQUE CONSTRAINT

2010-06-28 Thread Oliver Peters
Israel Lins Albuquerque writes: > > > maybe this works for you! > > http://www.patthoyts.tk/sqlite3odbc.html in the first sentence he writes: go to http://www.ch-werner.de/sqliteodbc/ -> outdated >

Re: [sqlite] alternative to UNIQUE CONSTRAINT

2010-06-28 Thread Oliver Peters
Pavel Ivanov writes: [...] > > If your ODBC driver doesn't allow you to have any UNIQUE constraint > then, as Darren said, you better consider using some other driver, not > a workaround for this one. I believe there are several ODBC drivers > for SQLite out there. > I strongly

Re: [sqlite] alternative to UNIQUE CONSTRAINT

2010-06-28 Thread Oliver Peters
Pavel Ivanov writes: > > > there are no NULLS in my example and I don't believe in a frontend-problem > > (I > > wouldn't interpret the SQL.LOG this way). > > If you don't believe that it's your frontend problem then go ahead and > reproduce it in sqlite3 command line utility.

Re: [sqlite] alternative to UNIQUE CONSTRAINT

2010-06-28 Thread Oliver Peters
Tim Romano writes: > > Could there be an issue with the character-encoding of the text column? > Regards > Tim Romano > Swarthmore PA > [...] I don't see this as a possibility because: 1. my encoding is utf-8 2. the simple example

Re: [sqlite] alternative to UNIQUE CONSTRAINT

2010-06-28 Thread Oliver Peters
Darren Duncan writes: [...] > What efforts have you made in trying to fix the front-end instead? > Nothing because I'm not a programmer but I reduced complexity: example_01: -- CREATE TABLE doesntwork( idINTEGER PRIMARY KEY AUTOINCREMENT, someint

Re: [sqlite] alternative to UNIQUE CONSTRAINT

2010-06-25 Thread Oliver Peters
Igor Tandetnik writes: [...] > Isn't that exactly what you were asking for - a different syntax to achieve the same end result? Not really because the assumed ODBC-Driver problem has nothing to do with the syntax but the underlying mechanism (sounds logically for me ;-) )

Re: [sqlite] alternative to UNIQUE CONSTRAINT

2010-06-25 Thread Oliver Peters
Igor Tandetnik writes: [...] > CREATE UNIQUE INDEX, perhaps? I already thought about it but where's the difference between solution 1 -- CREATE TABLE example( a INTEGER PRIMARY KEY AUTOINCREMENT b TEXTNOT NULL, c INTEGER NOT NULL UNIQUE -- or

[sqlite] alternative to UNIQUE CONSTRAINT

2010-06-25 Thread Oliver Peters
Hello, I can't use UNIQUE CONSTRAINTs because of strange behaviour in my frontend (reason is assumably in the ODBC-driver). The PK is already used for an autoincrement column. Is there another way to enforce UNIQUE CONSTRAINTs despite INSERT/UPDATE triggers? I'd prefer CHECK-CONSTRAINTs but

Re: [sqlite] Updating specific rows in a table

2010-06-23 Thread Oliver Peters
Erik Wright writes: > (2) Update the old table (t1) using this expression: > UPDATE OR REPLACE t1 SET f1 = (SELECT f1 FROM t2 WHERE t2.row = t1.row) WHERE t1.row IN (SELECT row FROM t2) 1. I dont think that "WHERE t1.row IN (SELECT row FROM t2)" is necessary 2. maybe you

Re: [sqlite] Avoiding Out Of Office Auto Reply To Group

2010-06-23 Thread Oliver Peters
Richard Hipp writes: [...] > > There are 2500+ people on this mailing list. In an effort to keep down > noise, I immediately unsubscribe any user from whom I receive an > out-of-office auto-reply. This policy may seem harsh, but if we don't > maintain tight control of auto-replies,

Re: [sqlite] database development - correct way?

2010-06-09 Thread Oliver Peters
Rich Shepard <rshep...@...> writes: > > On Wed, 9 Jun 2010, Oliver Peters wrote: > > > So I assume that it is not(!) a mistake not(!) to use a composite PK in my > > table "customer" (customernumber,customerorigin) and to refer to it from > > the ta

Re: [sqlite] database development - correct way?

2010-06-09 Thread Oliver Peters
Adam DeVita writes: > > I wouldn't advise using an SQL keyword as a table name: "Order" > > I presume that your order collection table example is shorter than the real > one for the sake of the example? [...] yes - and the content has nothing to do with my real tables. The

  1   2   >