[sqlite] Windows dll - Export Symbol

2019-03-27 Thread Lloyd
Hi,

I wish to build SQLite as a dll in Windows. As per the documentation here
https://www.sqlite.org/howtocompile.html, I have executed the command
cl sqlite3.c -link -dll -out:sqlite3.dll
on Visual Studio x86 command prompt.

It seems that the dll built doesn't export any symbols! I checked it using
the dumpbin utility. But the dll downloaded from www.sqlite.org exports
symbols.

How can I build the dll correctly?

Thanks,
  Lloyd
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Deserialize a WAL database file

2019-03-01 Thread Lloyd
On Fri, Mar 1, 2019 at 4:09 PM Simon Slavin  wrote:

> On 1 Mar 2019, at 10:27am, Lloyd  wrote:
>
> > I am able to serialize, deserialize and prepare a SQL query against the
> rollback database. When I do the same against the WAL database file, the
> 'prepare' statement fails with code '1'.
>
> It's possible that some of the data for the WAL database is in the journal
> and hasn't been written back to the database properly.  Was that database
> correctly closed when last used ?
>
> Using the SQLite command-line tool,
> open the database
> run "PRAGMA integrity_check;" on it
> close the database
>
> Then try serializing it again.  If still fails, do the above again but
> "VACUUM;" it instead of the integrity_check.
>
> Simon.
>


I forgot to mention that the database is in a good state. No temp WAL/SHM
files exist in the directory. I tried the steps you suggested. Integrity
check returned 'ok'. Executed vacuum command also. Still, the prepare
statement fails with 1. This is a small test database created. I closed the
database from shell using '.quit' command. I believe that it closes the
connection properly.



>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Deserialize a WAL database file

2019-03-01 Thread Lloyd
I have two database files. One in Rollback mode and the other in WAL mode.
I am able to serialize, deserialize and prepare a SQL query against the
rollback database. When I do the same against the WAL database file, the
'prepare' statement fails with code '1'. Is it not possible to do this on
WAL based database file? A sample code fragment is given below-

sqlite3 *dbHandle=nullptr;
if (sqlite3_open_v2("db_filename", , SQLITE_OPEN_READONLY, NULL)
!= SQLITE_OK){//error}

sqlite3_int64 sz=0;
unsigned char* mem=sqlite3_serialize(dbHandle,"main",,0);

if(sqlite3_deserialize(dbHandle, "main", mem, sz,
sz,SQLITE_DESERIALIZE_READONLY) != SQLITE_OK){//error}

char* Query = "select * from test";
sqlite3_stmt *statement = nullptr;
int res=sqlite3_prepare_v2(dbHandle, Query, strlen(Query), , 0);
//res is 1 for WAL


Thanks,
   Lloyd
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3_deserialize - Any chance for failure?

2018-05-29 Thread Lloyd
Hi,

I am using "sqlite3_deserialize" to read a database.  sqlite3_deserialize
API returns SQLITE_OK. But the "sqlite3_prepare_v2" API fails with error
"no such table: moz_annos". I am adding a sample code fragment below.
"dbBuffer"
varibale is used to hold the database content and it contains exactly what
is contained in the test db file. I also verified the query and it works
from "SQLite" shell. The DB is of 5MB size. I have tested with another
small sized db (100KB, entirely different tables)  and the code works fine.
Any hint on a possible cause of this error?



char *dbBuffer = new char[BufferSize];
ifstream ifs;
ifs.open(filename, std::ifstream::in | std::ifstream::binary);
if (!ifs.is_open())
throw std::exception("file open error");
ifs.read(dbBuffer, BufferSize);
if(ifs.gcount()!= BufferSize)
throw std::exception("couldn't read full data");

sqlite3 *dbHandle=nullptr;
if (sqlite3_open(":memory:", ) != SQLITE_OK)
throw std::exception("sqlite3 memory db open failed");
int RetSqlite = sqlite3_deserialize(dbHandle, "main", (unsigned
char*)dbBuffer, BufferSize, BufferSize, SQLITE_DESERIALIZE_READONLY);
if (RetSqlite != SQLITE_OK)
throw std::exception("sqlite3 db open fialed");
sqlite3_stmt *statement = nullptr;
string Query = "select content,dateAdded,lastModified FROM moz_annos";
if (sqlite3_prepare_v2(dbHandle, Query.c_str(), Query.length(), ,
0) != SQLITE_OK)
throw std::exception("sqlite3 prepare failed");


Thanks,
  Lloyd
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Open and query sqlite db in a buffer

2018-05-18 Thread Lloyd
>
> I see Richard already pointed out that you can create a connection to a
> strictly in-memory DB which doesn't touch a file, and then Deserialize to
> it.  Just to emphasize, if you can make that work, it is definitely worth
> it. From my experience, making the VFS will easily sink around 30 hours of
> your time vs. Deserialize and an in-memory DB which will likely take under
> 3 hours to implement.
>
>
Definitely it is the best suited solution as far as i understand.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Open and query sqlite db in a buffer

2018-05-18 Thread Lloyd
>
>
> Do what you want, but remember you can always create a valid database
> connection using sqlite3_open(":memory:", ) and then do the
> sqlite3_deserialize().
>
>
Thank you Richard, I didn't know that it can be done this way.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Open and query sqlite db in a buffer

2018-05-18 Thread Lloyd
>
> Only https://www.sqlite.org/draft/c3ref/deserialize.html comes to mind,
> and that's brand new and assumes the buffer comes from the companion
> serialize. Not sure it's release in 3.24 yet. Google finds it in the Draft
> only. --DD


Deserialize cannot solve my problem as it needs a valid db connection. As
suggested by Ryan vfs can solve my problem. Thank you DD
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Open and query sqlite db in a buffer

2018-05-18 Thread Lloyd
>
>
> But I imagine you had a more specific question in mind - please ask
> exactly what you would like to know, and make sure to include all the
> details what we need to know to be able to give answers or advice that
> somewhat resemble the truth.
>
> (Is the buffer a queried cursor? a part of the file?, the entire file?
> Does it also exist on a disk? If so, why not read the file? is it embedded
> in another file? Can we put the file to disk or is the disk a no-go zone?
> Are you a DB admin, or a programmer? i.e. Are you stuck with someone else's
> data or are you able to program a custom file-system interface (see vfs
> documentation)?  There are many solutions but we don't know which one is
> best, or if perhaps none of them will work, since we do not have all the
> information.)
>
>
The buffer contains the entire file. It doesn't exist on disk as file. It
is inside another file. Not stored continuously. So my application read
these spread data and can make a valid buffer containing the full database.
The database is small. We cannot put the file on to disk. I am a programmer
so talking about using sqlite API or something similar to use from my
application.

Thank you Ryan, I think sqlite VFS can solve my problem.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Open and query sqlite db in a buffer

2018-05-18 Thread Lloyd
Hi,

I have a "buffer" containing data read from a file-based sqlite database.
Is there any possibility for processing this "buffer" to query the data?

Thanks,
  Lloyd
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Issue with entity framework

2016-08-31 Thread Lloyd
DB first worked for me. But I didn't find it documented that code first
wont work.

On Tue, Aug 30, 2016 at 7:06 PM, grégoire saint-ellier <
greg.stell...@gmail.com> wrote:

> Thank you for your answer. So wich approach should I use ? DB first? Code
> First ?
>
> Regards
>
> 2016-08-30 14:08 GMT+02:00 Erik Ejlskov Jensen :
>
> > You cannot use EF Model First with SQLite, no tooling has been made
> > available for that
> > Mvh / Regards
> >
> >
> > Erik Ejlskov Jensen
> > http://twitter.com/erikej
> > ___
> > sqlite-users mailing list
> > sqlite-users@mailinglists.sqlite.org
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] System.Data.SQLite

2016-08-19 Thread Lloyd
Through DBContext constructor I have associated the connection. As the
table is not existing in my database, it throws an exception. Does sqlite
support automatic creation of tables or do I have create the tables and
relationships first  and then insert the data using the framework?

On Fri, Aug 19, 2016 at 6:02 PM, Lloyd <lloydkl.t...@gmail.com> wrote:

> Hi,
>
> I am trying to use SQLite with EntityFramework6 on a .Net application.
>
> I have referred the documentation, created the app.config file as
> specified in the documentation. When I created a sample C# file as in the
> documentation,it generates an empty database file.
>
> DbProviderFactory fact = DbProviderFactories.GetFactory("System.Data.
> SQLite");
> using (DbConnection cnn = fact.CreateConnection())
> {
>   cnn.ConnectionString = "Data Source=test.db3";
>   cnn.Open();
> }
>
> How can I associate a DBContext with this connection? Is it possible to
> create tables in my sqlite database based on my entity classes?
>
> I couldn't find any tutorial on using System.Data.SQLite with Entity
> Framework.
>
> Any hint/help/a link to tutorial is greatly appreciated
>
> Thanks,
>   Lloyd
>
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] System.Data.SQLite

2016-08-19 Thread Lloyd
Hi,

I am trying to use SQLite with EntityFramework6 on a .Net application.

I have referred the documentation, created the app.config file as specified
in the documentation. When I created a sample C# file as in the
documentation,it generates an empty database file.

DbProviderFactory fact =
DbProviderFactories.GetFactory("System.Data.SQLite");
using (DbConnection cnn = fact.CreateConnection())
{
  cnn.ConnectionString = "Data Source=test.db3";
  cnn.Open();
}

How can I associate a DBContext with this connection? Is it possible to
create tables in my sqlite database based on my entity classes?

I couldn't find any tutorial on using System.Data.SQLite with Entity
Framework.

Any hint/help/a link to tutorial is greatly appreciated

Thanks,
  Lloyd
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Sqlite .Net Entity Framework support

2016-08-09 Thread Lloyd
Hi,
I wish to use sqlite with my C++/CLI (.Net) application using entity
framework (EF). I was referring to this link -
 https://system.data.sqlite.org/index.html/doc/trunk/www/index.wiki

and from the heading I understood that it is an ADO.Net provider. I have
also seen nuget package  by "drh"

https://www.nuget.org/packages/System.Data.SQLite.EF6.

It says system.data.sqlite.ef6

Does sqlite has support for Entity Framework?

If yes, what is the correct link to follow? I couldn't install nuget
package in my C++/CLI application so I manually downloaded the setup
"Setups for 32-bit Windows (.NET Framework 4.6)".
sqlite-netFx46-setup-bundle-x86-2015-1.0.102.0.exe. But it doesn't seem to
support EF.

Thanks a lot,
  Lloyd
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Which SQLite API return SQLITE_BUSY?

2010-07-13 Thread Lloyd
Thanks Jay for your detailed reply.
I would be more happy if the SQLite documentaion include the error codes 
each function can return.

Thanks a lot,
  Lloyd


- Original Message - 
From: "Jay A. Kreibich" <j...@kreibi.ch>
To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
Sent: Thursday, July 08, 2010 8:27 PM
Subject: Re: [sqlite] Which SQLite API return SQLITE_BUSY?


> On Thu, Jul 08, 2010 at 12:42:36PM +0530, Lloyd scratched on the wall:
>> Hi,
>>
>> Which are all the type of SQLite APIs can return SQLITE_BUSY?
>>
>> sqlite3_open_v2
>> sqlite3_prepare_v2
>
>  All styles of these calls, not just the _v2 versions.
>
>> sqlite3_step
>
>  That's the big one.
>
>> sqlite3_finalize
>
>  sqlite3_reset() can as well, but in the case of both _finalize() and
>  _reset() the call itself (e.g. the finalize operation or reset
>  operation) will always work.  The error code is returned as the "left
>  over" from sqlite3_step().  See the history between _prepare() and
>  _prepare_v2().
>
>> sqlite3_bind_blob
>> sqlite3_column_int
>
>  The sqlite3_column_xxx() and sqlite3_bind_xxx() calls should not.
>
>
>
>  Additionally, sqlite3_blob_open() can, however, as can some of the
>  sqlite3_backup_xxx() calls (they use _prepare/_step internally).
>  sqlite3_exec() and sqlite3_get_table() as well.
>
>
>  sqlite3_close() can also return SQLITE_BUSY, but it isn't a locking
>  issue-- it just means you forgot to finalize all the statements.
>  IIRC, there are one or two other functions that do something similar,
>  but they're usually pretty obvious.
>
>  I think that's the bulk of it, however.
>
>   -j
>
> -- 
> Jay A. Kreibich < J A Y  @  K R E I B I.C H >
>
> "Intelligence is like underwear: it is important that you have it,
> but showing it to the wrong people has the tendency to make them
> feel uncomfortable." -- Angela Johnson
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 



__
Scanned and protected by Email scanner
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] order of select result

2010-07-12 Thread Lloyd

Thanks Swithun. I dont have any supportive column in table to issue "order 
by". Can it be achieved by issuing an "ordr by" query on "row_id" (used by 
sqlite internaly)?

Thanks,
  Lloyd

> Hello
>
> L> Lets assume that we have a very simple without any indexing or
> L>constraints. Now we have inserted some data to the table. When we do a
> L>simple "select" query, is it guranteed that the rows will be retrieved
> L>in the same order as they are inserted?
>
> No. It may look like they are being selected in the order they were
> inserted. But there is no guarantee. So you should use an ORDER BY clause
> to get the order you want.
>
> Swithun.




__
Scanned and protected by Email scanner
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] order of select result

2010-07-12 Thread Lloyd
Hi,

Lets assume that we have a very simple without any indexing or constraints. Now 
we have inserted some data to the table. When we do a simple "select" query, is 
it guranteed that the rows will be retrieved in the same order as they are 
inserted?

Thanks a lot,
  Lloyd


__
Scanned and protected by Email scanner
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



[sqlite] Which SQLite API return SQLITE_BUSY?

2010-07-08 Thread Lloyd
Hi,

Which are all the type of SQLite APIs can return SQLITE_BUSY?

sqlite3_open_v2
sqlite3_prepare_v2
sqlite3_step
sqlite3_finalize
sqlite3_bind_blob
sqlite3_column_int

Thanks,
  Lloyd




__
Scanned and protected by Email scanner
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_step returns sqlite_busy

2010-07-07 Thread Lloyd
So it means we can have mor than one valid db handle?

Thanks,
  Lloyd

- Original Message - 
From: "Pavel Ivanov" <paiva...@gmail.com>
To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
Sent: Wednesday, July 07, 2010 6:40 PM
Subject: Re: [sqlite] sqlite3_step returns sqlite_busy


>> one thread is preparing an "INSERT" statement (It returns SQLITE_OK),
>> then it is executed using sqlite3_step. sqlite3_step returns an
>> SQLITE_BUSY! Is there any possibility for this?
> 
> Sure. Preparing INSERT statement doesn't acquire any "write" locks on
> the database. It's executing the INSERT statement that acquires locks.
> So if while executing statement finds that it can't get the locks then
> sqlite3_step returns SQLITE_BUSY. And thread-safety is irrelevant
> here.
> 
> 
> Pavel
> 


__
Scanned and protected by Email scanner
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] EXTERNAL: sqlite3_step returns sqlite_busy

2010-07-07 Thread Lloyd

- Original Message - 
From: "Black, Michael (IS)" <michael.bla...@ngc.com>
To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
Sent: Wednesday, July 07, 2010 5:35 PM
Subject: Re: [sqlite] EXTERNAL: sqlite3_step returns sqlite_busy


Of course it's possible -- multiple clients accesing the database is just 
fine.

Is there any reason you need exclusive access for each thread in ping-pong 
mode?  If not, just handle the BUSY in both places.

I just want to ensure that the "right data" is read always. And also I want 
it to return the data always. (Even if the database is locked, I am ready to 
wait and open it)

You men to handle the BUSY by waiting for some time and trying to execute 
sqlite3_step?

Thanks a lot,
  Lloyd 



__
Scanned and protected by Email scanner
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3_step returns sqlite_busy

2010-07-07 Thread Lloyd
Hi,

We have a multi-threaded application (I know "threads are evil", but this is a 
small server application). Each thread tries to access the SQLite database. 
When trying to get a DB handle (sqlite3_open), if it returns SQLITE_BUSY, then 
the thread will wait for some time and try to open it again (until it gets the 
handle). In our case, two threads are running, one thread is preparing an 
"INSERT" statement (It returns SQLITE_OK), then it is executed using 
sqlite3_step. sqlite3_step returns an SQLITE_BUSY! Is there any possibility for 
this? ( I think these two threads are obtaining the DB handle at the same time 
using sqlite_open - with wrtie permission- is it possible?) I have tried 
compiling the application with both  -DSQLITE_THREADSAFE=2 and 
-DSQLITE_THREADSAFE=1.

Any hint would be very helpful...

Thanks a lot,
  Lloyd

__
Scanned and protected by Email scanner
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] View - What happens internally

2009-03-02 Thread Lloyd
Thank you Igor and Dan. Now I am clear about the concept.

On Sat, 28 Feb 2009 20:07:45 +0530, Dan <danielk1...@gmail.com> wrote:

>
> On Feb 28, 2009, at 8:44 PM, Lloyd wrote:
>
>>
>> Hi,
>>
>> When we create a view what happens internally in sqlite? Does it
>> select
>> all the data from the table and then "insert" it in to the view? or
>> would
>> the records in the view keep references to records in main table?
>> just to
>> know whether creating more views on a big in-memory database would
>> require
>> more memory.
>
> A view in SQLite is just a SELECT statement that is saved in the
> database
> schema. If you do:
>
>CREATE VIEW v1 AS SELECT * FROM t1;
>SELECT * FROM v1;
>
> The SQL compiler (the thing that runs when you call
> sqlite3_prepare_v2())
> converts the select statement to "SELECT * FROM (SELECT * FROM t1)"
> before compiling a prepared statement to implement the query.
>
> So adding a view doesn't require a huge amount of extra memory.
>
> Dan.
>
>
>>
>>
>> Thanks,
>>   Lloyd
>>
>> __
>> Scanned and protected by Email scanner
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



__
Scanned and protected by Email scanner
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] View - What happens internally

2009-02-28 Thread Lloyd

Hi,

When we create a view what happens internally in sqlite? Does it select  
all the data from the table and then "insert" it in to the view? or would  
the records in the view keep references to records in main table? just to  
know whether creating more views on a big in-memory database would require  
more memory.

Thanks,
   Lloyd

__
Scanned and protected by Email scanner
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQL question, probably stuipid but ...

2009-02-17 Thread Lloyd

To escape "'" use cosecutive "'" , i.e "''"

On Wed, 18 Feb 2009 10:32:28 +0530, J. R. Westmoreland  wrote:

> I can't remember how to escape a "'" in a string.
>
> My statement looks something like:
>
> "insert . values ('DAY'S AVE' .);
>
>
> It's been a long day.
>
> Thanks in advance.
>
>
> J. R.
>
>
> 
>
> J. R. Westmoreland
>
> E-mail: j...@jrw.org
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



__
Scanned and protected by Email scanner
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Updating only the last raw

2008-10-17 Thread Lloyd
Thank you very much Dan.

On Fri, 2008-10-17 at 14:10 +0700, Dan wrote:
> On Oct 17, 2008, at 1:43 PM, Lloyd wrote:
> 
> > Hi,
> >
> > Lets assume a table having following data
> >
> > No. NameAddress
> > 
> > 1   A   addrA
> > 2   B   addrB
> > 3   C   addrC
> > 4   B   addrB1
> >
> > I want to update the filed 'Address' based on field 'Name'. But if  
> > there
> > are multiple table entries (The case of B), I just want to update the
> > last entry in the table. How can I write a query for this?
> >
> > My present query is
> >
> > update mytab set Address="addr" where name="B"
> 
> If you are using version 3.6.4 and compile with
> SQLITE_ENABLE_UPDATE_DELETE_LIMIT, then you can use the new
> syntax:
> 
>UPDATE mytab SET Address='addr' WHERE name='B' ORDER BY rowid DESC  
> LIMIT 1;
> 
> Otherwise, you have to do:
> 
>UPDATE mytab SET Address='addr' WHERE rowid = (SELECT max(rowid)  
> FROM mytab WHERE name = 'B');
> 
> 
> Dan.
> 
> 
> 
> 
> >
> >
> >
> > The output of this query would be
> >
> > No. NameAddress
> > 
> > 1   A   addrA
> > 2   B   addr
> > 3   C   addrC
> > 4   B   addr
> >
> > But the Output we want is
> >
> > No. NameAddress
> > 
> > 1   A   addrA
> > 2   B   addrB
> > 3   C   addrC
> > 4   B   addr
> >
> >
> > If my question is not clear, I am ready to explain it more...
> >
> >
> >
> > Thanks,
> >  Lloyd
> >
> >
> >
> > __
> > Scanned and protected by Email scanner
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


__
Scanned and protected by Email scanner
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Testing sqlite

2008-04-30 Thread Lloyd
Hi,
  In the test folder of sqlite3 source distribution I saw so many test
scripts. How can I run these tests? I am curious to know the various
testing methods used in sqlite.

Thanks,
 Lloyd


__
Scanned and protected by Email scanner
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] can't find libsqlite3.so.0 on RHEL

2008-03-13 Thread Lloyd
Hi Punkish,

I think after installing the library, and making the path entry in
the /etc/ld.so.conf (If it is not there), simply running the "ldconfig"
command will serve your need.

Regards,
  Lloyd

On Thu, 2008-03-13 at 12:09 -0500, P Kishor wrote:
> I am not at all conversant with RH Linux (RHEL-es3). I have just
> compiled sqlite3.5.6 from amalgamation, and I get the error that
> libsqlite3.so.0 can't be found. I did the following
> 
> ../configure
> make && make install
> 
> sqlite3 is place in /usr/local/bin
> and libsqlite3.so.0 is placed in /usr/local/lib
> 
> [12:07 PM] /usr/local/lib$ ls -l libsql*
> -rw-r--r--1 root   765640 Mar 13 11:51 libsqlite3.a
> -rwxr-xr-x1 root  828 Mar 13 11:51 libsqlite3.la*
> lrwxrwxrwx1 root   19 Mar 13 11:51 libsqlite3.so ->
> libsqlite3.so.0.8.6*
> lrwxrwxrwx1 root   19 Mar 13 11:51 libsqlite3.so.0 ->
> libsqlite3.so.0.8.6*
> -rwxr-xr-x1 root   679734 Mar 13 11:51 libsqlite3.so.0.8.6*
> 
> 
> of course ldd -v does say
> 
> [12:03 PM] ~$ ldd -v /usr/local/bin/sqlite3
> libsqlite3.so.0 => not found
> 
> What extra step do I have to take on this computer to make sqlite3
> work properly?
> 


__
Scanned and protected by Email scanner
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] 64bit on 32bit machine

2007-07-12 Thread Lloyd
Thank you very much Andrew.

Regards,
 Lloyd

On Thu, 2007-07-12 at 23:37 -0500, Andrew Finkenstadt wrote:
> Use sqlite_int64 as your type.  That typedef supports 'long long' or 'signed
> __int64' or whatever the compiler environment needs.
> 
> --a
> 
> On 7/12/07, Lloyd <[EMAIL PROTECTED]> wrote:
> >
> > Thanks Andy.
> > So, SQLite doesn't have its own features to manage this? So I must be
> > able to perform 64bit operations on a 32bit machine using C. How can I
> > do that? or how to declare a 64bit integer on a 32bit machine?
> >
> > Thanks,
> >   Lloyd
> >
> >
> >
> > On Thu, 2007-07-12 at 15:06 -0500, Andrew Finkenstadt wrote:
> > > It uses the feature built-in to the language compiler that you use.
> > >
> > > In the case of Visual Studio (Microsoft, x86) the underlying compiler
> > uses
> > > either the library implementations or direct assembly code using pairs
> > of
> > > registers and whatever dual-register assembly instructions are available
> > on
> > > the specific CPU.
> > >
> > > In the case of GCC, the underlying compiler uses whatever made sense in
> > its
> > > library implementation.  Usually intrinsics are used in release mode,
> > and
> > > library functions are used in debug mode.
> > >
> > > --andy
> > >
> > > On 7/12/07, Lloyd <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Hi,
> > > >   Can I know how SQLite performs 64bit operations (addition,
> > > > multiplication, division) on 32bit machine?
> > > >
> > > > Thank you very much,
> > > >   Lloyd
> > > >
> > > >
> > > > __
> > > > Scanned and protected by Email scanner
> > > >
> > > >
> > > >
> > -
> > > > To unsubscribe, send email to [EMAIL PROTECTED]
> > > >
> > > >
> > -
> > > >
> > > >
> >
> >
> > __
> > Scanned and protected by Email scanner
> >
> >
> > -
> > To unsubscribe, send email to [EMAIL PROTECTED]
> >
> > -
> >
> >


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: 64bit on 32bit machine

2007-07-12 Thread Lloyd
Thanks Igor :)

Regards,
  Lloyd

On Fri, 2007-07-13 at 00:18 -0400, Igor Tandetnik wrote:
> Lloyd  wrote:
> > So, SQLite doesn't have its own features to manage this? So I must be
> > able to perform 64bit operations on a 32bit machine using C. How can I
> > do that? or how to declare a 64bit integer on a 32bit machine?
> 
> Most modern compilers provide a "long long" type, usually mapped to a 
> 64-bit integer on 32-bit machines. Consult the documentation for the 
> compiler you use.
> 
> Igor Tandetnik 
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] 64bit on 32bit machine

2007-07-12 Thread Lloyd
Thanks Andy.
So, SQLite doesn't have its own features to manage this? So I must be
able to perform 64bit operations on a 32bit machine using C. How can I
do that? or how to declare a 64bit integer on a 32bit machine?

Thanks,
  Lloyd



On Thu, 2007-07-12 at 15:06 -0500, Andrew Finkenstadt wrote:
> It uses the feature built-in to the language compiler that you use.
> 
> In the case of Visual Studio (Microsoft, x86) the underlying compiler uses
> either the library implementations or direct assembly code using pairs of
> registers and whatever dual-register assembly instructions are available on
> the specific CPU.
> 
> In the case of GCC, the underlying compiler uses whatever made sense in its
> library implementation.  Usually intrinsics are used in release mode, and
> library functions are used in debug mode.
> 
> --andy
> 
> On 7/12/07, Lloyd <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >   Can I know how SQLite performs 64bit operations (addition,
> > multiplication, division) on 32bit machine?
> >
> > Thank you very much,
> >   Lloyd
> >
> >
> > __
> > Scanned and protected by Email scanner
> >
> >
> > -
> > To unsubscribe, send email to [EMAIL PROTECTED]
> >
> > -
> >
> >


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] 64bit on 32bit machine

2007-07-12 Thread Lloyd
Hi,
  Can I know how SQLite performs 64bit operations (addition,
multiplication, division) on 32bit machine?

Thank you very much,
  Lloyd


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] reserved chars in insert

2007-06-13 Thread Lloyd
Hi,
  I would like to know the reserved characters which cannot be used in
inserting a string.. (like ",',...).

Thanks in advance,
  Lloyd


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Copying the content of a table to another table

2007-06-05 Thread Lloyd
 create table x(c1 number,c2 number);
 create table y(v1 number,v2 number,v3 number,v4 number);
 insert into y (v1,v2) select c1,c2 from x;

or better you can use the alter table command on your old table (here x)

 alter table x add v3 number;
 alter table x add v4 number;

the following way doesn't seem to work for me

alter table x add (v3 number,v4 number);

Regards,
 Lloyd

On Tue, 2007-06-05 at 11:25 +0530, Kirrthana M wrote:
> Hi all,
> I have created a table with two columns c1 and c2 and inserted some
> values into,in future i may include some additional columns c3,c4. to
> the same table.In tat case i should not loose my data in the current
> table,so i should be able to copy the content of the current table(values of
> c1 and c2) to the new table and start working with the new table and delete
> the existing one,could anybody give me a suggestion for doing this.
> 
> Regards
> Kirrthana


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Monitor Queries

2007-05-23 Thread Lloyd
On Wed, 2007-05-23 at 07:21 -0700, Joe Wilson wrote:
> > I've a "black-box" (Linux) program - so no source available - using
> a
> > sqlite database. Is there any way I can monitor/log the queries made
> to
> > the database?
> 
> If it's dynamically linked, just replace libsqlite3.so with your own.

How should be my own libsqlite3.so looking like. Can you explain the way
I should make the library? I would like to learn this technique :)

> If it is statically linked and has -g symbols, use gdb.
> If it's stripped, x86 assembler is not that hard to learn.
> 

Thanks,
  Lloyd


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] A suggestion

2007-05-09 Thread Lloyd
In old versions it work... But in new versions (3.* I think) its not
working!

On Wed, 2007-05-09 at 12:11 +0200, Peter van Dijk wrote:
> On 9-mei-2007, at 11:06, A.J.Millan wrote:
> 
> > As a suggestion, and even in the risk to abuse of Mr Hipp's  
> > patience. Would
> > it be possible to include in the command-line program (sqlite3.exe)  
> > the
> > ability to edit, an repeat at least the five or six last commands,  
> > as in
> > Linux?. Is to say with up-arrow and down-arrow.  I believe it would  
> > be too
> > helpful.
> 
> Arrow up and down work fine for me, I'm not sure what your actual  
> request is then?
> 
> Cheers, Peter.
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Sqlite 14 (cant open database)

2007-05-03 Thread Lloyd
Thank you Arjen. I would consider your alternative or I will go for some
other file system. (Because I would have to handle files larger than
2GB)

Thanks and Regards,
 Lloyd

On Thu, 2007-05-03 at 13:52 +0200, Arjen Markus wrote:
> Lloyd wrote:
> 
> >This error occurs only on FAT 32 file system! I have a directory with
> >32764 files. one of the file is my sqlite database. It seems that, when
> >the file count reaches around this particular no. the SQLite cant open
> >database error occurs. Can anybody give me some hint? (I am mounting
> >FAT32 file system on my Linux)
> >
> >  
> >
> That is a very large number of files! I know FAT32 can not handle files 
> larger than
> 2 GB, and I imagine there is limit on the number of files as well. Try 
> creating
> some subdirectories and moving the files there. The problem is most 
> likely in the filesystem.
> 
> Regards,
> 
> Arjen
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Sqlite 14 (cant open database)

2007-05-03 Thread Lloyd
This error occurs only on FAT 32 file system! I have a directory with
32764 files. one of the file is my sqlite database. It seems that, when
the file count reaches around this particular no. the SQLite cant open
database error occurs. Can anybody give me some hint? (I am mounting
FAT32 file system on my Linux)

Thanks and Regards,
  Lloyd


On Wed, 2007-04-25 at 10:13 +0530, Lloyd wrote:
> Hi,
>  I am working on Redhat EL4, with sqlite3. In my application (written in
> C++ and wxWidgets, and I use wxSqlite3 wrapper) there a module which
> will be called repeatedly which in turn opens and closes the database
> each time the module is called. When the application runs (process the
> input) for short period of time (10 mins -small input) am not getting
> any error. But when it runs for around 1 hour (large input) I am getting
> an error called
> 
> sqlite 14, cant open database !
> 
> What could be the reason for this particular error?
> 
> Thanks and regards,
>   Lloyd
> 
> 



__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Sqlite 14 (cant open database)

2007-04-24 Thread Lloyd
Hi,
 I am working on Redhat EL4, with sqlite3. In my application (written in
C++ and wxWidgets, and I use wxSqlite3 wrapper) there a module which
will be called repeatedly which in turn opens and closes the database
each time the module is called. When the application runs (process the
input) for short period of time (10 mins -small input) am not getting
any error. But when it runs for around 1 hour (large input) I am getting
an error called

sqlite 14, cant open database !

What could be the reason for this particular error?

Thanks and regards,
  Lloyd


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Data structure

2007-04-20 Thread Lloyd
Thank you John Stanton. This has opened new doors for me, and think it
would be helpful for others in the list too..

Thanks and Regards
Lloyd

On Thu, 2007-04-12 at 12:34 -0500, John Stanton wrote:
> We use a very simple data retrieval method for smallish datasets.  The 
> data is just stored in memory or as a memory mapped file and a 
> sequential search used.  It sounds crude but when you use a fast search 
> algorithm like Boyer-Moore it outperforms index methods up to a 
> surprisingly large number of records.  As you can imagine the code 
> footprint is miniscule and if you add regular expression logic you can 
> realize very intricate search patterns.
> 
> We use the method in conjunction with a database to achieve an enormous 
> speed increase on "LIKE" type searches.  Grep a few files to get a feel 
> for the performance.
> 
> Another method which works well for memory resident storage is to 
> implement self balancing AVL trees.  The code is simple and the 
> performance lightning fast.  With a little ingenuity you can use disk 
> storage.  Mini Sql (MSql) is a good example of how this can be effective.
> 
> As Einstein said - "Make it as simple as possible, but not too simple". 
> Applying Occam's Razor can turn bloated solutions into more 
> effective lean ones.  Typical solutions come in two sizes just like Army 
> boots - too big and too small.
> 



__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Data structure

2007-04-11 Thread Lloyd
Would anybody suggest a good tool for performance measurement (on
Linux) ?

On Wed, 2007-04-11 at 10:35 -0500, John Stanton wrote:
> You might discover that you can craft a very effective memory
> resident 
> storage system using a compression system like Huffman Encoding and
> an 
> index method appropriate to the key you are using for retrieval.
> That 
> could work very well in an embedded system, have a small footprint in 
> data and code and be very fast.


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Data structure

2007-04-11 Thread Lloyd
Thank you all. I got so many new ideas from your replies. Now I just
have to derive the best solution for me, thanks :)

Lloyd


On Wed, 2007-04-11 at 10:35 -0500, John Stanton wrote:
> You might discover that you can craft a very effective memory
> resident 
> storage system using a compression system like Huffman Encoding and
> an 
> index method appropriate to the key you are using for retrieval.
> That 
> could work very well in an embedded system, have a small footprint in 
> data and code and be very fast.


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Data structure

2007-04-11 Thread Lloyd
On Wed, 2007-04-11 at 10:00 -0500, P Kishor wrote:
> I think, looking from Lloyd's email address, (s)he might be limited to
> what CDAC, Trivandrum might be providing its users.
> 
> Lloyd, you already know what size your data sets are. Esp. if it
> doesn't change, putting the entire dataset in RAM is the best option.
> If you don't need SQL capabilities, you probably can just use
> something like BerkeleyDB or DBD::Deep (if using Perl), and that will
> be plenty fast. Of course, if it can't be done then it can't be done,
> and you will have to recommend more RAM for the machines (the CPU
> seems fast enough, just the memory may be a bottleneck).

Sorry, I am not talking about the limitations of the system in our side,
but end user who uses our software. I want the tool to be run at its
best on a low end machine also. 

I don't want the capabilities of a data base here. Just want to store
data, search for presence, remove it when there is no more use of it.

Surely I will check out BerkeleyDB. The data set must be in ram, because
the total size of it is very small. (Few maga bytes) I just want to
spped up the search, which is done millions of times.

Thanks,

 LLoyd


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Data structure

2007-04-11 Thread Lloyd

> 
> I was just wondering what the odds were of doing a better job than the 
> filing system pros, how much time/code that would take on your part and 
> how much that time would cost versus speccing a bigger/faster machine.
> 
> Martin

I am not fully clear. I just want my program to run at most efficient
and fast even on a low profile end user system. So I am in search for
the best data structure. 

I have heard about bloom filter, but in my case it is not applicable.
The final point is, I am just searching for a data structure which is
the result of lateral thinking by experts ;) (like bloom filter)

Thanks,
  Lloyd


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Data structure

2007-04-11 Thread Lloyd
hi Puneet and Martin,
On Wed, 2007-04-11 at 14:27 +0100, Martin Jenkins wrote:
> File system cache and plenty of RAM?
> 

It is meant to run on an end user system (eg. Pentium 4 1GB RAM). If you
mean Swap space as file system cache, it is also limited, may be 2GB.


Puneet Kishor
> you haven't provided any further details about the data itself so I
> would venture to say -- get a computer with gobs of RAM (the new Mac
> Pro 8-cores can accomodate 16 GB), and use a memory based hash. Query
> away.


Each node of the data structure will contain only very little data (A
structure sizing 70 bytes and the key field would be of size maximum of
20 bytes). (I will see, what is memory based hash)

Thanks and Regards,
  Lloyd


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Data structure

2007-04-11 Thread Lloyd
Hi,
I don't know whether this is an irrelevant question in SQLite list, but
I don't see a better place to ask.

Which data structure is best to store and retrieve data very fastly?
There is a 95% chance that the searched data to be present in the data
structure. There will be 1000s of nodes in the data structure and it
will be searched millions of times. The data is not in any ordered form.

Thanks for your information,

Lloyd


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] What would you suggest?

2007-04-08 Thread Lloyd
Hi,

I want to store and retrieve sorted integer (these integers are file
offsets). So do I have to use SQLite or shall I store it in a file?
(Reading from the file will be easy by using fseek()). Which would be
efficient? SQLit or this file way? or do you have any other suggestions?
(In this case, I will have millions of integers to store and retrieve)

What the real data is a network packet dump file. I want to store and
retrieve the location of each packet, in order to make packet reading a
faster way from a very large dump file (in terms of GBs) 

Thanks,
  Lloyd


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] matching only part of a string

2007-03-27 Thread Lloyd K L
Hi,
  My table contains a text field called Name. Let the data be

Name
---
Abc
abcd
AB
cab
def

I want to selcct all the rows which contains the term ab (not case
sensitive). How can I do this?

Thanks in advance,
  Lloyd


-
This email was sent using SquirrelMail.
   "Webmail for nuts!"
http://squirrelmail.org/


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] C

2007-03-01 Thread Lloyd
Thanks John. yes, I am familiar with this way, I just wanted to know
whether there is a way to make bit field array. From Igor's reply I
understood that it is not possible in C.

Thanks,
 Lloyd

On Thu, 2007-03-01 at 09:48 -0600, John Stanton wrote:
> Use a mask to load from and store to your bit field/array by using a 
> bitwise AND (&).
> 
> Lloyd wrote:
> > Even though I know this is not the right question to ask this list, I
> > would expect some help from you.
> > 
> > The question is regarding C bit fields..
> > 
> > struct
> > {
> >  unsigned int a:1;
> > };
> > 
> > This declares a to hold 1 bit value;
> > 
> > How can I make an array of bit fields? something like, using the 16 bits
> > of a short as an array of bits
> > 
> > Thanks,
> >   Lloyd
> > 
> > Sorry for asking irrelevant question to this list. 
> > 
> > 
> > __
> > Scanned and protected by Email scanner
> > 
> > -
> > To unsubscribe, send email to [EMAIL PROTECTED]
> > -
> > 
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: C

2007-03-01 Thread Lloyd
Thanks Igor. This is what I wanted.

On Thu, 2007-03-01 at 07:46 -0500, Igor Tandetnik wrote:
> Lloyd  wrote:
> > How can I make an array of bit fields? something like, using the 16
> > bits
> > of a short as an array of bits
> 
> You can't. But, if you can use C++ rather than C, there's std::bitset 
> class that does just that.
> 
> Igor Tandetnik 
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] C

2007-03-01 Thread Lloyd
Even though I know this is not the right question to ask this list, I
would expect some help from you.

The question is regarding C bit fields..

struct
{
 unsigned int a:1;
};

This declares a to hold 1 bit value;

How can I make an array of bit fields? something like, using the 16 bits
of a short as an array of bits

Thanks,
  Lloyd

Sorry for asking irrelevant question to this list. 


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Abuse of the SQLite website

2007-01-30 Thread Lloyd Thomas
Would not adding verification cause a problem for those include the 
downloading of sqlite in bash/make files of certain apps.


Lloydie T

- Original Message - 
From: "Rich Shepard" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, January 30, 2007 2:50 PM
Subject: Re: [sqlite] Abuse of the SQLite website



On Tue, 30 Jan 2007, Mark Richards wrote:


Returning a link that expires in an email to the requester is a method
that works nicely. It does require some programming and maintenance, but
would be a nice gatekeeper.


  Rather than this, I support the idea of an image with letters and digits
in various fonts or colors (so they cannot be readily harvested by OCR
methods) that are to be manually copied to a text entry field.

  I've no idea of the relative amounts of effort required by these 
different
approaches, but I suspect that such images are readily available on the 
Web

and a sufficiently large collection could be used with each presentation
being arbitrary. Perhaps once this is done -- and hidden from page source
view -- it would not need much maintenance.

  The inconvenience to us who access the site is the price we need to pay
given the abuse of the 'Net and the Web.

Rich

--
Richard B. Shepard, Ph.D.   |The Environmental Permitting
Applied Ecosystem Services, Inc.|  Accelerator(TM)
 Voice: 503-667-4517  Fax: 
503-667-8863


-
To unsubscribe, send email to [EMAIL PROTECTED]
-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] A little help with count

2007-01-13 Thread Lloyd Thomas


I wish to create a query where I do a number of counts on the same table but 
with different filters.

ie:
count(id) as numrows
count(id) as inrows where direction = 'In'
count(id) as outrows where direction = 'Out'

Could I do the above in a single query?

| id |  date  | direction | duration | cost |
| 1 |2007-01-01|In| 56 | 0.00 |
| 2 |2007-01-01|   Out  | 60 | 0.10 |
| 3 |2007-01-02|   Out  | 47 | 0.10 |
| 4 |2007-01-02|In| 120   | 0.20 |


Thx
Lloydie T 



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] LEMON

2006-12-29 Thread Lloyd
Ethereal make use of Lemon

On Fri, 2006-12-29 at 11:08 -0400, Cesar Rodas wrote:
> Where can i find a tutorial with examples of how to use LEMON parser...
> because i need to build interpreted language
> 
> Thanks to all


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Time zone conversion

2006-12-20 Thread Lloyd


Thanks Karthick. My code too works fine... (I made a small typo mistake in 
query, which executed silently)
But  I guess your method is the right one.

Regards,
  Lloyd

On Wed, 2006-12-20 at 16:54 +0530, Karthick V - TLS , Chennai wrote:
> Let the time zone given by user
> +0530
> 
> Therefore its  330 minutes / 13200 seconds
> 
> select datetime( StartTime,'unixepoch','+13200.0 seconds') from mytable
> --- gives you the local time
> 
> Select datetime( StartTime,'unixepoch')gives u universal time
> 
> Where StartTime is an integer(unixtimestamp stored in the database) 
> 
> 
> With Regards
>  
> Karthick V
> 
>  
> "Don't bother just to be better than your contemporaries or predecessors.
> Try to be better than yourself"
> William Faulkner
> 
> -Original Message-
> From: Lloyd [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, December 20, 2006 10:30 AM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] Time zone conversion
> 
> Hi,
>   I would like to implement a time zone independent function. So I get the
> time zone information from user, and plans to convert the datetime to the
> time zone specified. To make it clear I give an example
> 
> here StartTime is stored as an integer in the database
> 
> select datetime(StartTime,'unixepoch') from mytable;
> 
> will give the universal time.
> 
> To get the local time, what I do is- Let the time zone given by user
> +0530
> 
> convert   +0530 to seconds, =13200 ((5*60+30)*60), then 
> 
> select datetime(StartTime+13200,'unixepoch') from mytable;
> 
> But it is not working as I expected. (no result is shown)
> 
> what could be the reason? Is there any better way for me to achieve the same
> result?
> 
> Thanks and Regards,
>   Lloyd
> 
> 
> __
> Scanned and protected by Email scanner
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> 
> -
> DISCLAIMER 
> The contents of this e-mail and any attachment(s) are confidential and 
> intended for the 
> 
> named recipient(s) only. It shall not attach any liability on the originator 
> or HCL or its 
> 
> affiliates. Any views or opinions presented in this email are solely those of 
> the author and 
> 
> may not necessarily reflect the opinions of HCL or its affiliates. Any form 
> of reproduction, 
> 
> dissemination, copying, disclosure, modification, distribution and / or 
> publication of this 
> 
> message without the prior written consent of the author of this e-mail is 
> strictly 
> 
> prohibited. If you have received this email in error please delete it and 
> notify the sender 
> 
> immediately. Before opening any mail and attachments please check them for 
> viruses and 
> 
> defect.
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
> 


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Time zone conversion

2006-12-19 Thread Lloyd
Hi,
  I would like to implement a time zone independent function. So I get
the time zone information from user, and plans to convert the datetime
to the time zone specified. To make it clear I give an example

here StartTime is stored as an integer in the database

select datetime(StartTime,'unixepoch') from mytable;

will give the universal time.

To get the local time, what I do is- Let the time zone given by user
+0530

convert   +0530 to seconds, =13200 ((5*60+30)*60), then 

select datetime(StartTime+13200,'unixepoch') from mytable;

But it is not working as I expected. (no result is shown)

what could be the reason? Is there any better way for me to achieve the
same result?

Thanks and Regards,
  Lloyd


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Query generation

2006-12-06 Thread Lloyd
Thanks, 0=0 works well enough for me. (This hint is what I wanted)

Thanks again,
  Lloyd

On Wed, 2006-12-06 at 10:00 +0100, Mario Frasca wrote:
> Lloyd wrote:
> 
> >select a from mytable where (b=0) and
> >
> >and this is a syntax error.
> >  
> >
> you're not saying which language you're using.
> 
> in Python a common solution looks like this:
> clauses = []
> # add strings to the clauses list, like
> clauses.append('(b=0)')
> # join the parts using appropriate glue
> where = ' AND '.join(clauses)
> 
> sometimes I do need something like what you call "an empty clause"...
> some engines accept 'TRUE', others don't know that literal.
> I find this quite convenient:
> '0=0'
> 
> hth...
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Query generation

2006-12-06 Thread Lloyd
Hi,
 I am generating queries dynamically from my program based on the input.
The primary part of the query is always

select a from mytable where (b=0) and

based on the user input I add more where clauses to my query like

select a from mytable where (b=0) and (x=10)

but in one case there in no where clause to add, so my final query
become

select a from mytable where (b=0) and

and this is a syntax error.

Is there any option to add a null clause after the 'and' ?

Thanks,
  Lloyd


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: Re: ip2long

2006-12-05 Thread Lloyd
I feel little difficulty in understanding what you actually want (I
thing the same is for all...). So could make it more clear? so that your
problem can be solved fast!

Thanks,
  Lloyd.  


Yes, they are stored as INTEGER. and the conversion outside sqlite
> is simple. However, I still need to SELECT the range before displaying.
> And without doing SELECT *
> maybe I should use MySQL and NET_ATON / INET_NTOA
> but it would be much nicer and portable in SQLite
> 
> Kind regards
> Kevin
> 


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: Re: ip2long

2006-12-04 Thread Lloyd
The way I am dealing with this is...

First convert the IP to a 32bit integer. (In the system it will
represented as a 32bit integer)
Store it in the database.
Perform the comparison operations on this stored data.

Thanks,
  Lloyd


On Mon, 2006-12-04 at 22:07 -0500, Igor Tandetnik wrote:
> Kevin Waterson <[EMAIL PROTECTED]> wrote:
> > This one time, at band camp, "Igor Tandetnik"
> > <[EMAIL PROTECTED]> wrote:
> > 
> >> How is the range specified?
> > 
> > 
> > In the database the IP is 1.2.3.4 and the range is eg: 65536
> 
> I don't quite understand. To continue your example, exactly which IP
> addresses are considered to fall into the range "65536"? How do you
> figure 1.2.3.4 is in this range, if indeed it is?
> 
> Igor Tandetnik
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Selection Time

2006-11-28 Thread Lloyd
Hi,
  How much time can it take to perform 2000 selection queries on the
same database ?  Mostly the result set will contain only 1 raw. Is there
is any way to improve the selection speed?

Thanks,
  Lloyd


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Music Files

2006-11-27 Thread Lloyd
I think, Through the command line mode it is impossible.

For this you have to write a program which open and reads the (binary)
data in file and inserts it to the sqlite database.

Thanks,
  Lloyd 

On Tue, 2006-11-28 at 13:36 +0800, LuYanJun wrote:
> Can anybody give a simple example for domestrating ?
> I am puzzled by this topic, how does a music file be sotred in DB as BLOB 
> type?
> 
> TKS.
> - Original Message - 
> From: "Alex Roston" <[EMAIL PROTECTED]>
> To: <sqlite-users@sqlite.org>
> Sent: Saturday, October 28, 2006 4:35 AM
> Subject: Re: [sqlite] Music Files
> 
> 
> > At one point there was a project that did something like this, and it 
> > was called Route66. I think it used mysql, perl and a player called 
> > splay. You might google it.
> > 
> > Alex
> > 
> > sebcity wrote:
> > 
> >>Is it possible to store mp3 files in a SSQLite database? would they be able
> >>to be played from the database? How would you save them?
> >>  
> >>
> > 
> > 
> > -
> > To unsubscribe, send email to [EMAIL PROTECTED]
> > -
> > 
> >


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Journal file not getting deleted

2006-11-24 Thread Lloyd
Are you forgetting to close the database?

On Fri, 2006-11-24 at 02:03 -0800, mithin wrote:
> Hi,
> 
> In my application I am using SQLite 3 c++ API. Everything works fine till my
> application is open. While doing any transaction a journal file is created.
> Once I close the app, the journal file is not getting deleted. Also, when I
> close open the application again, all the newly added data is lost.
> 
> Is there anything that I am missing?
> 
> Thanks a lot for your time.
> 


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Database Locked

2006-11-14 Thread Lloyd
Thanks Clay Dowling,

Yes there is a function for fanalize function. Now the problem is
solved.


On Tue, 2006-11-14 at 08:02 -0500, Clay Dowling wrote:
> Lloyd,
> 
> You need at some point to call the sqlite3_finalize function.  I don't use
> wxSqlite, but if it's not handled by the destructor of the recordset then
> there should be a method, possibly called finalize or close, that needs to
> be called.  I recommend consulting the documentation for wxSQLite since
> most of the wxWidgets components are pretty well documented.
> 
> Clay Dowling
> 
> Lloyd said:
> > I have tracked down the problem and found th following.
> >
> > I have a select statement which stores the result set in a pointer
> > variable. If the result set of select statement is empty, the program
> > executes, otherwise it gives a Database Locked error.
> >
> > How can I solve this problem ?
> >
> > Thanks again,
> >   Lloyd.
> >
> >
> >
> > On Wed, 2006-11-15 at 14:46 +0530, Lloyd wrote:
> >> Hi,
> >>   I have opened a database, created tables and inserted data to it in a
> >> single transaction. Then I have closed the data base. Then I reopened
> >> the database and tried to update the table entries. But it throws an
> >> exception called Database Locked. Where can be the mistake? I am using
> >> wxSqlite3 wrapper class. All these are performed from a single program.
> >>
> >> Thanks,
> >>   Lloyd.
> >>
> >>
> >> __
> >> Scanned and protected by Email scanner
> >>
> >> -
> >> To unsubscribe, send email to [EMAIL PROTECTED]
> >> -
> >
> >
> > __
> > Scanned and protected by Email scanner
> >
> > -
> > To unsubscribe, send email to [EMAIL PROTECTED]
> > -
> >
> >
> 
> 


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Database Locked

2006-11-14 Thread Lloyd
I have tracked down the problem and found th following.

I have a select statement which stores the result set in a pointer
variable. If the result set of select statement is empty, the program
executes, otherwise it gives a Database Locked error.   

How can I solve this problem ?

Thanks again,
  Lloyd.



On Wed, 2006-11-15 at 14:46 +0530, Lloyd wrote:
> Hi,
>   I have opened a database, created tables and inserted data to it in a
> single transaction. Then I have closed the data base. Then I reopened
> the database and tried to update the table entries. But it throws an
> exception called Database Locked. Where can be the mistake? I am using
> wxSqlite3 wrapper class. All these are performed from a single program. 
> 
> Thanks,
>   Lloyd.
> 
> 
> __
> Scanned and protected by Email scanner
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Database Locked

2006-11-14 Thread Lloyd
Hi,
  I have opened a database, created tables and inserted data to it in a
single transaction. Then I have closed the data base. Then I reopened
the database and tried to update the table entries. But it throws an
exception called Database Locked. Where can be the mistake? I am using
wxSqlite3 wrapper class. All these are performed from a single program. 

Thanks,
  Lloyd.


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] PHP5 with SQLite3

2006-11-08 Thread Lloyd Thomas


- Original Message - 
From: "Rúben Lício" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, November 08, 2006 1:03 PM
Subject: [sqlite] PHP5 with SQLite3


Are you connecting correctly to the database. Which version of sqlite3 was 
the database created in. I beleive php5.1 is version 3.2.8



Hi,

I'm trying to use PHP5 with SQLite 3, but it's not working.

I see then the native PHP only suporte SQLite 2.8, but i can compile last
version of php with SQLite 3 suport.

O compile last PHP version with this line:
make clean && ./configure --prefix=/usr/local/php5 --enable-pdo
--with-sqlite=shared --with-pdo-sqlite=shared --with-zlib
--enable-track-vars --with-apxs2=/usr/local/apache2/bin/apxs
--enable-sqlite-utf8 && make && make install

phpinfo tell-me that it is ok with SQLite 3 suport. But when I try to
execute query, i have that exception message:
'PDOException' with message 'SQLSTATE[HY000]: General error: 1 SQL logic
error or missing database' in ...

Anybody know how to correct that problem?

ty

Ruben

--
Linux user #433535
Linux because we are freedon.




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Date and time

2006-11-07 Thread Lloyd

Thanks Craig Morrison. Now I got the idea clearly.

On Wed, 2006-11-08 at 00:55 -0500, Craig Morrison wrote:
> Lloyd wrote:
> >  select datetime(1162961284,'unixepoch','localtime');
> > 
> >  2006-11-08 10:18:04
> > 
> > The result is correct.
> > 
> > I would like to know how sqlite is performing the localtime correction. 
> 
> timestamps are in relation to UTC.. When you use the localtime modifier, 
> you are instructing the code to adjust the timestamp display in 
> accordance with your local settings. IOW, the offset from UTC of your 
> system is used in the calculation of the displayed date.
> 
> Google: "strftime", "asctime" and "localtime" for a better explanation.
> 


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Date and time

2006-11-07 Thread Lloyd
Hi,

I felt sqlite's date and time functions are very useful and suits my
needs.

But still am not clear about one thing. I gave the following query

select datetime(1162961284,'unixepoch');

2006-11-08 04:48:04

The date is correct but the time is 5 hours lagging. So for local time
correction I gave the following query

 select datetime(1162961284,'unixepoch','localtime');

 2006-11-08 10:18:04

The result is correct.

I would like to know how sqlite is performing the localtime correction. 

My problem is, I am getting these time stamps from network packets, And
I want to  display it accurately. (as in the localtime).

Which way can I prefer ?

Thanks,
  Lloyd.



__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Retrieving date

2006-11-07 Thread Lloyd
Hi,
  I stored a unix epoch (32 bit integer) date in the sqlite data base. I
want to retrieve it in the readable date format. For that I use the
following query

select datetime(sdate,'unixepoch') from mytab;

It shows a formatted date, but there is some changes in the hours.

How can I retrieve the accurately converted date and time ?

Thanks,
 Lloyd.


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Date data type

2006-11-07 Thread Lloyd
Thanks gg and Craig Morrison for your informative reply.

I would like to know one more thing, can I use these date and time
functions with comparison operators? Will they return the correct result
or as per the string comparison rules?

Thanks again,
  Lloyd.

On Tue, 2006-11-07 at 04:25 -0500, Craig Morrison wrote:
> Lloyd wrote:
> > Hi,
> >   How can I manage date and time using sqlite? [Do I have to do it
> > outside sqlite?]
> 
> http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions
> 


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Date data type

2006-11-07 Thread Lloyd
Hi,
  How can I manage date and time using sqlite? [Do I have to do it
outside sqlite?]

Thanks,
  Lloyd. 


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] sqlite backup from the program.

2006-11-03 Thread Lloyd K. L
Whether your database creation error solved? what was the problem?


- Original Message -
From: <[EMAIL PROTECTED]>
To: 
Sent: Friday, November 03, 2006 2:18 PM
Subject: [sqlite] sqlite backup from the program.



Hi All,

How to take a backup of the sqlite database (dump) from the
C program.

Is there any C API for that? Or is there any mechanism to achieve it?



Please throw some light on it.



Thanks in Advance,

Regards,

Ravi K






The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain proprietary, confidential or privileged information. If you are not
the intended recipient, you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately and destroy all copies of this
message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.

www.wipro.com


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] sqlite backup from the program.

2006-11-03 Thread Lloyd K. L
SQLite database is stored as a normal file in the disk. Why dont you use
Operating System calls to back up the file?



- Original Message -
From: <[EMAIL PROTECTED]>
To: 
Sent: Friday, November 03, 2006 2:18 PM
Subject: [sqlite] sqlite backup from the program.



Hi All,

How to take a backup of the sqlite database (dump) from the
C program.

Is there any C API for that? Or is there any mechanism to achieve it?



Please throw some light on it.



Thanks in Advance,

Regards,

Ravi K






The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain proprietary, confidential or privileged information. If you are not
the intended recipient, you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately and destroy all copies of this
message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.

www.wipro.com


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Memory Usage

2006-10-30 Thread Lloyd
I don't know whether I am right in this perspective. Just to know
whether sqlite is causing the high memory usage, comment the commands
(statements)  related to sqlite and check the memory status.  

Thanks,
  Lloyd.

On Mon, 2006-10-30 at 12:45 +, Nuno Lucas wrote:
> On 10/30/06, Ben Clewett <[EMAIL PROTECTED]> wrote:
> > Nuno,
> >
> > Thanks for the excelent description of my error.  I have learnt a little
> > more about Linux virtual memory model.  Very glad to hear Sqlite is as
> > perfect as ever :)
> >
> > My problem, which is definitely my problem, is that 90 x 16MB of
> > reserved memory is still a loss of 1.4G.  Especially as I use hardly any
> > of it.
> 
> Each process has it's own virtual address space, so 16MB of reserved
> virtual addresses (except when they are kernel addresses) for one
> process doesn't do nothing to the ammount of virtual addresses free
> for other processes. And as each process usually has 2/3GB of virtual
> addresses for it's own use, 16MB is pretty low (it depends on the
> system, but 2 GB is the most common minimum, on 32 bits).
> 
> I still find strange that your program uses so much virtual addresses,
> but you didn't specify (or I don't recall) what language you are using
> and what libraries you are linking to. You may want to investigate
> this further.
> 
> 
> Regards,
> ~Nuno Lucas
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Regarding sqlite3_open

2006-10-28 Thread Lloyd
Which platform are you using? Do you (application) have enough
permission to create files in the specified location ?

On Sat, 2006-10-28 at 16:19 +0530, [EMAIL PROTECTED] wrote:
> Hi All,
> 
> I am using sqlite3_open() in my program. It is returning
> error code 14(file not found) every time.
> 
> Where does it search for the file? I even tried with the fully qualified
> path, Also placing the file in the working directory. Even if the file
> does not exist, it should create the file and return SQLITE_OK.
> 
> Please throw some light on it.
> 
> 
> 
> Thanks,
> 
> Regards,
> 
> Ravi K
> 
> 
> 
> 
> 
> 
> The information contained in this electronic message and any attachments to 
> this message are intended for the exclusive use of the addressee(s) and may 
> contain proprietary, confidential or privileged information. If you are not 
> the intended recipient, you should not disseminate, distribute or copy this 
> e-mail. Please notify the sender immediately and destroy all copies of this 
> message and any attachments.
> 
> WARNING: Computer viruses can be transmitted via email. The recipient should 
> check this email and any attachments for the presence of viruses. The company 
> accepts no liability for any damage caused by any virus transmitted by this 
> email.
> 
> www.wipro.com


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Memory Usage

2006-10-27 Thread Lloyd
Most probably it will be a memory leak in your program. We must release
the dynamically allocated memory ourselves. So check whether you are
forgetting to do that. Most probably that leak will be happening inside
some loops or repeatedly calling functions.


On Fri, 2006-10-27 at 17:00 +0100, Ben Clewett wrote:
> Dear Sqlite,
> 
> I very much enjoy using Sqlite, it is extremely useful.
> 
> I have a memory usage query.
> 
> I am linking to libsqlite3.so.0.8.6.  After calling sqlite3_open(...) I 
> find my programs data memory jumps by 16392 Kb.
> 
> This seems a lot.  The database I am opening is only 26K in size.
> 
> I have a similar process opening about 90 times.  This obviously 
> consumes a very large amount of memory, 1.4G with 90 processes.
> 
> May I ask if this is what would be expected, and whether there is 
> anything I can do to lower this loading?
> 
> Thanks for your help,
> 
> Ben.
> 
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] reg:SqliteDB file

2006-10-27 Thread Lloyd
Whether your question mean to open database file which is in some other
location?

If yes,

 we will be using the 


int sqlite3_open(const char *filename,sqlite3 **ppDb);


call to open the database. In that we will have to mention the file
name. There instead of using the file name simply, give the full path of
the file. It will work fine.

Thanks,
  Lloyd.

On Fri, 2006-10-27 at 12:17 +0530, sandhya wrote:
> Hi,
>Is it possible to refer db file from other than the Current project 
> location.If Yes,How can we refer(tell) the location of the DB file to the 
> project.Please help me.
> 
> Thank you all,
> - Sandhya


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: number problem with 3.2.8

2006-10-25 Thread Lloyd Thomas
I did try number literal  >10 but mad no difference. I will rebuild the 
database row as an integer.

Lloyd
- Original Message - 
From: "Igor Tandetnik" <[EMAIL PROTECTED]>

To: "SQLite" <sqlite-users@sqlite.org>
Sent: Thursday, October 26, 2006 12:21 AM
Subject: [sqlite] Re: number problem with 3.2.8



Lloyd Thomas
 wrote:

I am using sqlite 3.2.8 which is included in PHP5.1. I seem to be
having a problem doing queries where with '>' to search a number.
for instance if I do the following

select  ring_time fron calls where ring_time > '10';
I get the following results
3
6
3
6
3
6
2
3
3
3
2
etc.
Why?
This row is varchar. Is 3.2.8 not able to work with numbers stored as
varchar?


I don't see any problem. '3' is indeed greater than '10' in alphabetic 
order. What did you expect?


If you want the values to compare as numbers, why do you store them in a 
string field, and why do you compare against a string literal '10' rather 
than numeric literal 10 ?


Igor Tandetnik

-
To unsubscribe, send email to [EMAIL PROTECTED]
-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] number problem with 3.2.8

2006-10-25 Thread Lloyd Thomas
I am using sqlite 3.2.8 which is included in PHP5.1. I seem to be having a 
problem doing queries where with '>' to search a number.
for instance if I do the following

select  ring_time fron calls where ring_time > '10';
I get the following results
3
6
3
6
3
6
2
3
3
3
2
etc.
Why? 
This row is varchar. Is 3.2.8 not able to work with numbers stored as varchar? 


[sqlite] hexadecimal

2006-10-25 Thread Lloyd
Hi list,
  can I insert a hexadecimal value to an integer field? if yes How can
do that?

Thanks,
  Lloyd


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] encrypted file

2006-10-25 Thread Lloyd
Sorry for my mistake.

I was creating database using sqlite3 API and trying to open it with
sqlite command line client version 2.7

Thanks a lot.
Lloyd.

On Wed, 2006-10-25 at 11:51 +0530, Lloyd wrote:
> Thanks for your informative reply. 
> 
> I would like to know, whether I can open a database which is created
> using the sqlite API from a program, using the sqlite command line
> client?
> 
> [I tried it using sqlite   and it shown the
> following error-
> 
> Unable to open database "/root/userdb": file is encrypted or is not a
> database .
> 
> How can I open the database using sqlite command line? ]
> 
> Thank you very much.
> 
> Lloyd.
> 
> 
> 
> 
> On Tue, 2006-10-24 at 11:02 +, [EMAIL PROTECTED] wrote:
> > Lloyd <[EMAIL PROTECTED]> wrote:
> > > Hi List,
> > >  Whether the data base which we create through the program will be in
> > > encrypted form? 
> > 
> > The public-domain version of SQLite does not encrypt the data.
> > But commerical extensions that encrypt the data are available.
> > See, for example, http://www.hwaci.com/sw/sqlite/prosupport.html#crypto
> > 
> > > 
> > > If yes, how can I see the result in sqlite? (How can use select
> > > statements on this database?)
> > > 
> > > My application creates a database and to analyze the results in the
> > > database, it will be easy for me to use the interface provided by the
> > > sqlite. How can I open the database in SQLite ?
> > > 
> > 
> > When a database is encrypted you must supply the encryption key
> > before reading or modifying the database.  You can do this in
> > several ways.  There is a pragma:
> > 
> >PRAGMA key=?
> > 
> > If the database is being loaded using an ATTACH statement then
> > you specify the key in the USING clause of the ATTACH:
> > 
> >ATTACH DATABASE 'encrypted.db' AS e2 USING :key
> > 
> > Or you can use the C/C++ API:
> > 
> >sqlite3_key(db, zKey);
> > 
> > Once the key is established, the database content is automatically
> > decrypted as it is read from the disk and reencrypted as it is
> > written back to the disk.
> > 
> > If you use the command-line client, there is a special option
> > to specify the key:
> > 
> >sqlite3 -key 'hello' database.db
> >
> > 
> > After that the command-line client works just like it normally
> > does.
> > 
> > None of the above works in the public domain version of SQLite.
> > You have to purchase a license for a version of SQLite that 
> > supports encryption in order to use these features.
> > 
> > --
> > D. Richard Hipp  <[EMAIL PROTECTED]>
> > 
> > 
> > -
> > To unsubscribe, send email to [EMAIL PROTECTED]
> > -
> > 


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] encrypted file

2006-10-25 Thread Lloyd
Thanks for your informative reply. 

I would like to know, whether I can open a database which is created
using the sqlite API from a program, using the sqlite command line
client?

[I tried it using sqlite   and it shown the
following error-

Unable to open database "/root/userdb": file is encrypted or is not a
database .

How can I open the database using sqlite command line? ]

Thank you very much.

Lloyd.




On Tue, 2006-10-24 at 11:02 +, [EMAIL PROTECTED] wrote:
> Lloyd <[EMAIL PROTECTED]> wrote:
> > Hi List,
> >  Whether the data base which we create through the program will be in
> > encrypted form? 
> 
> The public-domain version of SQLite does not encrypt the data.
> But commerical extensions that encrypt the data are available.
> See, for example, http://www.hwaci.com/sw/sqlite/prosupport.html#crypto
> 
> > 
> > If yes, how can I see the result in sqlite? (How can use select
> > statements on this database?)
> > 
> > My application creates a database and to analyze the results in the
> > database, it will be easy for me to use the interface provided by the
> > sqlite. How can I open the database in SQLite ?
> > 
> 
> When a database is encrypted you must supply the encryption key
> before reading or modifying the database.  You can do this in
> several ways.  There is a pragma:
> 
>PRAGMA key=?
> 
> If the database is being loaded using an ATTACH statement then
> you specify the key in the USING clause of the ATTACH:
> 
>ATTACH DATABASE 'encrypted.db' AS e2 USING :key
> 
> Or you can use the C/C++ API:
> 
>sqlite3_key(db, zKey);
> 
> Once the key is established, the database content is automatically
> decrypted as it is read from the disk and reencrypted as it is
> written back to the disk.
> 
> If you use the command-line client, there is a special option
> to specify the key:
> 
>sqlite3 -key 'hello' database.db
>
> 
> After that the command-line client works just like it normally
> does.
> 
> None of the above works in the public domain version of SQLite.
> You have to purchase a license for a version of SQLite that 
> supports encryption in order to use these features.
> 
> --
> D. Richard Hipp  <[EMAIL PROTECTED]>
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
> 


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] encrypted file

2006-10-24 Thread Lloyd
Hi List,
 Whether the data base which we create through the program will be in
encrypted form? 

If yes, how can I see the result in sqlite? (How can use select
statements on this database?)

My application creates a database and to analyze the results in the
database, it will be easy for me to use the interface provided by the
sqlite. How can I open the database in SQLite ?

Thanks,
  Lloyd.


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] insertion time

2006-10-23 Thread Lloyd
Hi,
  When this 3M inserts are performed, it takes 130 more seconds compared
to the actual application running time. The actual application run time
is 20 seconds but when this 3M inserts are performed it takes 150
seconds.

Is there any way to reduce the time ?

Thnaks,
  Lloyd.



On Mon, 2006-10-23 at 08:44 -0600, Dennis Cote wrote:
> Lloyd wrote:
> > Hi,
> >   How much time it may take to "insert or ignore into query" for 30
> > lakhs times. It adds more than 130 sec overhead compared to the 20 sec
> > of execution time. All these are done inside a single transaction. And
> > these insertions are made on three tables (on each table 10 lakhs) with
> > a combined primary key of text and integer.
> >
> > Is this the expected performance? Can I improve it anyway? (I am using
> > the wxSQLite wrapper class)
> >
> > Thanks,
> >   Lloyd.
> >
> >
> > __
> >   
> All,
> 
> FYI, a lakh is defined as:
> 
> A lakh (also spelled lac or laksha) is a unit in a traditional number 
> system, still widely used in India and Bangladesh, equal to a hundred 
> thousand. A hundred lakhs make a crore.
> 
> So Lloyd is doing 3M insert or ignores.
> 
> Lloyd,
> 
> What do you mean by "130 seconds of overhead"?
> 
> Dennis Cote
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] insertion time

2006-10-23 Thread Lloyd
Hi,
  How much time it may take to "insert or ignore into query" for 30
lakhs times. It adds more than 130 sec overhead compared to the 20 sec
of execution time. All these are done inside a single transaction. And
these insertions are made on three tables (on each table 10 lakhs) with
a combined primary key of text and integer.

Is this the expected performance? Can I improve it anyway? (I am using
the wxSQLite wrapper class)

Thanks,
  Lloyd.


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Inserting uniquely

2006-10-20 Thread Lloyd
Hi List,
  Is there is any easy way to insert a value to a table, if and only if
it is not existing ? 

For example.

If I have these values 1,2,3,4,1,2,3,4
when I insert these to a table

it must be 
1
2
3
4

[By using primary key or unique constraint, it will work. But I dont
want sqlite to throw error]

How can I get this done?

Thanks,
  Lloyd. 


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] See table structure

2006-10-20 Thread Lloyd
Hi List,
  In SQLite, to see the table structure which command can I use? 
  (as in Oracle's desc  )
Thanks,
  Lloyd



__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] wxSqlite- Long Insertion time

2006-10-10 Thread Lloyd

> Are these inserts in 1 transaction or 1000?

Yes it is in 1000 transactions.

For me consistancy, atomicity...(ACID) are not a problem. But the speed
of operation is major constraint. How can I achieve speed in insertion
cases like this? 

Thanks for your informative reply.

Lloyd.

On Tue, 2006-10-10 at 12:51 +0100, Martin Jenkins wrote:
> Lloyd wrote:
> > Where could be the problem? The insert query is executing only 1000 
> > times.
> 
> Are these inserts in 1 transaction or 1000? If the latter then it will 
> take a long time because sqlite has to wait 1000 times for the data to 
> be written to the disk. It's generally accepted that this takes about 2 
> revs of the disk - 2000 revs at 7200rpm is about 20 seconds.
> 
> Martin
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] wxSqlite- Long Insertion time

2006-10-10 Thread Lloyd
Hi All,
  I am using wxSqlite to develop my application. I have an insert query
in my application. It adds a 16 seconds overhead to my application,
otherwise it executes in 20 seconds. (Now it needs 36 seconds!). 

Where could be the problem? The insert query is executing only 1000
times.

Thanks,
  Lloyd.


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Regarding sqlite3_exec

2006-10-06 Thread Lloyd
I think you are asking for this... This is the case when we use
wxSQLite3.


wxSQLite3ResultSet result = samp.ExecuteQuery(wxT("select name,age from
test"));

  while (result.NextRow())
  {
   cout << (const char*)(result.GetString(0).mb_str()) << result.GetInt
(1)<< endl;
  }

On Fri, 2006-10-06 at 17:07 +0530, Vivek R wrote:
> Hi List,
>   If I use sqlite3_exec to query a database,
> How can I know that the results in the data base got over. For example If
> I am expecting a 10 results in some for loop and actually there are only
> five results , How can I get a notification or return value that the
> results completed or Is there any way I can get SQLITE_DONE through
> sqlite3_Exec.  What return value I will get If I query an empty table.
> 
> 
> Thanks and Regards,
>   Vivek R


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Installing Library

2006-10-03 Thread Lloyd
Hi All,
  I have downloaded the SQLite library (sqlite-3.3.7.so.gz) from the
homepage. But I don't know how to install it. Please help me. My Redhat
Enterprise Linux machine runs on i386 architecture. 

Thanks and Regards,
  Lloyd.



__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] SQLite under linux

2006-09-27 Thread Lloyd
Thanks everybody, I have downloaded the library RPM from
http://rpm.pbone.net/

and the library name is 

libsqlite-3.2.1-1.i386.rpm

It may be useful for newbie like me...

and did as what you said. And works fine...

Thanks, 
 Lloyd.


On Wed, 2006-09-27 at 10:08 +0200, Markus Hoenicka wrote:
> Lloyd <[EMAIL PROTECTED]> was heard to say:
> 
> > Unfortunately, I don't know how to install this library in my system.
> > Please help me.. If I am dealing with the wrong file, please let me know
> > from where I can get the needed installable library.
> >
> 
> Maybe you should tell us which system you run. Most Linux distributions offer
> SQLite as an easy-to-install package. E.g. on Debian you'd do something like:
> 
> apt-get install libsqlite3-dev libsqlite3-0 sqlite3
> 
> Once that is installed, you'll just have to insert the sqlite header file into
> your sources and add -lsqlite3 to your gcc command line in order to build an
> app that uses SQLite.
> 
> regards,
> Markus
> 


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] SQLite under linux

2006-09-26 Thread Lloyd
On Tue, 2006-09-26 at 19:18 +0100, Martin Jenkins wrote:
> If all you want to do is build an application using (some version of) 
> sqlite then just download the library and link against it - you don't 
> have to download the SQLite source and build it.
> 

Thanks Martin, I too wanted the same only. But I don't know how to
download and install the library on my Linux. I went to the download
section of the SQLite site and found  a file called sqlite-3.3.7.so.gz.
I think this is the library which I want.

Unfortunately, I don't know how to install this library in my system.
Please help me.. If I am dealing with the wrong file, please let me know
from where I can get the needed installable library.

Thanks for your clear and patient reply.

Thanks,
  Lloyd. 




__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] SQLite under linux

2006-09-26 Thread Lloyd
Hi,
  This too doesn't work. First of all I did not install the library,
instead I copied the sqlite-3.3.7.so file to the lib folder. Then ran
the ldconfig command. Then I compiled gcc sqlite.c -o sqlite -
l /usr/lib/sqlite-3.3.7

It is giving the error ld connot find the file
called /usr/lib/sqlite-3.3.7

How can I solve this? From where do I can get an installable copy if the
SQLite library for linux?

Thanks,
 Lloyd.

On Tue, 2006-09-26 at 13:17 +0100, Lloyd Thomas wrote:
> Hi Lloyd,
> I had exactly the same problem being new to C++. These are the 
> steps I took. You may find that the library files may be in a folder where 
> RH does not expect them to be. Try 'whereis libsqlite3.so' to locate. I 
> can't remember where the default lib folder is. you will need to 
> add -lsqlite3 in your Makefile or compile your code with -lsqlite3. You 
> don't mention what errors you get when the make files. Some may be able to 
> help you further if they have that information.
> 
> Lloyd T
> 
> ----- Original Message - 
> From: "Lloyd" <[EMAIL PROTECTED]>
> To: <sqlite-users@sqlite.org>
> Sent: Tuesday, September 26, 2006 12:45 PM
> Subject: [sqlite] SQLite under linux
> 
> 
> > Hi all,
> >  I have been trying to use SQLite with Redhat EL 4. I dont know how to
> > link the object file. I have downloaded the sqlite-3.3.7.so. but I don't
> > know how to link my source file with this file.
> >
> > As mentioned in the quick start guide I have copied the example source
> > code for C.
> >
> > though I could not find the sqlite3.h file, I downloaded the source code
> > file of the sqlite and executed the ../configure command. it worked file
> >
> > then I tried to "make"  the file, but it failed,  any how I got the
> > necessary sqlite3.h file.
> >
> > But still I don't know from where to download the sqlite library and how
> > to install it in my machine. Awaiting for your kind reply.
> >
> > Thanks and regards,
> >  Lloyd.
> >
> >
> > __
> > Scanned and protected by Email scanner
> >
> > -
> > To unsubscribe, send email to [EMAIL PROTECTED]
> > -
> > 
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] SQLite under linux

2006-09-26 Thread Lloyd
e type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type
.../src/tclsqlite.c:152: error: dereferencing pointer to incomplete type




and the error continues


How can I resole this. Please help me...

Can I use the library alone without recompiling the whole sqlite? (Thus
it will be easier for me to distribute my application along with sqlite)


Thanks and regards,
  Lloyd. 







On Tue, 2006-09-26 at 07:52 -0400, Mark Richards wrote:
> To use the library, either in shared or static mode, you must first 
> build it successfully and then install it,
> 
> Please tell us your build procedure and any errors you got.
> 
> /m
> 
> Lloyd wrote:
> > 
> > then I tried to "make"  the file, but it failed,  any how I got the
> > necessary sqlite3.h file.
> > 
> > But still I don't know from where to download the sqlite library and
how
> > to install it in my machine. Awaiting for your kind reply.
> > 
> 
> 
>
-
> To unsubscribe, send email to [EMAIL PROTECTED]
>
-




__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] SQLite under linux

2006-09-26 Thread Lloyd Thomas

Hi Lloyd,
   I had exactly the same problem being new to C++. These are the 
steps I took. You may find that the library files may be in a folder where 
RH does not expect them to be. Try 'whereis libsqlite3.so' to locate. I 
can't remember where the default lib folder is. you will need to 
add -lsqlite3 in your Makefile or compile your code with -lsqlite3. You 
don't mention what errors you get when the make files. Some may be able to 
help you further if they have that information.


Lloyd T

- Original Message - 
From: "Lloyd" <[EMAIL PROTECTED]>

To: <sqlite-users@sqlite.org>
Sent: Tuesday, September 26, 2006 12:45 PM
Subject: [sqlite] SQLite under linux



Hi all,
 I have been trying to use SQLite with Redhat EL 4. I dont know how to
link the object file. I have downloaded the sqlite-3.3.7.so. but I don't
know how to link my source file with this file.

As mentioned in the quick start guide I have copied the example source
code for C.

though I could not find the sqlite3.h file, I downloaded the source code
file of the sqlite and executed the ../configure command. it worked file

then I tried to "make"  the file, but it failed,  any how I got the
necessary sqlite3.h file.

But still I don't know from where to download the sqlite library and how
to install it in my machine. Awaiting for your kind reply.

Thanks and regards,
 Lloyd.


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] SQLite under linux

2006-09-26 Thread Lloyd
Hi all,
  I have been trying to use SQLite with Redhat EL 4. I dont know how to
link the object file. I have downloaded the sqlite-3.3.7.so. but I don't
know how to link my source file with this file. 

As mentioned in the quick start guide I have copied the example source
code for C.

though I could not find the sqlite3.h file, I downloaded the source code
file of the sqlite and executed the ../configure command. it worked file

then I tried to "make"  the file, but it failed,  any how I got the
necessary sqlite3.h file.

But still I don't know from where to download the sqlite library and how
to install it in my machine. Awaiting for your kind reply.

Thanks and regards,
  Lloyd.


__
Scanned and protected by Email scanner

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Compiling PHP5 in order to use SQLite3

2006-09-15 Thread Lloyd Thomas
I far as i know you compile with php5-pdo-sqlite, but this was only tested 
on debian. Last time i looked this supports sqlite 3.2.8 and you have to use 
php's pdo functions and not the sqlite functions which only work with v2.


- Original Message - 
From: "Michael Young" <[EMAIL PROTECTED]>

To: 
Sent: Friday, September 15, 2006 10:42 PM
Subject: [sqlite] Compiling PHP5 in order to use SQLite3



I'm not a Unix programmer, but I would like to compile PHP5 so that
it will be able to read/write SQLite3 files on my Mac.

In particular, I have tried to follow the installation script
suggested at www.phpmac.com for Apache 2.2.2 and PHP 5.1.4. However,
this only results in a compilation that recognizes SQLite2 files.

If anyone can offer advice on compiling on Mac OS Tiger, I would be
most appreciative. Thanks in advance.

Here's the script (modified in bold from the one suggested at
www.phpmac.com) I have been using without success:

./configure --prefix=/apache2/php --with-zlib --enable-pdo=shared -- 
with-pdo-sqlite=shared --with-sqlite=shared --with-xml --with-ldap=/
usr --enable-cli --with-zlib-dir=/usr --enable-exif --enable-ftp -- 
enable-mbstring --enable-mbregex --enable-dbx --enable-sockets --with-

iodbc=/usr --with-curl=/usr --with-apxs2=/apache2/bin/apxs

Regards,
Mike







-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: Re[2]: [sqlite] A lillte help adding sqlite to a c program

2006-09-11 Thread Lloyd Thomas
I am still having some problems compiling my code. I suspect it maybe 
something to do with my app not linking (ld) with sqlite libraries, but I do 
not know how to do this or it could be something else.

Can you advise?
-
/usr/src/logger-1.2-beta3/src/logger.cpp:731: undefined reference to 
`sqlite3_open'
logger.o(.text+0xc99):/usr/src/logger-1.2-beta3/src/logger.cpp:732: 
undefined reference to `sqlite3_exec'
logger.o(.text+0xcae):/usr/src/logger-1.2-beta3/src/logger.cpp:735: 
undefined reference to `sqlite3_free'
logger.o(.text+0xcbf):/usr/src/logger-1.2-beta3/src/logger.cpp:737: 
undefined reference to `sqlite3_close'

collect2: ld returned 1 exit status
make: *** [logger] Error 1



- Original Message - 
From: <[EMAIL PROTECTED]>

To: 
Sent: Sunday, September 10, 2006 1:32 PM
Subject: Re: Re[2]: [sqlite] A lillte help adding sqlite to a c program


On Sun, 10 Sep 2006 13:02:58 +0100, you wrote:


Thanks Teg,
I have been trying to do using a basic example but still
running into problems. Can you expand a little more on your example below.
This is where I am so far.
I am getting a bit closer bit still getting some errors. clearly I am still
getting something wrong with the format of snprintf. any ideas?


Hello Lloydie

If you use a MS Compiler like VC++ 6 or VC++ 7 Net you can look at
my HP. There is a little Example and a Wrapperclass simple to
understand, desgined to handle small Databases.

http://www.thlu.de

Best Regards
Thomas


-
To unsubscribe, send email to [EMAIL PROTECTED]
-


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: Re[2]: [sqlite] A lillte help adding sqlite to a c program

2006-09-10 Thread Lloyd Thomas

Nearly there just a couple of outstanding issues any help apreciated

Error:--
make: Warning: File `logger.cpp' has modification time 45 s in the future
g++  -c -Wall -O -g logger.cpp -o logger.o
logger.cpp: In function `void* start_one_channel(void*)':
logger.cpp:607: warning: format argument is not a pointer (arg 6)
logger.cpp:629: error: jump to case label
logger.cpp:603: error:   crosses initialization of `char*zErrMsg'
make: *** [logger.o] Error 1



code sample:---
char *zErrMsg = 0;
   char sql[200];
   int rc;
   sqlite3 *db;
   sprintf(sql, "insert into call_data (direction, call_time, dest, 
trunk_no, file_name)values('%s','%s','%s','%s','%s')", details.inout, 
details.statime,details.cidn,channel,details.filename);

   rc = sqlite3_open("/var/tmp/logger/database/logger.db", );
   rc = sqlite3_exec(db, sql, NULL, 0, );
   if( rc!=SQLITE_OK ){
   //fprintf(stderr, "SQL error: %s\n", zErrMsg);
   sqlite3_free(zErrMsg);
   }
   sqlite3_close(db);
   LOGIT("[%02d] sql string = %s\n",channel,sql);


 // Clear out details ready for next call
 details.inout[0] = 0;
 details.filename[0] = 0;
 details.statime[0] = 0;
 details.endtime[0] = 0;
 details.cidn[0] = 0;
 details.cidt[0] = 0;
 strcpy(details.term, "");
   break;

default:  // Any thing else ??
 break;

}
break;
-


- Original Message - 
From: <[EMAIL PROTECTED]>

To: 
Sent: Sunday, September 10, 2006 1:32 PM
Subject: Re: Re[2]: [sqlite] A lillte help adding sqlite to a c program


On Sun, 10 Sep 2006 13:02:58 +0100, you wrote:


Thanks Teg,
I have been trying to do using a basic example but still
running into problems. Can you expand a little more on your example below.
This is where I am so far.
I am getting a bit closer bit still getting some errors. clearly I am still
getting something wrong with the format of snprintf. any ideas?


Hello Lloydie

If you use a MS Compiler like VC++ 6 or VC++ 7 Net you can look at
my HP. There is a little Example and a Wrapperclass simple to
understand, desgined to handle small Databases.

http://www.thlu.de

Best Regards
Thomas


-
To unsubscribe, send email to [EMAIL PROTECTED]
-


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: Re[2]: [sqlite] A lillte help adding sqlite to a c program

2006-09-10 Thread Lloyd Thomas

Thanks Teg,
   I have been trying to do using a basic example but still 
running into problems. Can you expand a little more on your example below. 
This is where I am so far.
I am getting a bit closer bit still getting some errors. clearly I am still 
getting something wrong with the format of snprintf. any ideas?

errors:
logger.cpp: In function `void* start_one_channel(void*)':
logger.cpp:607: error: invalid conversion from `const char*' to `size_t'
logger.cpp:607: error:   initializing argument 2 of `int snprintf(char*, 
size_t, const char*, ...)'

logger.cpp:629: error: jump to case label
logger.cpp:603: error:   crosses initialization of `char*zErrMsg'
make: *** [logger.o] Error 1
---

code:-
char *zErrMsg = 0;
   char *sql;
   int rc;
   sqlite3 *db;
   snprintf(sql, "insert into call_data (direction, call_time, dest, 
trunk_no, file_name)values(\'%s\',\'%s\',\'%s\',\'%s\',\'%s\')", 
details.inout, details.statime,details.cidn, 
details.channel,details.filename);//line 607
   rc = sqlite3_open("/var/tmp/logger/database/logger.db", ); //line 
608

   rc = sqlite3_exec(db, sql, NULL, 0, );
   if( rc!=SQLITE_OK ){
   //fprintf(stderr, "SQL error: %s\n", zErrMsg);
   sqlite3_free(zErrMsg);
   }
   sqlite3_close(db);
---

Lloydie T


- Original Message - 
From: "Teg" <[EMAIL PROTECTED]>

To: "Lloyd Thomas" <sqlite-users@sqlite.org>
Sent: Sunday, September 10, 2006 12:47 AM
Subject: Re[2]: [sqlite] A lillte help adding sqlite to a c program



Hello Lloyd,

You need to escape the quotes. Remember in C and C++ " means the
beginning or end of a literal string so, when you want to embed quotes
in a string you have to escape them. Probaby \".

You'd be better off using the paramaterized version of the SQL

std::string sql = "insert into call_data (direction, call_time, dest, 
trunk_no,

file_name)values(?,?,?,?,?);";

Then bind the actual parameters after the fact.

C


Saturday, September 9, 2006, 7:02:43 PM, you wrote:

LT> Jay, Thanks for your reply.
LT> I gave it a try with and got a few errors. as follows
LT> ---
LT> logger.cpp:609: error: invalid operands of types `const char[80]' and
LT> `char[4]' to binary `operator+'
LT> logger.cpp:615: error: `t' was not declared in this scope
LT> logger.cpp:615: warning: unused variable 't'
LT> logger.cpp:634: error: jump to case label
LT> logger.cpp:631: error:   crosses initialization of `std::string test2'
LT> logger.cpp:628: error:   crosses initialization of `std::string test1'
LT> logger.cpp:637: error: jump to case label
LT> logger.cpp:631: error:   crosses initialization of `std::string test2'
LT> logger.cpp:628: error:   crosses initialization of `std::string test1'
LT> logger.cpp:638: error: jump to case label
LT> logger.cpp:631: error:   crosses initialization of `std::string test2'
LT> logger.cpp:628: error:   crosses initialization of `std::string test1'
LT> logger.cpp:639: error: jump to case label
LT> logger.cpp:631: error:   crosses initialization of `std::string test2'
LT> logger.cpp:628: error:   crosses initialization of `std::string test1'
LT> logger.cpp:641: error: `t' was not declared in this scope
LT> logger.cpp:641: warning: unused variable 't'
LT> logger.cpp:664: error: jump to case label
LT> logger.cpp:621: error:   crosses initialization of `bool Loop'
LT> logger.cpp:634: warning: destructor needed for `test2'
LT> logger.cpp:634: warning: where case label appears here
LT> logger.cpp:634: warning: (enclose actions of previous case statements
LT> requiring destructors in their own scope.)
LT> logger.cpp:637: warning: destructor needed for `test2'
LT> logger.cpp:637: warning: where case label appears here
LT> logger.cpp:638: warning: destructor needed for `test2'
LT> logger.cpp:638: warning: where case label appears here
LT> logger.cpp:639: warning: destructor needed for `test2'
LT> logger.cpp:639: warning: where case label appears here
LT> make: *** [logger.o] Error 1
LT> --
LT> line 609 =
LT> sql = "insert into call_data (direction, call_time, dest, trunk_no,
LT> 
file_name)values('"+details.inout+"','"+details.statime+"','"+details.cidn+"'"+details.channel+"','"+details.filename+"')";







LT> - Original Message - 
LT> From: "Jay Sprenkle" <[EMAIL PROTECTED]>

LT> To: <sqlite-users@sqlite.org>
LT> Sent: Saturday, September 09, 2006 11:16 PM
LT> Subject: Re: [sqlite] A lillte hel

  1   2   >