[sqlite] database exception question

2009-06-29 Thread Wenton Thomas
When executing "pragma integrity_check" ,sqlite will return a error message if there exist something wrong with the database file. Now I wonder what's the max length of the error message? Is it possiable that the length exceeds 255?

Re: [sqlite] database exception question

2009-06-29 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Wenton Thomas wrote: > Now I wonder what's the max length of the error message? > Is it possiable that the length exceeds 255? In theory the message could be up to 2GB in length (eg if generated by a VFS). In practise it is likely to be about a

[sqlite] Database triggers

2009-06-29 Thread Kris Groves
Given the trigger creation statement : CREATE TRIGGER triggername DELETE ON tablename BEGIN statements; END When does it happen ? BEFORE or AFTER ? I've read http://sqlite.org/lang_createtrigger.html, but it is unclear to me. If I had to guess, I would say the trigger is a BEFORE trigger, but

Re: [sqlite] Column headers of result

2009-06-29 Thread Jens Miltner
Am 29.06.2009 um 06:57 schrieb BareFeet: > Hi, > > Is there any way in the command line to get the columns in a query > result? > > For example, given an ad-hoc SQL command, such as: > > begin; > insert into MyTableOrView select * from SomeSource; > select * from MyTableOrView join

[sqlite] View error

2009-06-29 Thread Bruno Carlus
Hi, when I try to execute SELECT num_id_cycle FROM vw_last_cycles_mapping WHERE num_cycle = 10 in a c function it issues a column does not exixt error for num_cycle ... but it works when I execute the same request in the sqlite3 shell ... vw_last_cycles is a view listing the 10 last inserted

Re: [sqlite] Database triggers

2009-06-29 Thread Dan
On Jun 29, 2009, at 2:44 PM, Kris Groves wrote: > Given the trigger creation statement : > CREATE TRIGGER triggername DELETE ON tablename BEGIN statements; END > > When does it happen ? BEFORE or AFTER ? > > I've read http://sqlite.org/lang_createtrigger.html, but it is > unclear to me. If I

Re: [sqlite] Column headers of result

2009-06-29 Thread John Machin
On 29/06/2009 2:57 PM, BareFeet wrote: > Hi, > > Is there any way in the command line to get the columns in a query > result? > > For example, given an ad-hoc SQL command, such as: > > begin; > insert into MyTableOrView select * from SomeSource; > select * from MyTableOrView join

[sqlite] SQL result to struct

2009-06-29 Thread Mark Flipphi
Hello, I need some help with storing the result from a query into a struct. I have a query like : SELECT Echo.Position, Echo.Depth, Echo.dBLevel, Echo.Time, Echo.CommonIdx, Common.ChanNr FROM Echo JOIN Common ON Echo.CommonIdx = Common.CommonIdx ORDER BY Echo.Position ASC and i need to store

Re: [sqlite] Column headers of result

2009-06-29 Thread BareFeet
Thanks Jens and John for your replies. Yes, I am familiar with the "headers on" option. Sorry, I should have mentioned. However, that prepends the headers to the result rows. It would also be ambiguous if a column header contains a pipe or quote or newline (which is unlikely but possible).

Re: [sqlite] Memory leak with sqlite3_exec on qnx 6.4.1

2009-06-29 Thread Greg Morehead
So it seems by best bet is to close and open the connection once every 5 minutes or so? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org]on Behalf Of Kees Nuyt Sent: Friday, June 26, 2009 5:31 PM To: sqlite-users@sqlite.org Subject: Re:

Re: [sqlite] SQL result to struct

2009-06-29 Thread Igor Tandetnik
Mark Flipphi wrote: > I need some help with storing the result from a query into a struct. > > I have a query like : > > SELECT Echo.Position, Echo.Depth, Echo.dBLevel, Echo.Time, > Echo.CommonIdx, Common.ChanNr > FROM Echo JOIN Common ON Echo.CommonIdx = Common.CommonIdx > ORDER BY Echo.Position

Re: [sqlite] Memory leak with sqlite3_exec on qnx 6.4.1

2009-06-29 Thread Greg Morehead
I'm looking specifically at the heap for the process I wrote. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org]on Behalf Of Jay A. Kreibich Sent: Friday, June 26, 2009 5:32 PM To: General Discussion of SQLite Database Subject: Re: [sqlite]

Re: [sqlite] Memory leak with sqlite3_exec on qnx 6.4.1

2009-06-29 Thread Jay A. Kreibich
On Mon, Jun 29, 2009 at 08:10:20AM -0400, Greg Morehead scratched on the wall: > I'm looking specifically at the heap for the process I wrote. Well, that's where it would be -j > -Original Message- > From: sqlite-users-boun...@sqlite.org >

Re: [sqlite] SQL result to struct

2009-06-29 Thread Shaun Seckman (Firaxis)
I also wanted a similar functionality but in the end decided to use a prepared statement w/ sqlite3_column_* methods. My two main reasons were a) it didn't seem like there were any methods to dumping the data to a struct like that and b) I was able to do any sort of validation I desired such as

[sqlite] importing data to sqlite from stdin

2009-06-29 Thread Robert Citek
On occasion I have had a need to import large amounts of data from standard input via a pipe. Here's an example of how to import from a pipe using sqlite3 on Ubuntu: $ { grep -v '^#'

[sqlite] Exact Match Syntax with FTS3?

2009-06-29 Thread Raeldor
Hi All, Does anyone know if there is a syntax in FTS3 to perform an exact match? I couldn't see any examples in the sqlite documentation for this, but I think there are some operators (*) that are not covered in that documentation. Thanks Rael -- View this message in context:

Re: [sqlite] importing data to sqlite from stdin

2009-06-29 Thread Tguru
What you could use is an open source ETL that has connectors with Sqlite. Talend Open Studio is an open source ETL tool for data integration and migration experts. It's easy to learn for a non-technical user. What distinguishes Talend, when it comes to business users, is the tMap component. It

Re: [sqlite] Memory leak with sqlite3_exec on qnx 6.4.1

2009-06-29 Thread Eric Minbiole
> So it seems by best bet is to close and open the connection once every 5 > minutes or so? While this might "work", I don't think you should resort to that. As Kees noted earlier, there will be performance drawbacks if you close/re-open the database. As others have indicated, the heap

Re: [sqlite] Exact Match Syntax with FTS3?

2009-06-29 Thread Scott Hess
On Mon, Jun 29, 2009 at 8:52 AM, Raeldor wrote: > Does anyone know if there is a syntax in FTS3 to perform an exact match?  I > couldn't see any examples in the sqlite documentation for this, but I think > there are some operators (*) that are not covered in that

Re: [sqlite] Comparison of numbers as text

2009-06-29 Thread Tim Largy
>> Can someone explain what is going on in the third select statement >> below? I would have expected it to return a row because the number is >> quoted. >> >> sqlite> select 'foo' where 1 in (1, '2', 'three'); >> foo >> sqlite> select 'foo' where 2 in (1, '2', 'three'); >> sqlite> select 'foo'

Re: [sqlite] importing data to sqlite from stdin

2009-06-29 Thread palmer ristevski
Hi there, This Talend you mentioned caught my eye. Can one use this tool as a general database browser tool. Palmer > Date: Mon, 29 Jun 2009 08:56:58 -0700 > From: g...@talend.com > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] importing data to sqlite from stdin > > > What you could

Re: [sqlite] Exact Match Syntax with FTS3?

2009-06-29 Thread Raeldor
Hi, Thank you for your reply. By exact, I mean "this is a test case" should only be returned as a match if the search term is "this is a test case" and not "test case" or "this is a" or anything such like. I added a simple AND clause as per your suggestion and it seems to work great. It's

Re: [sqlite] Column headers of result

2009-06-29 Thread Simon Slavin
On 29 Jun 2009, at 1:05pm, BareFeet wrote: > How can I get just the column headers without all the result rows? Turn headers on, then perform a search which gives no results. It's difficult in the command-line tool, but easy using function calls since there's a function call specially

Re: [sqlite] Memory leak with sqlite3_exec on qnx 6.4.1

2009-06-29 Thread Simon Slavin
On 29 Jun 2009, at 1:11pm, Greg Morehead wrote: > So it seems by best bet is to close and open the connection once > every 5 minutes or so? No. The library is unlikely to have a leak of that kind in. Are you certain that what you're seeing is a real leak ? If so, the leak may be in

Re: [sqlite] importing data to sqlite from stdin

2009-06-29 Thread Tguru
Hi there! Absolutely, you can manage all of your databases with the same tool. Because of the large amount of connectors with databases, you can work with many databases. These are all the connectors: http://www.talendforge.org/components/index.php pablopico wrote: > > > Hi there, > This

[sqlite] Building sqlite

2009-06-29 Thread Robert Dailey
I'm currently on Windows and I've set up a python script to download the sqlite3 amalgamation. However, the ZIP file contains no build system for sqlite. I had to create a custom CMake script to build sqlite3 into a library. I do not wish to compile the C file with my source, it needs to be a

Re: [sqlite] Building sqlite

2009-06-29 Thread Eric Minbiole
> I'm currently on Windows and I've set up a python script to download the > sqlite3 amalgamation. However, the ZIP file contains no build system for > sqlite. I had to create a custom CMake script to build sqlite3 into a > library. I do not wish to compile the C file with my source, it needs to

Re: [sqlite] Building sqlite

2009-06-29 Thread Robert Dailey
On Mon, Jun 29, 2009 at 12:58 PM, Eric Minbiole wrote: > > I'm currently on Windows and I've set up a python script to download the > > sqlite3 amalgamation. However, the ZIP file contains no build system for > > sqlite. I had to create a custom CMake script to build

Re: [sqlite] Building sqlite

2009-06-29 Thread Doug
You may need SQLITE_THREADSAFE depending on how you're using the library > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Robert Dailey > Sent: Monday, June 29, 2009 1:51 PM > To: General Discussion of SQLite Database >

Re: [sqlite] database exception question

2009-06-29 Thread D. Richard Hipp
On Jun 29, 2009, at 3:13 AM, Wenton Thomas wrote: > When executing "pragma integrity_check" ,sqlite will return a > error message if there exist something wrong > with the database file. > Now I wonder what's the max length of the error message? > Is it possiable that the length

[sqlite] Bug in SQLite 3.6.14 / wrong rowid returned

2009-06-29 Thread Wanadoo Hartwig
Hello, I have posted a while ago a bug (at least I think that it is a bug) but only in a very abstract form. Now, I have written a C-program showing the bug. Brief description: An FTS related trigger combination leads to a wrong determination of the last inserted row id. Triggers that are

Re: [sqlite] Bug in SQLite 3.6.14 / wrong rowid returned

2009-06-29 Thread Wanadoo Hartwig
Hi, actually, I also tested it with 3.6.16 and the bug still exists. Hartwig Am 29.06.2009 um 21:54 schrieb Wanadoo Hartwig: > Hello, > > I have posted a while ago a bug (at least I think that it is a bug) > but only in a very abstract form. Now, I have written a C-program > showing the bug. >

Re: [sqlite] Memory leak with sqlite3_exec on qnx 6.4.1

2009-06-29 Thread Greg Morehead
Thanks Eric, you nailed it on the head! With this parameter I am able to configure the page usage and stop the memory growth where I want it! -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org]on Behalf Of Eric Minbiole Sent: Monday,

Re: [sqlite] Bug in SQLite 3.6.14 / wrong rowid returned

2009-06-29 Thread Simon Slavin
On 29 Jun 2009, at 8:54pm, Wanadoo Hartwig wrote: > I have posted a while ago a bug (at least I think that it is a bug) > but only in a very abstract form. Now, I have written a C-program > showing the bug. I assume that if you type those commands into the sqlite3 command-line tool, you get

[sqlite] Anyway to set initial value of autoincrement primary key to 0?

2009-06-29 Thread Shaun Seckman (Firaxis)
Is there any way to set the initial value for an integer primary key auto-increment column to 0? Currently it always defaults to 1. -Shaun ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Building sqlite

2009-06-29 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Doug wrote: > You may need SQLITE_THREADSAFE depending on how you're using the library SQLITE_THREADSAFE defaults to 1 (meaning that SQLite is fully threadsafe no matter what you do). See http://www.sqlite.org/compile.html IF for some reason you

Re: [sqlite] Bug in SQLite 3.6.14 / wrong rowid returned

2009-06-29 Thread Wanadoo Hartwig
Hi Simon, I am not complaining about the autoincrement's result but that sqlite3_insert_rowid returns the wrong rowid. Hartwig Am 29.06.2009 um 23:09 schrieb Simon Slavin: > > On 29 Jun 2009, at 8:54pm, Wanadoo Hartwig wrote: > >> I have posted a while ago a bug (at least I think that it is

Re: [sqlite] View error

2009-06-29 Thread Kees Nuyt
On Mon, 29 Jun 2009 10:12:25 +0200, Bruno Carlus wrote: >Hi, > >when I try to execute >SELECT num_id_cycle FROM vw_last_cycles_mapping WHERE num_cycle = 10 > >in a c function it issues a column does not exixt error for num_cycle >... but it works when I execute the same

[sqlite] Time format

2009-06-29 Thread Goldstein, Ian
Hello, I am one day into sqlite and have probably a very simple problem involving datetime function. It seems, there is a 4 hour difference between what is in the db and my real time. For example: date;sqlite3 ian.db "select (datetime('now'))" Tue Jun 30 00:05:35 EDT 2009 2009-06-30 04:05:35

Re: [sqlite] Time format

2009-06-29 Thread Harold Wood
try DATE('now','localtime') --- On Tue, 6/30/09, Goldstein, Ian wrote: From: Goldstein, Ian Subject: [sqlite] Time format To: sqlite-users@sqlite.org Date: Tuesday, June 30, 2009, 12:07 AM Hello, I am one day into sqlite and have

[sqlite] Trigger execution sequence/order

2009-06-29 Thread freshie2004-sqlite
Hi All, I was wondering if there was a definite way of determining what sequence or order that triggers are executed in sqlite3. Have searched this list and the internet and the only thing I have found suggested that triggers are executed in alphabetical order, which is wrong. The following

Re: [sqlite] first few characters of varchar() corrupted when SELECTing from a C++ program?

2009-06-29 Thread pierr
uralmazamog wrote: > > Greetings, > > maybe it's just me being stupid, I'll best jump right to the code: > > sqlite3_open_v2( "testdat", sqlDB, SQLITE_OPEN_READWRITE | > SQLITE_OPEN_CREATE, NULL ); > sqlite3_prepare_v2( sqlDB, "SELECT b FROM whee WHERE a='bing';", -1, > sqlStat, NULL ); >

[sqlite] ATTACH Database

2009-06-29 Thread Carlton Guc
ATTACH database I have a unique problem where ATTACH database seems to work fine when I'm using a GUI tool, however when I pass the SQL string to the SQLite engine using SqLiteCommand under .NET, it doesn't seem to work.I get an error saying that D2.Table is not found. SQL String: ATTACH

Re: [sqlite] first few characters of varchar() corrupted when SELECTing from a C++ program?

2009-06-29 Thread freshie2004-sqlite
(Replying to pierr as I joined the list after uralmazamog sent original email) uralmazamog, The code is incomplete. You are not showing us how you are determining what testValue points to. What is returned if you use the following? sqlite3_open_v2( "testdat", sqlDB, SQLITE_OPEN_READWRITE |

Re: [sqlite] Trigger execution sequence/order

2009-06-29 Thread freshie2004-sqlite
I should have looked harder... "The order of arbitrary." http://www.mail-archive.com/sqlite-users@sqlite.org/msg17641.html From: "freshie2004-sql...@yahoo.com.au" To: sqlite-users@sqlite.org Sent: Tuesday, 30 June, 2009

Re: [sqlite] concurrency differences between in-memory and on disk?

2009-06-29 Thread pierr
Igor Tandetnik wrote: > > Daniel Watrous wrote: >> I've developed an application that has very high concurrency. In my >> initial testing we used SQLite 3 from python, but we experienced too >> many locks and the database always fell behind. > > What precisely is the nature of the