[sqlite] where to download previous source

2006-02-21 Thread jack wu
i need to build sqlite 328 in order to match the one that comes with php5. does 
any one know where i can download that particular version? 
   
  i was trying to use the files in $phphome/ext/pdo_sqlite/src but it seems to 
be missing some files. at least the sqlite3.h.
   
  many thanks.
   


[sqlite] using sqlite3 in php

2006-02-19 Thread jack wu
apparently sqlite3 is not available in php5. i am wondering if there is anyway 
to work around it. i have a c++ program which works with sqlite3, but i would 
also like my php script to use the same database.
   
  jack.


[sqlite] is sqlite3_open an expensive operation?

2005-10-04 Thread jack wu
do we usually do: 

open db->some operation with db->close db. 

or keep the db handle with the thread and use it all
the time?

i am asking this mainly because of possible error
conditions. when an error happens, is it better to
close the database and reopen it later? i am going to
lock the handle with a global mutex, so thread safety
is not a concern, but who knows what kind of error
could occur. i would like to handle the error nicely
and still be able to use the database. so i thought
maybe always close the database is better? 

jack.


[sqlite] on windows, can i compile sqlite using /MTd

2005-09-18 Thread jack wu

the compilation went fine, but i 'd like to double
check to see if that's allowed. as i understand sqlite
is a single thread program. but my main program is
multi-threaded, i have to use the /MTd option. Thanks.

jack.


Re: [sqlite] how to do select by Date and Time range?

2005-07-05 Thread jack wu
one more question if i may. what should i do if i 'd
like to have two columns, one for Date, one for Time
of the day. most of the times, i 'd like to query by
Date only but i want to display date and time at the
same time. is julianday('2005-07-01') going to store
any time information? Thanks.

jack.


--- Stephen Leaf <[EMAIL PROTECTED]> wrote:

> On Tuesday 05 July 2005 09:53 am, Cory Nelson wrote:
> > Just an educated guess, but probably because
> sqlite tries to be as
> > minimal as possible.  Which I have no complaints
> with, as comparing a
> > double will likely be faster than comparing a
> string.
> I personally store all mine like this anyway using
> unix time so I can change 
> the format at anytime. plus it's not only faster to
> compare programming wise, 
> just compare numbers. no need use functions.
> strings also are larger than numbers in size wise so
> you save a few bytes here 
> and there.
> >
> > On 7/5/05, Johan Danielsson <[EMAIL PROTECTED]>
> wrote:
> > > Cory Nelson <[EMAIL PROTECTED]> writes:
> > > > create table t_foo(bar real);
> > > > insert into t_foo
> values(julianday('2005-07-01'));
> > >
> > > Is there any advantage to this compared to
> storing dates as strings in
> > > (for instance) ISO8601 format?
> > >
> > > /Johan
> 



Re: [sqlite] how to do select by Date and Time range?

2005-07-04 Thread jack wu
Cory, thanks for the information. the wiki talks about
time functions. what should we do when defining the
table columns? should i just use REAL? can you give a
sample CREATE table statement? and a sample insert
statement? 


jack.





[sqlite] how to do select by Date and Time range?

2005-07-04 Thread jack wu

i have a table which has Date one the columns. i 'd
like run a query in this form:

select * from table1 where Date>date1 and Date

[sqlite] how to use the LIMIT and OFFSET?

2005-07-02 Thread jack wu


i am trying to run some web search like query. the one
that returns a total number of results and only
presents the first 20, then allows user to click on
next to go to the next 20 etc.

has anyone done this before? i suppose i would use
LIMIT or OFFSET in the select statement, but the
offset only skips certain number of results before the
results i want to show, am i right?

so if i have 60 results, using OFFSET, i could skip
the first 20, and get the rest of 40, but i can't say,
give me the second 20.

thanks for you advice


[sqlite] can i use sqlite3_column_***() function on multiple rows?

2005-04-27 Thread jack wu
documentation says if 

int sqlite3_step(sqlite3_stmt*);

returns SQLITE_ROW, (meaning a single row) then i can
use int sqlite3_column_int(sqlite3_stmt*, int iCol);
and other functions to extract the returned values out
of the row. 

can i use the same set of API on a result set which
contains multiple rows? if yes, which API do i call to
move to the next row before calling sqlite3_column_*
again?  

thanks.

jack.


[sqlite] what is the difference between TEXT and BLOB data type?

2005-04-07 Thread jack wu

other than encoded and not encoded.

i did not find the length limitations in the
documentation but seems like TEXT can only hold less
than 250 chars. is it true or is it SqliteExplorer
that only shows 250 chars. Thanks.



[sqlite] how to get the INTEGER PRIMARY KEY for the row just inserted?

2005-04-05 Thread jack wu
i have a table which has an ID column defined as
INTEGER PRIMARY KEY. I'd like to know the value of the
automatically generated ID right after the insert. is
there anyway to get the ID without issuing another
select? does the insert function return the ID in any
way? if another select is necessary, what is the best
way to do it?  this is kind of a generic problem so i
am hoping whoever solved this issue before could share
some thoughts. Thanks for the help.


jack.


Re: [sqlite] what is "in-memory SQLite database"?

2005-03-04 Thread jack wu

i am thinking of real time analysis of web logs. so it
could be huge if i save all the logs. of course 
size/system/cpu could be different depending on the
web site this application runs on.

--- Roger Binns <[EMAIL PROTECTED]> wrote:
> > i am writing an application where i need to define
> > couple of huge hash tables.
> 
> What is your idea of huge and what operating
> system/CPU are
> you running on?
> 
> Roger
> 


[sqlite] what is "in-memory SQLite database"?

2005-03-03 Thread jack wu

in the documentation: "Appropriate Uses For SQLite" it
says: 

"it is often easier and quicker to load the data into
an in-memory SQLite database and use queries with
joins and ORDER BY clauses to extract the data in the
form and order needed rather than to try to code the
same operations manually"

i am wondering if there are more
information/documentations on how to do that? 

i am writing an application where i need to define
couple of huge hash tables. i load the data from disk,
populate the hash tables and use the tables during
execution. can i replace the hash tables using SQLite?
i am new to SQLite, so any information is helpful.  

jack.