[sqlite] sqlite and referential integrity

2008-07-25 Thread Alessio Forconi
Hello to everyone, I planning to start using sqlite but first I have a question, sqlite supporting the referential integrity as access? Excuse for my bad english Thanks a lot -- Alessio Forconi ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Corrupted database repairing

2008-07-25 Thread Alexey Pechnikov
В сообщении от Friday 25 July 2008 03:40:22 Roger Binns написал(а): Alexey Pechnikov wrote: Is any way to repair corrupted database? From a theoretical point of view the only way to repair a corrupted database is if there are multiple redundant copies of data or of generating that data.

Re: [sqlite] Loading from Read Only storage and saving changes to a separate storage unit

2008-07-25 Thread Alexey Pechnikov
В сообщении от Thursday 24 July 2008 22:00:45 Brown, Daniel написал(а): Morning List, Another morning another question, what sort of facilities does SQLite provide for Loading from a read only storage location and then saving changes to a separate read/write storage unit? I know I can open a

Re: [sqlite] Hard time with blobs

2008-07-25 Thread Dan
On Jul 25, 2008, at 12:05 PM, Sherief N. Farouk wrote: I'm having a problem with the last parameter, the function used to dispose of the blob. Does sqlite defer actually inserting the blob into the database somehow? In other words, will I get into trouble if I do:

Re: [sqlite] Hard time with blobs

2008-07-25 Thread Sherief N. Farouk
That will make this case legal. What's the general behavior though? Is it not guaranteed to be consumed during the call to bind_blob? In other words, without providing SQLITE_TRANSIENT, can I get into trouble with this? - Sherief -Original Message- From: [EMAIL PROTECTED]

Re: [sqlite] Corrupted database repairing

2008-07-25 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alexey Pechnikov wrote: May be on FS layer? I specifically said VFS which is SQLite functionality - see http://www.sqlite.org/c3ref/vfs.html and http://www.sqlite.org/c3ref/io_methods.html Which FS can help me for this? I'm using ext3 FS now on

[sqlite] Performance of JOIN

2008-07-25 Thread Salvatore Iovene
Hello, I have a table like this: INT id TEXT t1 TEXT t2 For a lot of rows the pair (t1,t2) is the same, so, in order to save space, it would be better to have two tables like: INT id INT pair_id and INT id TEXT t1 TEXT t2 But, in my case, speed is more importan than disk space, and if I did

Re: [sqlite] Corrupted database repairing

2008-07-25 Thread Alexey Pechnikov
В сообщении от Friday 25 July 2008 12:16:39 Roger Binns написал(а): Alexey Pechnikov wrote: May be on FS layer? I specifically said VFS which is SQLite functionality - see http://www.sqlite.org/c3ref/vfs.html and http://www.sqlite.org/c3ref/io_methods.html Thanks, last link may be helpful

[sqlite] Sqlite 3.6.0 across dll

2008-07-25 Thread Jacek Oleksy
Hello, I'm using VC++.NET 2003 Windows XP SP2. I have following problem with version 3.6.0: sqlite configuration is being hold in a global variable sqlite3Config. My application uses a dll, which initializes sqlite database. Dll's copy of the sqlite3Config variable is initialized properly and

Re: [sqlite] Sqlite 3.6.0 across dll

2008-07-25 Thread Roberto
You need to clarify what you mean by 'module'. Data is not shared in DLL's (sperate memory space and all that..), each calling application will need their own copy of data initialized by a shared library. If you have a global variable in a dll and need to share this data across multiple processes,

Re: [sqlite] Sqlite 3.6.0 across dll

2008-07-25 Thread Jacek Oleksy
By 'module' I mean any dll loaded by the application or the application itself. I know the data is not shared, hence my question: can I use one database connection (one sqlite3 pointer) in multiple modules? Regards, Jacek Roberto pisze: You need to clarify what you mean by 'module'. Data is

Re: [sqlite] Sqlite 3.6.0 across dll

2008-07-25 Thread Jacek Oleksy
Jacek Oleksy wrote: sqlite configuration is being hold in a global variable sqlite3Config. To be more specific: this variable is used by sqlite internally, it is defined in global.c. That's why I'm not sure what to do with it... J. ___ sqlite-users

[sqlite] Performance of JOIN

2008-07-25 Thread Salvatore Iovene
Hello, I have a table like this: INT id TEXT t1 TEXT t2 For a lot of rows the pair (t1,t2) is the same, so, in order to save space, it would be better to have two tables like: INT id INT pair_id and INT id TEXT t1 TEXT t2 But, in my case, speed is more importan than disk space, and if I did

Re: [sqlite] Corrupted database repairing

2008-07-25 Thread Derrell Lipman
On Fri, Jul 25, 2008 at 5:23 AM, Alexey Pechnikov [EMAIL PROTECTED] wrote: Database servers such as Oracle or PostgreSQL have transactions log and restore log. Those logs are effectively duplicates of the data or ways of reconstructing the data. SQLite has a transaction log for the

[sqlite] text datatype matching functions, binding vs explicit insert

2008-07-25 Thread Chris Holbrook
I created a table with four text columns and a blob column, and populated it using sqlite3 functions ~prepare, ~bind_text, ~bind_blob. Now I can't query the data using, for example, where app = 'AA', though where app like 'AA' works! The LENGTH() function returns the number of characters which

Re: [sqlite] sqlite and referential integrity

2008-07-25 Thread Rich Shepard
On Fri, 25 Jul 2008, Alessio Forconi wrote: Hello to everyone, I planning to start using sqlite but first I have a question, sqlite supporting the referential integrity as access? Alessio, Use triggers. There is detailed information on the web site. Rich -- Richard B. Shepard, Ph.D.

Re: [sqlite] text datatype matching functions, binding vs explicit insert

2008-07-25 Thread D. Richard Hipp
On Jul 25, 2008, at 8:50 AM, Chris Holbrook wrote: I created a table with four text columns and a blob column, and populated it using sqlite3 functions ~prepare, ~bind_text, ~bind_blob. Now I can't query the data using, for example, where app = 'AA', though where app like 'AA' works!

Re: [sqlite] Sqlite 3.6.0 across dll

2008-07-25 Thread Igor Tandetnik
Jacek Oleksy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I'm using VC++.NET 2003 Windows XP SP2. I have following problem with version 3.6.0: sqlite configuration is being hold in a global variable sqlite3Config. My application uses a dll, which initializes sqlite

Re: [sqlite] Performance of JOIN

2008-07-25 Thread Igor Tandetnik
Salvatore Iovene [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Could you tell me if this kind of JOIN would be very expensive in terms of performance? Why don't you set up a test and measure? It may very well be that the extra time taken to perform a join is offset by less disk

Re: [sqlite] Sqlite 3.6.0 across dll

2008-07-25 Thread Jacek Oleksy
Igor Tandetnik wrote: Is this DLL statically linked to SQLite, or itself uses sqlite3.dll? This DLL is statically linked to SQLite. If you have several modules, each statically linked with SQLite, then you have multiple copies of SQLite runtime in the same process. This is a recipe

Re: [sqlite] Corrupted database repairing

2008-07-25 Thread Alexey Pechnikov
В сообщении от Friday 25 July 2008 16:32:26 Derrell Lipman написал(а): Can I get full log of sql statements for to sent it other network or store to outher device? Maybe sqlite3_trace() or sqlite3_profile() can help with what you're looking for here. Thanks!

Re: [sqlite] FTS statistics and stemming

2008-07-25 Thread Scott Hess
Sorry for the long delay - I was out-of-town, and on return my email box had seemingly grown without bound. So I've been working my LIFO way through giving each email it's five minutes of fame, and here we are... On Sat, Jul 5, 2008 at 9:30 PM, Stephen Woodbridge [EMAIL PROTECTED] wrote: My

Re: [sqlite] Does sqlite support stored procedure?

2008-07-25 Thread John Zhang
Thanks Donald! Just want I needed! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Griggs, Donald Sent: Thursday, July 24, 2008 7:50 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Does sqlite support stored procedure? Hi, John,

Re: [sqlite] Does sqlite support stored procedure?

2008-07-25 Thread John Zhang
Hi BareFeet, I would like to know if SQLite supports stored procedures. Technically, no it doesn't. For what purpose do you want to store procedures? We have an application (open source Jaxer) that provides a support layer for the server-side DB, so users can access it in their javascript.

[sqlite] Sqlite Endianness

2008-07-25 Thread Dave Gierok
Does anyone know what endianness a Sqlite database is stored in? Or does that depend on the endianness of the machine it was created on? I am wondering because we ship a game that runs on Xbox 360, which uses the PowerPC architecture and has a different endianness than the PC. We run PC

Re: [sqlite] Sqlite Endianness

2008-07-25 Thread Simon Davies
2008/7/25 Dave Gierok [EMAIL PROTECTED]: Does anyone know what endianness a Sqlite database is stored in? Or does that depend on the endianness of the machine it was created on? I am wondering because we ship a game that runs on Xbox 360, which uses the PowerPC architecture and has a

Re: [sqlite] Sqlite Endianness

2008-07-25 Thread Dave Gierok
Thanks, I saw that, but it doesn't *really* specify which endianness the file uses, or even if it depends on what type of machine the database was created on. We know we can create it on the PC and load it on the Xbox360, but I wonder if we pay a performance penalty for doing so. I'm going to

Re: [sqlite] Sqlite Endianness

2008-07-25 Thread D. Richard Hipp
On Jul 25, 2008, at 11:50 AM, Dave Gierok wrote: Does anyone know what endianness a Sqlite database is stored in? Or does that depend on the endianness of the machine it was created on? I am wondering because we ship a game that runs on Xbox 360, which uses the PowerPC architecture

Re: [sqlite] FTS statistics and stemming

2008-07-25 Thread Stephen Woodbridge
Scott Hess wrote: Sorry for the long delay - I was out-of-town, and on return my email box had seemingly grown without bound. So I've been working my LIFO way through giving each email it's five minutes of fame, and here we are... Scott, The long delay was well worth the information below

[sqlite] Return a rowset from function?

2008-07-25 Thread Alexey Pechnikov
Hello! There is any way to create 'table functions', which are functions that return a rowset and are used in place of a table to generate rows? Best regards, Alexey. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Return a rowset from function?

2008-07-25 Thread Robert Simpson
No, but that would be wicked cool and bring stored procs a lot closer to reality. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alexey Pechnikov Sent: Friday, July 25, 2008 11:08 AM To: General Discussion of SQLite Database Subject: [sqlite] Return a

Re: [sqlite] Return a rowset from function?

2008-07-25 Thread Harold Wood
yes there is.   embed the sql in a table then execute it as needed passing the appropriate parms. Woody --- On Fri, 7/25/08, Robert Simpson [EMAIL PROTECTED] wrote: From: Robert Simpson [EMAIL PROTECTED] Subject: Re: [sqlite] Return a rowset from function? To: 'General Discussion of SQLite

Re: [sqlite] Return a rowset from function?

2008-07-25 Thread P Kishor
On 7/25/08, Alexey Pechnikov [EMAIL PROTECTED] wrote: Hello! There is any way to create 'table functions', which are functions that return a rowset and are used in place of a table to generate rows? afaik, that would be a VIEW. A SELECT can only return from a TABLE or a VIEW, and a

Re: [sqlite] Sqlite Endianness

2008-07-25 Thread Shane Harrelson
If you're really serious about storing your data in a native form to reduce read/write overhead for handling endian-ness (and I think this is going to be more trouble than it's worth) then you can look at replacing the following functions in vdbeaux.c: ** sqlite3VdbeSerialType() **

Re: [sqlite] Return a rowset from function?

2008-07-25 Thread Alexey Pechnikov
В сообщении от Friday 25 July 2008 22:11:42 Harold Wood написал(а): yes there is.   embed the sql in a table then execute it as needed passing the appropriate parms. How can I create this function? Example: select generate_series(1,7); 1 2 3 4 5 6 7

Re: [sqlite] network type functions

2008-07-25 Thread Alexey Pechnikov
Hello! В сообщении от Wednesday 23 July 2008 19:07:59 вы написали: Hello, Le 23 juil. 08 à 09:14, Alexey Pechnikov a écrit : Hello! Send me please code as attached file. In mail body there are a lot of non-ascii symbols and compiler show a lot of errors on symbols ‘\240’ and

Re: [sqlite] sqlite and referential integrity

2008-07-25 Thread Kees Nuyt
On Fri, 25 Jul 2008 08:02:46 +0200, Alessio Forconi wrote: Hello to everyone, I planning to start using sqlite but first I have a question, sqlite supporting the referential integrity as access? As Rich Shepard already pointed out, SQLite doesn't support it by itself, but you can use triggers

Re: [sqlite] text datatype matching functions, binding vs explicit insert

2008-07-25 Thread D. Richard Hipp
On Jul 25, 2008, at 8:50 AM, Chris Holbrook wrote: I created a table with four text columns and a blob column, and populated it using sqlite3 functions ~prepare, ~bind_text, ~bind_blob. Now I can't query the data using, for example, where app = 'AA', though where app like 'AA' works!

[sqlite] Convert the CURRENT_TIMESTAMP

2008-07-25 Thread Joanne Pham
Hi All, I ran the following sql statement select CURRENT_TIMESTAMP; and the output is : 2008-07-25 23:11:13 Is there any easy way or buildin function to convert this format to : TUE JULY 25 23:11:13 2008 Thanks, JP ___ sqlite-users mailing list

Re: [sqlite] Convert the CURRENT_TIMESTAMP

2008-07-25 Thread Harold Wood Meyuni Gani
Look at the wiki for date/time functions, specifically strft. Woody from his pda -Original Message- From: Joanne Pham [EMAIL PROTECTED] Sent: Friday, July 25, 2008 4:08 PM To: General Discussion of SQLite Database sqlite-users@sqlite.org; [EMAIL PROTECTED] Subject: [sqlite] Convert the

Re: [sqlite] text datatype matching functions, binding vs explicit insert

2008-07-25 Thread Harold Wood Meyuni Gani
But you can use where 'AA' = upper(fld1) = to get around case issues. Woody from his pda -Original Message- From: D. Richard Hipp [EMAIL PROTECTED] Sent: Friday, July 25, 2008 3:11 PM To: [EMAIL PROTECTED]; General Discussion of SQLite Database sqlite-users@sqlite.org Subject: Re:

Re: [sqlite] Convert the CURRENT_TIMESTAMP

2008-07-25 Thread Joanne Pham
Hi all , I have the following statement to convert the CURRENT_TIMESTAMP to format as TUE JULY 25 23:11:13 2008 but I got the empty string. Can you help me why the empty string is returned. Below is sql statement: select (case strftime('%w', d) when 0 then 'SUN' when 1 then 'MON’ when 2 then

Re: [sqlite] text datatype matching functions, binding vs explicit insert

2008-07-25 Thread D. Richard Hipp
On Jul 25, 2008, at 7:44 PM, Harold Wood Meyuni Gani wrote: But you can use where 'AA' = upper(fld1) = to get around case issues. Yes you can. But you need to be aware that doing so will prevent an index from being used to speed the search. If your table is small it shouldn't make any

Re: [sqlite] text datatype matching functions, binding vs explicit insert

2008-07-25 Thread Harold Wood
that i kind of counted on. if i have a column that i need to index i fix the case as i maintain the data, ill still have an unfixed column for the users view. that way i kind of compromise.   Woody --- On Fri, 7/25/08, D. Richard Hipp [EMAIL PROTECTED] wrote: From: D. Richard Hipp [EMAIL

Re: [sqlite] Convert the CURRENT_TIMESTAMP

2008-07-25 Thread Igor Tandetnik
Joanne Pham [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all , I have the following statement to convert the CURRENT_TIMESTAMP to format as TUE JULY 25 23:11:13 2008 but I got the empty string. Can you help me why the empty string is returned. Below is sql statement: select

Re: [sqlite] Hard time with blobs

2008-07-25 Thread Igor Tandetnik
Sherief N. Farouk [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] That will make this case legal. What's the general behavior though? Is it not guaranteed to be consumed during the call to bind_blob? In other words, without providing SQLITE_TRANSIENT, can I get into trouble with