Re: [sqlite] a familiar name in the iPhone SDK

2008-03-06 Thread Marian Olteanu
SQLite is in iPhone since the beginning. I think that it is used in almost
any iPhone application that stores data in a structured way: Contacts, call
history, Google Maps, Safari bookmarks and history, etc, except the iPod
application. At least that's what I remember since I browsed the file system
of my jailbreaked iPhone.


On 3/6/08, P Kishor <[EMAIL PROTECTED]> wrote:
>
> -"The Media layer is everything you'd expect from Apple"
> -Also include SQLite, Core Location
> -Core OS has the OS X Kernel, Lib System, BSD TCP/IP, Sockets,
> Security, Power Mgmt, Keychain, Certificates, File System, Bonjour
> -Took everything we knew about creating stuff with Cocoa and
> everything about a touch API for iPhone to build Cocoa Touch -Cocoa is
> great, but based on mouse & keyboard input
> -Used all of the above (except Cocoa) for iPhone OS
> -Cocoa, Media, Core Services, CoreOS"
>
>
> attribution: Ars coverage at
>
> <
> http://arstechnica.com/news.ars/post/20080306-live-coverage-of-the-iphone-software-roadmap-announcement.html
> >
>
> --
> Puneet Kishor http://punkish.eidesis.org/
> Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/
> Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/
> ___
> 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


Re: [sqlite] Advice on which to use (SQLite or SQL Server) for the following app.

2009-06-11 Thread Marian Olteanu
On Thu, Jun 11, 2009 at 1:46 AM, Florian Weimer  wrote:

>  That's 500 commits per second, right?  If you need durability, you can
> get these numbers only with special hardware.
>
Not really, you don't need special hardware (if you don't use SQLite).
The use case that Robel described requires best row locks. In a RDBMS
server, nobody stops you to commit several transactions in the same time,
using the same disk spin. With SQLite you cannot, because SQLite use
database lock, so all transactions are serialized.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


RE: [sqlite] Java bindings

2006-01-31 Thread Marian Olteanu

Thank you very much!
I'll try to compile it also in Linux. If it works, I'm set. If it doesn't, 
back to square one.


On Tue, 31 Jan 2006, Tim Anderson wrote:




-Original Message-----
From: Marian Olteanu [mailto:[EMAIL PROTECTED]
Sent: 31 January 2006 05:14
To: sqlite-users@sqlite.org
Subject: [sqlite] Java bindings



any success. I failed to compile
http://www.ch-werner.de/javasqlite and
in Windows.


I've compiled this for Windows. My build is here:

http://www.itwriting.com/sqlite_jni_win.zip

(Apologies for missing link in previous message).

Note that the author also offers a binary on his site:

http://www.ch-werner.de/javasqlite/

Tim
Read my tech blog:
http://www.itwriting.com/blog




Re: [sqlite] Decimal separator

2006-01-31 Thread Marian Olteanu
The localization problem is a complex problem. Indeed, any big database 
system _should_ implement it. And yes, it can be implemented in sqlite, 
and it can be activated through a PRAGMA directive. But implementing it 
into sqlite (localization is not limited to numbers) would increase the 
size of the code, defeating the purpose of having a database with a very 
small memory footprint. Thus, probably the best solution is to have a 
standard internal representation (U.S. standard I think is fine, 
especially that Dr. Hipp is from U.S.) and a different presentation 
implemented through an optional extension, an extension that wouldn't be 
carried over by ALL sqlite users.


On Tue, 31 Jan 2006, Bert Verhees wrote:


Will Leshner wrote:



On Jan 31, 2006, at 1:42 PM, Bert Verhees wrote:

It is only the English speaking part of the world using Arabic  numerals 
is a '.',




And the Japanese speaking world :)


Yuo are right, and the South American speaking Spanish also
But the South American speaking Portuguese not, the Russian not.
The Chinese, I could not check on my Windows.

Maybe it is fifty-fifty

A pragma taking care for this could help, but, for me I have written my own 
functions, doing the translation well, it is not an issue.
Like Boguslaw, I use Delphi, I use a function like this, I am used to that, 
for many years, with many databases.


Decimalseperator is only a variable in the System-unit (I believe), changing 
it does not take much of the performance.


function Float2Str(f:Float):string
var
  olddec: char;
begin
  olddec := decimalseperator;
  decimalseperator := '.';
  Result := FloatToStr(f);
  decimalseperator := olddec;
end;

bert

end;



--
REALbasic news and tips: http://rbgazette.com
KidzMail & KidzBlog: http://haranbanjo.com








Re: [sqlite] Executing SQL from file

2006-02-01 Thread Marian Olteanu
Something related, but that doesn't really answer the question: if you 
want to populate a database with so many rows, to speed up things a lot 
you should embed them into a transaction (or in a small number of 
transactions). This way, if sqlite works synchronously, it doesn't need to 
flush data onto disk for every insert statement. I think it will work 
10-100 times faster.


On Wed, 1 Feb 2006, deBooza (sent by Nabble.com) wrote:




Hi

I'm using sqlite in a c++ program, using functions sqlite3_open, sqlite3_exec, 
sqlite3_close etc.

I am trying to import a lot of data, probably around 100,000 rows+. I have 
found it
quicker if I format the data into SQL statements and then use
the shell statement .read to read in the SQL from file and
populate the database, similar to the following:

.read c:\tmp\sql.txt

While this is a solution it's not an ideal one. I would much
prefer to do it programatically, something like this:
void main()
{
while(not end of data)
{
Write data to file
}

ExecuteSQLFromFile( SQLFile )
}

Does anyone know how to do this?

What is the equivelent to .read?

Or does anyone know of a better way?

DFB




--
View this message in context: 
http://www.nabble.com/Executing-SQL-from-file-t1040732.html#a2702793
Sent from the SQLite forum at Nabble.com.



Re: [sqlite] SQLite to MySQL

2006-02-06 Thread Marian Olteanu

There might be two possible causes for this to happen:
- query optimization - for example, complex queries are better optimized 
by MS SQL Server. I don't know about MySql. Could you post some 
problematic queries?
- concurency. SQLite is not that great about concurency. But... there was 
before the issue of writer starvation and it was fixed.  I don't know in 
which version. Maybe you should give a try to SQLite 3.3.3 and see if the 
problems persist


On Mon, 6 Feb 2006, Laurent Goussard wrote:


I don't know, I suppose my queries are not as optimized as I thought
(even if this optimization was my leitmotiv for all the development
part), or perhaps it's an apache2+php5 issue on my windows computer...

But the fact is since the database has grown (like my traffic : 6000
visitors/day and 22Mb db file), I've got more and more "maximum
execution time" errors at the peak hours. I've monitored them, and it
seems a lot of simultaneous queries are freezing the server and
finally generates this error.
The interresting point is the same queries sent a testing mysql db
while the sqlite part is not responding anymore are working very well,
So that's the reason why I consider to switch on a mysql solution for
this website.

Do you got clues concerning conversion ?


2006/2/6, Jay Sprenkle <[EMAIL PROTECTED]>:

Hi there,

I use SQLite on my website for 2 years now. I do like SQLite a lot and
will use it for a lot of new web projects but, because I got more and
more traffic, I consider to move this one to MySQL in order to reduce
the over load of my computer (I host it @ home).


How is this going to reduce load?

sqlite = mysql - server code

You're adding server code. More code = More load.





[sqlite] Prepared statements

2006-02-07 Thread Marian Olteanu
Is there a way in SQLite to use real prepared statements? Statements with 
variables, that you fill after you compile the query and reuse then reuse?


I imagine something like:
prepared_statement ps = db.prepare( "select * from tbl where c = %q' );

for( int i = 0 ; i < 100 ; i++ )
{
ps.setValue(0,i);
ps.execute(callback_handler);
}


Re: [sqlite] Prepared statements

2006-02-07 Thread Marian Olteanu

On Tue, 7 Feb 2006, [EMAIL PROTECTED] wrote:
Thank you for your answer!
Thanks the rest of you that gave me an answer to my problem!


Marian Olteanu <[EMAIL PROTECTED]> wrote:

Is there a way in SQLite to use real prepared statements? Statements with
variables, that you fill after you compile the query and reuse then reuse?

I imagine something like:
prepared_statement ps = db.prepare( "select * from tbl where c = %q' );

for( int i = 0 ; i < 100 ; i++ )
{
ps.setValue(0,i);
ps.execute(callback_handler);
}



http://www.sqlite.org/capi3ref.html#sqlite3_bind_blob


--
D. Richard Hipp   <[EMAIL PROTECTED]>




Re: [sqlite] testing Avg() function in other database engines

2006-02-08 Thread Marian Olteanu
Probably the best solution would be to have the standard implementation 
activated by a PRAGMA command. This way, you don't steal functionality 
from people who want non-standard implementation and you also don't risk 
to break compatibility with existing software over SQLite (you have 
backward compatibity).



 On Wed, 8 Feb 2006, Dennis Cote wrote:

In Summary, we have 4 database engines that appear to follow the standard, 
and 6 that do not.


Standard:
  MS SQL 2000
  Firebird 1.5
  MS SQL 2005
  DB2 8.2

Non-standard:
  MS Access
  PostgreSQL 7.3
  PostgreSQL 8.1.2
  MySQL 5.0
  Informix 7.31
  Oracle 10.1

It is also interesting to note that MySQL seems to return different precision 
for the two averages for some reason.


I would suggest that SQLite should be modified to comply with the standard 
and return an integer value for the average of a column declared as integer. 
This will eliminate the inconsistency that Richard note between avg() and 
sum()/count(). This would not change the behavior for columns declared are 
real, or columns that are untyped.


Do any of you have, or know of, an application that would be adversely 
affected if this change is made to SQLite?


Dennis Cote





Re: [sqlite] delete all tables

2006-02-09 Thread Marian Olteanu
I would say that the fastest way (CPU cycles and lines of code) to delete 
all tables would be to delete the file in which the database is stored.


On Thu, 9 Feb 2006, Xavier Noria wrote:


In the schema definition I would like to avoid the combo

  delete if exists table_name;
  create table_name ( ... );

Can I query sqlite_master about tables, indexes, etc. in a way that allows 
the deletion of everything in one shot beforehand?


-- fxn


RE: [sqlite] import

2006-02-19 Thread Marian Olteanu
dos2unix, unix2dos tools will do the conversion

-Original Message-
From: Randall [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 20, 2006 1:33 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] import

PS
I can do vbscript readline/ writeline as a workaround, not too slow...
But I would prefer not.
Randall


> Hi,
> I think it is asc=10, so "LF" rather than "CRLF", but I don't want to have

> to re-open , say a 80Mb or 0.5gig text file with a text editor, nor 
> re-process the lines!
> Surely there is an option, or this can be modified in the ".output" 
> command..?
> It is already OK in the ".dump" for  instance?..
> Thanks, Randall
>> Hello,



Re: [sqlite] import

2006-02-21 Thread Marian Olteanu

I have them installed in Windows. Cygwin brought them.

But I'm sure it's easy to find on the internet stand-alone versions of 
them. A quick google search took me to http://www.bastet.com/ for example.


On Tue, 21 Feb 2006, Jay Sprenkle wrote:


If you're on unix/linux:

cat yourfile | sed 's/\n//g' > transformed file


On 2/20/06, Marian Olteanu <[EMAIL PROTECTED]> wrote:

dos2unix, unix2dos tools will do the conversion




RE: [sqlite] File locking additions

2006-03-07 Thread Marian Olteanu
I would say that the best way to access a sqlite database mounted from a
remote file server, concurrently with other processes is through a database
server. My opinion is that the overhead of file sync and file locking for a
remote file system is higher than simple TCP/IP communication overhead. The
server would be able to use also the same cache, would have very fast access
to the file (local file), etc.

Building a server for sqlite is not a very complicated task. It can take as
few as a couple hours.


-Original Message-
From: Adam Swift [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 07, 2006 6:07 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] File locking additions

All,

In order to provide locking support for database files mounted from  
remote file systems (NFS, SMB, AFP, etc) as well as provide  
compatible locking support between database clients both local and  
remote, I would like to propose some additions to the existing  
database file locking behavior.

I have discussed this briefly with D. Richard Hipp and he has  
expressed interest in pursuing it.  We would appreciate feedback/ 
suggestions/concerns on the proposed solutions below.

1. Support a variety of locking mechanisms, from the lowest  
granularity (using a .lock file)  to the highest (the  
existing advisory locks).  A preliminary list: .lock files, flock,  
afp locks, posix advisory locks.

2. Allow clients to specify type of locking (on database open)  
manually or ask sqlite to automatically detect the best locking  
supported by the file system hosting the database file (automatic  
detection would not work in a mixed local/remote file system  
situation, all clients of a single database file need to use the same  
type of locking to avoid conflicts).

3. Extend the sqlite3_open commands to support URI style path  
references in order to specify the file system locking type (as  
opposed to modifying the arguments list).  After a little poking  
around on RFC 3986  I'm inclined  
to specify the locking choice via the query part of the URI.  For  
example:

file:///mounts/myhost/dbfile.db?locktype=flock
file:///localdisk/otherdbfile.db?locktype=automatic

Thanks in advance for your input.

Adam Swift




RE: [sqlite] File locking additions

2006-03-08 Thread Marian Olteanu
I fully agree with you. This would be an external tool. But I underlined
that building such a tool is not a big enterprise. It can be done by a good
programmer in a reasonable amount of time.

Also, I would say that perfect sync over network file systems done by sqlite
is out of sqlite's scope. Especially if this would involve custom sync
mechanisms designed for each file system.

-Original Message-
From: Jay Sprenkle [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 08, 2006 8:18 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] File locking additions

On 3/7/06, Marian Olteanu <[EMAIL PROTECTED]> wrote:
> I would say that the best way to access a sqlite database mounted from a
> remote file server, concurrently with other processes is through a
database
> server. My opinion is that the overhead of file sync and file locking for
a
> remote file system is higher than simple TCP/IP communication overhead.
The
> server would be able to use also the same cache, would have very fast
access
> to the file (local file), etc.
>
> Building a server for sqlite is not a very complicated task. It can take
as
> few as a couple hours.

I'd like to see this option built as a separate project from sqlite.
Sqlite is a great tool when you don't need a server, and I'd hate to lose
that.
Let's add more tools to our toolset instead of just morphing one into
whatever is needed at the moment.



RE: [sqlite] updating SQLite to implement The Third Manifesto

2006-03-10 Thread Marian Olteanu
You're right Darren, but the problem is that we're not in a DB class. We
cannot tell people who have a solution for their problems that "your
solution is wrong. You need to reimplement your stuff to make it right".
Most of SQLite users are practical people, and all they want is their
problem to be solved. They don't really care if the SQL language is
implementing correctly relational algebra or not.


-Original Message-
From: Darren Duncan [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 10, 2006 11:21 PM
To: sqlite-users@sqlite.org
Cc: [EMAIL PROTECTED]
Subject: Re: [sqlite] updating SQLite to implement The Third Manifesto

At 6:52 PM -0800 3/10/06, Roger Binns wrote:
>Only for some applications.  It would be harder to use for
>my apps.  Specifically manifest typing as currently implemented
>in SQLite is a perfect match for apps writen in Python (which
>also uses manifest typing).  It would require a lot more code
>to go through and force the data type for each column.

If that is so, then I would argue that any need to write more code 
isn't tied to manifest typed programming languages themselves, but 
specific programs themselves; depending on how you code your 
applications, it wouldn't require any significant amount more code. 
In fact, particularly for queries (and reading data tends to be more 
common than writing), there should be less code.  Or, looking at this 
another way, perhaps the Python bindings for SQLite should be taking 
care of this for you.  Or, put another way, I would say this is a 
small price to pay for what is gained.  Or, I doubt there actually is 
more work.

(But I don't really want to get into an argument on this point, as 
there are many other points in my proposal which I see as being of 
greater importance.)

But regardless, I have an additional idea which may help bridge the 
gap and work well for people.

That is, while the database itself is strongly typed, you can have a 
specific type which is defined to manifestly be able to store values 
from any of a variety of simpler types.

So for example, SQLite could have these types:

- Boolean
- Integer
- Real
- Text
- Blob
- Scalar

The first 5 are simple types that store just numbers or text or whatever.

The last, new 1, Scalar, is an actually-strong type which is defined 
as being able to store any of the first 5 types (just one at a time), 
and hence acts like a weak type.

In a conceptual sense, a Scalar value is like a composite type with 6 
member elements, each of the last 5 being strongly typed as one of 
the first 5 simple types, and the first element being an enum which 
says which of the other 5 holds the over-all current value.

I believe something like this is what manifestly typed languages 
actually do behind the scenes, having a multi-element struct where 
one element says how to treat the other one(s).  I know Perl does 
this, with its SV C-struct, and I'm sure other languages do similar. 
I know SQLite does something similar, if you look at its design spec.

(Sure, that sounds more complicated, but then the actual work being 
done to support manifest typing *is* more complicated.  Things look 
more like they are.)

So if SQLite does it this way, then you can declare columns to be the 
Scalar type when you want them to hold anything, and one of the other 
types if you don't.  Moreover, the effectively manifest typed Scalar 
is what you would get if you don't explicitly declare a type for a 
column.  This happens already, but now the "what you get" actually 
has a name.

The point is that you still get well defined behaviour that is 
specific to the declared data type(s) you choose to use, and you can 
count on its being consistent.

-- Darren Duncan



RE: [sqlite] Testing for table existence?

2006-04-04 Thread Marian Olteanu
sqlite_master table tells you everything about every object in the database

-Original Message-
From: Olaf Beckman Lapré [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 04, 2006 9:30 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Testing for table existence?

Thanks, I implemented this and it works.

I also stumbled upon the CREATE TABLE IF NOT EXIST syntax and I was
wondering if this wouldn't be a better idea, at the very least it would be
more convenient.

Olaf


- Original Message - 
From: "Philipp Knüsel" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, April 04, 2006 2:34 PM
Subject: Re: [sqlite] Testing for table existence?


> > Hi,
> >
> > How can I test for the existence of a single table in a SQLite database?
> >
> > I tried sqlite3_get_table with "select * from persons" to test for the
existence of the table 'persons' and I had hoped the return value would be
SQLITE_NOTFOUND in the case of a non-existent table. However, I got
SQLITE_ERROR, which is less helpfull.
> >
> > Any hints?
> >
> > Regards,
> >
> > Olaf
>
> Hello Olaf
>
> You can access the sqlite_master table.
>
> http://www.sqlite.org/cvstrac/wiki?p=InformationSchema
>
> enjoy!
>
> Philipp
>



RE: [sqlite] how to fix problem of lock

2006-04-04 Thread Marian Olteanu
How long does one INSERT take? Do you have long transactions with INSERTs?
If you have one INSERT at a time and it doesn't take too long, and still you
have reader starvation issues with the SELECTs, the only solution that I see
is to queue requests and make sure that they are served on a
first-come-first-served basis. 

-Original Message-
From: Cesar David Rodas Maldonado [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 04, 2006 1:23 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] how to fix problem of lock

Please people help me :D, the project will be open source...

On 4/4/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote:
>
> OK English is not my first language, i am from south America, from
> Paraguay so i speak Spanish...
>
> I am doing a project in C multiplataform.. right it project like google,
> for a Linux.
>
> the project uses SQ Lite for repository.
>
> The software is a server which listen connection UDP. The server could
> index (INSERT) and search within the database (SELECT).
>
> The problem is when i do so much connection at the same time for do index
> and search at the same time.
>
> Know is it clear? sorry for my english :D
>
> Thanxs
>
>
>
>
> On 4/3/06, John Stanton <[EMAIL PROTECTED]> wrote:
> >
> > Try to explain what you are doing.  How do you access SQLITE?  What
> > language?  What SQL are you using.  How many concurrent users do you
> > have?  Are you getting a LOCK error because of multiple users?
> >
> > Cesar David Rodas Maldonado wrote:
> > > please i need some help
> > > On 4/3/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote:
> > >
> > >>i insert numbers and  select numbers, so what could be the solutions,
> > >>couse i have to do that
> > >>
> > >>
> > >>On 4/3/06, Pam Greene < [EMAIL PROTECTED] > wrote:
> > >>
> > >>>An INSERT can change the results of your SELECT, so the database has
> > to
> > >>>be
> > >>>locked during INSERT.  Otherwise, the result of your SELECT would
> > depend
> > >>>on
> > >>>whether the INSERT had finished yet.  (The INSERT might even have
> > only
> > >>>partly finished, which would mean the SELECT was looking at a
> > database
> > >>>in an
> > >>>inconsistent state.)  It's not good to have unpredictable results
> > like
> > >>>that.
> > >>>
> > >>>For more explanation of why what you want isn't a good idea, see any
> > >>>discussion of an "ACID" database, for example
> > >>>http://en.wikipedia.org/wiki/ACID .
> > >>>
> > >>>- Pam
> > >>>
> > >>>On 4/3/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote:
> > >>>
> > HElp me, couse i just need to do insert and select, i dont use
> > delete
> > >>>
> > >>>or
> > >>>
> > replate or update
> > 
> > On 4/3/06, Cesar David Rodas Maldonado < [EMAIL PROTECTED] > wrote:
> > 
> > >thanx man
> > >
> > >
> > >but is posible open several DATABASE with a programm and do
> > >>>
> > >>>transaccion
> > >>>
> > >without locked the table???
> > >
> > >On 4/3/06, Jay Sprenkle < [EMAIL PROTECTED]> wrote:
> > >
> > >
> > >>On 4/3/06, Cesar David Rodas Maldonado < [EMAIL PROTECTED] > wrote:
> > >>
> > >>>I have a database ok... i do a lot of insert and select, but
> > >>>
> > there
> > 
> > >>is
> > >>
> > >>>sometime that i cant do the select couse the database is
> > >>>
> > >>>locked...
> > >>>
> > >>>i have to do a lot of insert every time, so how can i do for
> > >>>
> > >>>dont
> > >>>
> > lock
> > 
> > >>the
> > >>
> > >>>database...
> > >>>
> > >>>understand guy?
> > >>
> > >>Try this:
> > >>http://sqlite.org/lang_transaction.html
> > >>
> > >
> > >
> > 
> > >>>
> > >
> >
> >
>



RE: [sqlite] Slow performance - Unrealistic expectations?

2006-04-06 Thread Marian Olteanu
You should embed the inserts into a transaction. Otherwise every insert is a
separate ACID transaction = 2 disk spins.

-Original Message-
From: Thom Ericson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 06, 2006 10:18 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] Slow performance - Unrealistic expectations?

I am trying to pick a light weight database for a project.  SQLite, on
paper, seems like the right choice, but performance is rather
disappointing.  I hope it is just that I am doing something wrong.

I have built SQLite for Solaris and Win32 environments and I get
essentially the same results.  As I started adding more rows to my
single table the performance drops off (expected).  I start off getting
about 500 inserts per second, but after 180,000 rows, the performance
has dropped to around 3 inserts per second.  I had hoped to be able to
handle 180,000,000 rows in my largest installation (that's gonna take a
while).  The table is very simple:

sqlite3 testdb << EOF
CREATE TABLE xyz
(
str TEXT KEY NOT NULL,
parent INTEGER KEY NOT NULL
);

The "str" column is typically 10 to 20 characters and the "parent"
column is the ROWID of some pre-existing row in the table (except for
the first row, where the parent is zero).  For each new row added to the
table, there is, on average,  one select performed that produces the
rowid of another entry given specific values for str and parent.  I
enclose about 128 of these selects and insert within a
"BEGIN;"/"COMMIT;" block which increased performance, but going to
higher values does not seem to help much.

With the Solaris installation, I don't see much disk activity (possibly
all blocks are cached), on windows, I am seeing around 22,000 I/O Reads
per second.

Any hints from anyone

T




RE: [sqlite] LIKE operator with prepared statements

2006-04-06 Thread Marian Olteanu
But why don't you use

SELECT x from y WHERE y.x LIKE ? ;

and bind the first parameter to "%SomeText%" instead of "SomeText" like
before?

-Original Message-
From: Slater, Chad [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 06, 2006 6:40 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] LIKE operator with prepared statements

Is it possible to use the LIKE operator with a prepared statement? 

I'm trying to build a query that uses binding for the text in the LIKE
operation as follows:

SELECT x from y WHERE y.x LIKE %?% ;

...And binding text to the positional parameter in hopes to get:

SELECT x from y WHERE y.x LIKE %SomeText% ;

But it results in a sql parse error. Is %Q and sqlite3_mprintf my only
option here?



Chad