Re: [sqlite] Importing data into SQLite

2009-09-01 Thread SQL Maestro Group
I'm evaluating SQLite to be used as a small embedded database in a linux environment for Skyfiber Inc. What is the best way to import data into it ? I have a bunch of entities and attributes in an excel spreadsheet. Could I import CSV ? What should be the columns (where can I read about

Re: [sqlite] Search a Select in another Select

2009-09-01 Thread Terence Lorenzo
Thanks for the help. I suspected I had to use a secondary select, though I want sure how to use it For others, here is the completed sql select E1.datetime,R1.email,R2.email,subject,E1.[size],E1.offset,C1.id_block,C1.[size],C1.compression,C1.offset from ( select distinct E2.id from emaildata

Re: [sqlite] Importing data into SQLite

2009-09-01 Thread Terence Lorenzo
You can use http://www.sqliteexpert.com/ its not expensive cheers Kavita Raghunathan wrote: Hi, I'm evaluating SQLite to be used as a small embedded database in a linux environment for Skyfiber Inc. What is the best way to import data into it ? I have a bunch of entities and attributes

Re: [sqlite] Problem invoking php functions from a trigger

2009-09-01 Thread Alejandro Ruiz-Oriol
Yes, but how do I know in the PHP fired by the trigger what's the PHP context of his parent?. Let me explain it. Inside the trigger I excute something like select test(); where test is a registered php function. When the trigger fires, the php function gets called, but the first thing I need

Re: [sqlite] Looking for a w_char alternative for sqlite3_get_table

2009-09-01 Thread Atul_Vaidya
A.J.Millan wrote: Perhaps a seudo-code who let the same result using the standard API functions would be enough. Check this out,It might help http://www.sqlite.org/cintro.html will help. Also see http://www.sqlite.org/cvstrac/wiki?p=SimpleCode for example of use. Atul

Re: [sqlite] Looking for a w_char alternative for sqlite3_get_table

2009-09-01 Thread A.J.Millan
Atul, Igor: Thanks for your kind replies. In fact, actually I'm using the new style querys, and my question was an attempt to: * Make sure there was no 16-bit version of the sqlite3_get_table at function -perhaps it would be a good idea to include it in the standard API. The reason is the

Re: [sqlite] Looking for a w_char alternative for sqlite3_get_table

2009-09-01 Thread Igor Tandetnik
A.J.Millan wrote: In fact, actually I'm using the new style querys, and my question was an attempt to: * Make sure there was no 16-bit version of the sqlite3_get_table at function -perhaps it would be a good idea to include it in the standard API. The reason is the same who advised include

Re: [sqlite] Search a Select in another Select

2009-09-01 Thread Igor Tandetnik
Terence Lorenzo wrote: select K1.keyword from emaildata as E1 INNER JOIN keylocations AS L1 on L1.id_unique = E1.id_unique INNER JOIN keywords as K1 on K1.id = L1.id_keyword WHERE K1.keyword LIKE '%word%' or K1.keyword LIKE '%word2%' The second test is redundant. Everything that matches

Re: [sqlite] Search a Select in another Select

2009-09-01 Thread Terence Lorenzo
yes I am aware of that. word and word1 are variables in my case. I didnt wish to create confusion so I appreciate the comment cheers Igor Tandetnik wrote: Terence Lorenzo wrote: select K1.keyword from emaildata as E1 INNER JOIN keylocations AS L1 on L1.id_unique = E1.id_unique INNER

[sqlite] Convert byte-array to in-memory DB?

2009-09-01 Thread Jeff Godfrey
Hi All, I have a C# application that uses the System.Data.SQLite assembly for SQLite access. The ultimate goal is to access the SQLite data as an in-memory DB. Prior to access though, the database file itself has to be retrieved from a container storage mechanism, as it's not stored

Re: [sqlite] update - select

2009-09-01 Thread Gerald Ebner
the given syntax is ANSI sql (row-value constructors), see also the discussion at http://sqlblog.com/blogs/hugo_kornelis/archive/2008/03/10/lets-deprecate-update-from.aspx Is it likely that row-value constructors will be implemented in the (near) future ? Jonas Sandman wrote: On Thu, Aug 20,

Re: [sqlite] Convert byte-array to in-memory DB?

2009-09-01 Thread J Glassy
Jeff, I'm not sure if I completely understand your intended work flow, but in these cases I'd generally try to work with data like this via a memory-mapped mechanism, especially relevant when you know the size of the data object in question ahead of time, as you apparently do, once a streaming

Re: [sqlite] update - select

2009-09-01 Thread Igor Tandetnik
Gerald Ebner geraldo.eb...@gmail.com wrote: the given syntax is ANSI sql (row-value constructors), see also the discussion at http://sqlblog.com/blogs/hugo_kornelis/archive/2008/03/10/lets-deprecate-update-from.aspx Is it likely that row-value constructors will be implemented in the (near)

Re: [sqlite] Problem invoking php functions from a trigger

2009-09-01 Thread Kees Nuyt
On Tue, 1 Sep 2009 09:51:39 +0200, Alejandro Ruiz-Oriol aruiz...@itelsys.com wrote: Yes, but how do I know in the PHP fired by the trigger what's the PHP context of his parent?. Let me explain it. Inside the trigger I excute something like select test(); where test is a registered php

Re: [sqlite] load extension -- unload hook?

2009-09-01 Thread Kees Nuyt
On Mon, 31 Aug 2009 19:48:48 -0400, sub sk79 subs...@gmail.com wrote: Here is the new info I got from your replies: 1. sqlite_load_extension is per-db-connection - Oddly I did not see any explicit reference to this in either of the two places I looked for it: i)

Re: [sqlite] Convert byte-array to in-memory DB?

2009-09-01 Thread Jay A. Kreibich
On Tue, Sep 01, 2009 at 08:30:56AM -0500, Jeff Godfrey scratched on the wall: Hi All, I have a C# application that uses the System.Data.SQLite assembly for SQLite access. The ultimate goal is to access the SQLite data as an in-memory DB. Prior to access though, the database file itself

Re: [sqlite] Convert byte-array to in-memory DB?

2009-09-01 Thread Jeff Godfrey
Joe, Thanks for the response, and sorry for not being clear on my work flow. Ultimately, I want to access a standard SQLite database in-memory. Starting with a disk-based SQLite database, I can easily replicate it into a memory-based database and access it from there. That's not a problem.

Re: [sqlite] update - select

2009-09-01 Thread Gerald Ebner
hm, finally I'm looking for a convenient way to execute update-selects, very helpful in doing synchronization between different databases is there in SQLite any other way? e.g.: there is a SQL-server-proprietary UPDATE FROM syntax, e.g.: UPDATE c SET Street = m.Street, HouseNo =

Re: [sqlite] update - select

2009-09-01 Thread Pavel Ivanov
If you have unique index on Customers.SSN in you database then you can do it in SQLite like this: INSERT OR REPLACE INTO Customers (SSN, Street, HouseNo, City) SELECT SSN, Street, HouseNo, City FROM Moved; Pavel On Tue, Sep 1, 2009 at 2:54 PM, Gerald Ebnergeraldo.eb...@gmail.com wrote: hm,

Re: [sqlite] update - select

2009-09-01 Thread Gerald Ebner
thanks for the quick response! we typically have 3 unique keys on every table: - on the ID used for foreign keys - on the global unique ID used for synchronization - and on 2..3 fields that must be unique according to the problem domain (e.g. name + surname + birth date) will INSERT OR REPLACE

Re: [sqlite] Looking for a w_char alternative for sqlite3_get_table

2009-09-01 Thread Nicolas Williams
On Tue, Sep 01, 2009 at 10:41:27AM +0200, A.J.Millan wrote: * Make sure there was no 16-bit version of the sqlite3_get_table at function -perhaps it would be a good idea to include it in the standard API. The reason is the same who advised include the current version. It might be easier to

Re: [sqlite] update - select

2009-09-01 Thread Pavel Ivanov
It will work but remember that you have to mention in INSERT all fields that you want to have non-default and non-null values. So if you want just to update a couple of fields and leave as is all others then you'll need to do something like this: INSERT OR REPLACE INTO Customers (SSN, Street,

Re: [sqlite] Convert byte-array to in-memory DB?

2009-09-01 Thread Jay A. Kreibich
On Tue, Sep 01, 2009 at 01:46:03PM -0500, Jeff Godfrey scratched on the wall: The issue lies in my starting point. The persistent storage of my SQLite database file isn't as a separate, disk-based file as it would normally be. Instead, it's stored as a stream inside a container file (an

Re: [sqlite] Problems encountered on upgrade from SQLite2 to -3

2009-09-01 Thread Rod Dav4is
Aren't these problems considered worth fixing ? Rod Dav4is wrote: 1. *OID vs ROWID*: Specification of the OID field name (in SELECT) did not set Rexx variables X.OID.n, but instead set variables x.ROWID.n 2. *Quotes in SELECT*: Specification of Field='3' failed to find

Re: [sqlite] Problems encountered on upgrade from SQLite2 to -3

2009-09-01 Thread D. Richard Hipp
On Sep 1, 2009, at 4:38 PM, Rod Dav4is wrote: Aren't these problems considered worth fixing ? I do not consider them to be problems. Rod Dav4is wrote: 1. *OID vs ROWID*: Specification of the OID field name (in SELECT) did not set Rexx variables X.OID.n, but instead set

Re: [sqlite] load extension -- unload hook?

2009-09-01 Thread Jean-Christophe Deschamps
Hi, ´¯¯¯ 2. Following up on windows dllmain info - which was very useful in itself - but since we use both windows and linux, I checked the equivalent for linux as well and yes, luckily, gcc allows you to define a 'function attribute' called 'constructor' and 'destructor' which can be used to

Re: [sqlite] Problem invoking php functions from a trigger

2009-09-01 Thread Alejandro Ruiz-Oriol
Ok, I got it!! In my php functions I use this code to connect to the DB (its in an include file) $dbh=$GLOBALS['dbh'];// Get Global Handle if ($dbh==null)// First time? no Handle? { $dbh = new PDO('sqlite:/var/www/domocenter.sqlite'); // Create new handle

Re: [sqlite] Problem invoking php functions from a trigger

2009-09-01 Thread Alejandro Ruiz-Oriol
Sorry I send it before time... 2009/9/2 Alejandro Ruiz-Oriol aruiz...@itelsys.com Ok, I got it!! In my php functions I use this code to connect to the DB (its in an include file) function OpenDB() { $dbh=$GLOBALS['dbh'];// Get Global Handle if ($dbh==null)//