Re: [sqlite] How can I know whether the fields in the table by sql statement?

2010-02-01 Thread Jay A. Kreibich
On Tue, Feb 02, 2010 at 10:35:22AM +0800, hongbin.gao scratched on the wall:
> Usually, in SQL-server 2000, when I update fields of the table, I can use
> such sql statement:
> 
>  
> 
> if not EXISTS(select T.[name],F.[name] from sysobjects T left join
> syscolumns F on T.[id]=F.[id] where T.[name]='table_A' and
> F.[name]='field_A')
> 
> alter table table_A add field_A varchar(20) not null default ''
> 
> go
> 
> But, how can I do in sqlite ?

  PRAGMA table_info()

  http://www.sqlite.org/pragma.html#pragma_table_info


  You'll have to do it in your own code, but the info is there.


   -j


-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] How can I know whether the fields in the table by sql statement?

2010-02-01 Thread hongbin.gao
Usually, in SQL-server 2000, when I update fields of the table, I can use
such sql statement:

 

if not EXISTS(select T.[name],F.[name] from sysobjects T left join
syscolumns F on T.[id]=F.[id] where T.[name]='table_A' and
F.[name]='field_A')

alter table table_A add field_A varchar(20) not null default ''

go

 

But, how can I do in sqlite ?

 

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


Re: [sqlite] Searching for a LIKE '[0-9]%' equivalence in sqlite

2010-02-01 Thread Jay A. Kreibich
On Tue, Feb 02, 2010 at 12:55:34AM +0100, Oliver Peters scratched on the wall:
> Am Montag, den 01.02.2010, 22:55 +0100 schrieb Jean-Christophe
> Deschamps:
> 
> [...]
> > 
> > Try this:
> > 
> > SELECT * FROM mytable WHERE myfield glob '[0-9]*'
> 
> thank you for opening my eyes - it seems that I never read
> http://www.sqlite.org/lang_expr.html#glob with total awareness.
> 
> "The GLOB operator [...] uses the Unix file globbing syntax for its
> wildcards."
> 
> But the reason might be that I usually don't use Linux for shell
> operations because in the office I've to use WinXP. Maybe someone could
> replenish the documentation with a few examples for the disadvantaged MS
> users?

  From the source code...   Note that the glob expression is the "first"
  string because the glob() SQL function reverses the order of the
  parameters.


/*
** Compare two UTF-8 strings for equality where the first string can
** potentially be a "glob" expression.  Return true (1) if they
** are the same and false (0) if they are different.
**
** Globbing rules:
**
**  '*'   Matches any sequence of zero or more characters.
**
**  '?'   Matches exactly one character.
**
** [...]  Matches one character from the enclosed list of
**characters.
**
** [^...] Matches one character not in the enclosed list.
**
** With the [...] and [^...] matching, a ']' character can be included
** in the list by making it the first character after '[' or '^'.  A
** range of characters can be specified using '-'.  Example:
** "[a-z]" matches any single lower-case letter.  To match a '-', make
** it the last character in the list.
**
** This routine is usually quick, but can be N**2 in the worst case.
**
** Hints: to match '*' or '?', put them in "[]".  Like this:
**
** abc[*]xyzMatches "abc*xyz" only
*/




-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Searching for a LIKE '[0-9]%' equivalence in sqlite

2010-02-01 Thread Júlio César Ködel
uses the Unix file globbing *** syntax ***

It is the SYNTAX that it uses, not the UNIX FILE GLOBBING =)

On 2/1/10, Oliver Peters  wrote:
> Am Montag, den 01.02.2010, 22:55 +0100 schrieb Jean-Christophe
> Deschamps:
>
> [...]
>>
>> Try this:
>>
>> SELECT * FROM mytable WHERE myfield glob '[0-9]*'
>>
>
>
> thank you for opening my eyes - it seems that I never read
> http://www.sqlite.org/lang_expr.html#glob with total awareness.
>
> "The GLOB operator [...] uses the Unix file globbing syntax for its
> wildcards."
>
> But the reason might be that I usually don't use Linux for shell
> operations because in the office I've to use WinXP. Maybe someone could
> replenish the documentation with a few examples for the disadvantaged MS
> users?
>
> Oliver
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
[]
Júlio César Ködel G.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Searching for a LIKE '[0-9]%' equivalence in sqlite

2010-02-01 Thread Oliver Peters
Am Montag, den 01.02.2010, 22:55 +0100 schrieb Jean-Christophe
Deschamps:

[...]
> 
> Try this:
> 
> SELECT * FROM mytable WHERE myfield glob '[0-9]*'
> 


thank you for opening my eyes - it seems that I never read
http://www.sqlite.org/lang_expr.html#glob with total awareness.

"The GLOB operator [...] uses the Unix file globbing syntax for its
wildcards."

But the reason might be that I usually don't use Linux for shell
operations because in the office I've to use WinXP. Maybe someone could
replenish the documentation with a few examples for the disadvantaged MS
users?

Oliver

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


Re: [sqlite] Searching for a LIKE '[0-9]%' equivalence in sqlite

2010-02-01 Thread Simon Slavin

On 1 Feb 2010, at 9:49pm, flakpit wrote:

> To to get columns that begin with a number range or any number, I would use
> in SQL server:
> 
> SELECT * FROM mytable WHERE myfield LIKE '[0-9]%'
> 
> This obviously doesn't work in sqlite and I have been searching for an
> equivalence.

SELECT * FROM mytable WHERE myfield >= '0' AND myfield < ':'

If you have an index on 'myfield' this will be very fast.

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


Re: [sqlite] Searching for a LIKE '[0-9]%' equivalence in sqlite

2010-02-01 Thread flakpit



flakpit wrote:
> 
> To to get columns that begin with a number range or any number, I would
> use in SQL server:
> 
> SELECT * FROM mytable WHERE myfield LIKE '[0-9]%'
> 
> This obviously doesn't work in sqlite and I have been searching for an
> equivalence.
> 

Thank you for your kind assistance folks, brilliant!
-- 
View this message in context: 
http://old.nabble.com/Searching-for-a-LIKE-%27-0-9--%27-equivalence-in-sqlite-tp27412013p27412279.html
Sent from the SQLite mailing list archive at Nabble.com.

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


Re: [sqlite] Searching for a LIKE '[0-9]%' equivalence in sqlite

2010-02-01 Thread Jay A. Kreibich
On Mon, Feb 01, 2010 at 01:49:59PM -0800, flakpit scratched on the wall:
> 
> To to get columns that begin with a number range or any number, I would use
> in SQL server:
> 
> SELECT * FROM mytable WHERE myfield LIKE '[0-9]%'

  Use "...WHERE myfield GLOB '[0-9]*' "


   -j


-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Searching for a LIKE '[0-9]%' equivalence in sqlite

2010-02-01 Thread Jean-Christophe Deschamps

>To to get columns that begin with a number range or any number, I 
>would use
>in SQL server:
>
>SELECT * FROM mytable WHERE myfield LIKE '[0-9]%'
>
>This obviously doesn't work in sqlite and I have been searching for an
>equivalence.

Try this:

SELECT * FROM mytable WHERE myfield glob '[0-9]*'



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


[sqlite] Searching for a LIKE '[0-9]%' equivalence in sqlite

2010-02-01 Thread flakpit

To to get columns that begin with a number range or any number, I would use
in SQL server:

SELECT * FROM mytable WHERE myfield LIKE '[0-9]%'

This obviously doesn't work in sqlite and I have been searching for an
equivalence.
-- 
View this message in context: 
http://old.nabble.com/Searching-for-a-LIKE-%27-0-9--%27-equivalence-in-sqlite-tp27412013p27412013.html
Sent from the SQLite mailing list archive at Nabble.com.

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


Re: [sqlite] Update/Delete problem

2010-02-01 Thread Pavel Ivanov
Are you sure that Spiceworks or SQLLite Database Browser commit your
changes? What happens if you close those applications and restart it -
will they see their own changes? If they will and they still won't see
other application's changes then you can be sure that you're looking
at different databases.

Pavel

On Mon, Feb 1, 2010 at 12:34 PM, Carsten Peyk  wrote:
> Hi,
>
> I'm completely new to SQLLite, and I'm very sorry if I ask a trivial question.
>
> I'm using Spiceworks which again uses SQLLite as backend database. I've made 
> some updates and deletions to the records using the freeware SQLLite Database 
> Browser application. If I the open Spiceworks application the changes are not 
> reflected. Furthermore changes made in the Spiceworks application are not 
> reflected when opening the database in SQLLite Database Browser application. 
> I'm sure that it is the same database that I'm looking at. I can open the 
> database in either of the two applications, and they show different results. 
> Somehow it seems that the changes I made are still pending - uncommitted. Is 
> this possible, and what can I do to "reset" any changes I've made.
>
> Thanks.
>
> Kind regards
> Carsten
> Before printing, think about the environment
>
>
>
>
> ___
> 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


[sqlite] Update/Delete problem

2010-02-01 Thread Carsten Peyk
Hi,

I'm completely new to SQLLite, and I'm very sorry if I ask a trivial question.

I'm using Spiceworks which again uses SQLLite as backend database. I've made 
some updates and deletions to the records using the freeware SQLLite Database 
Browser application. If I the open Spiceworks application the changes are not 
reflected. Furthermore changes made in the Spiceworks application are not 
reflected when opening the database in SQLLite Database Browser application. 
I'm sure that it is the same database that I'm looking at. I can open the 
database in either of the two applications, and they show different results. 
Somehow it seems that the changes I made are still pending - uncommitted. Is 
this possible, and what can I do to "reset" any changes I've made.

Thanks.

Kind regards
Carsten
Before printing, think about the environment




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


Re: [sqlite] Getting an error "table insert failed for eventLog" any idea what is the reason

2010-02-01 Thread Pavel Ivanov
No, we don't. We can help sometimes when script contains about 5 short
lines of code, but not with some big complicated scripts. For help
with those scripts you should go to script authors.

This group is for problems with using SQLite - when you see that
SQLite behaves not in a way you expect or returns error when you think
it shouldn't (note, your "table insert failed for eventLog" is not
something SQLite returned). In these cases you can narrow the error
use case to some small amount of sql statements so that we can
reproduce it and explain to you what's the problem. So if you really
want us to help, look in your script, find where it prints "table
insert failed for eventLog", find what sql statement it executes
there, what actual error code SQLite returns. If all this information
doesn't give you any hint on what's happening post it here (sql
statement and actual error code only plus definitions of tables
involved in sql statement). In this case we will be able to give you
some hints and ask you what information is needed to tell something
more definitive if necessary.


Pavel

On Mon, Feb 1, 2010 at 11:37 AM, Vasanta  wrote:
> Here the issue is comes when it imports configuration, the script throws an
> error, since this is users group, I thought some esprts who can figure out
> the issue from script, DON'T YOU?
>
>
>
>
>
>
> On Sat, Jan 30, 2010 at 11:42 AM, Simon Slavin  wrote:
>
>>
>> On 30 Jan 2010, at 4:00pm, Vasanta wrote:
>>
>> > Thanks Simon. actually I have one sql file contains all tables info
>> > (system.sql, then system.db file gets created using this command "sqlite3
>> > system.sb < system.sql), then lua script runs on this database file
>> using
>> > default configuration (restoreDB.lua system.db def_config_ascii), then
>> this
>> > problem comes.
>>
>> Read the error messages you posted, they all say the same thing: "I tried
>> to make  but it's already there.".  Whatever process is spitting out
>> these errors is expecting to find a blank database, not one which already
>> has schema in it.  It is complaining because when it tries to fill the blank
>> database from scratch, things it's trying to create are already there.
>>
>> This is not a bug in sqlite.  sqlite is doing everything right.  You should
>> take this matter up with whoever wrote the software you're using, or whoever
>> supplied those files to you, or whoever told you which commands to issue in
>> which order.
>>
>> > I have those files, can I attach here?.
>>
>> No, do not try to send them over the mailing list.
>>
>> Simon.
>> ___
>> 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
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] poor execution time with select queries

2010-02-01 Thread alenD

By the way these queries execute very fast in MySQL, and one point I noticed
is that a query is slow if tries to join two of the same tables, i.e.
pte_atm r1, pte_atm r2, pte_drug r3
may this be the problem?

_alenD


alenD wrote:
> 
> Hi all,
> I wrote a small C code to execute a number of select queries.
> Select execution code is 
> 
>   rc = sqlite3_exec(db, "BEGIN;", callback, 0, );
>   for(eQ = 0; eQ < queries.size(); eQ++){
>   cout << "Executing " << eQ << "/" << queries.size() << "\t" <<
> queries[eQ].query <   if (queries[eQ].query != ""){
>   rc = sqlite3_exec(db, queries[eQ].query.c_str(), 
> callback, 0, );
>   if( rc!=SQLITE_OK ){
>   cout << zErr << endl;
>   writeToLog("executeQueries::SQL error" ,'.');
>   getchar();
>   }
>   }
>   else
>   callback(NULL, -1, NULL, NULL);
>   }
>   rc = sqlite3_exec(db, "END;", callback, 0, );
> 
> Some queries show poor execution time, one such example is below:
> 
> SELECT COUNT(DISTINCT r0.Arg0||'-'||'F') AS A1 
> FROM pte_atm r1,pte_atm r2,pte_active r0
>  WHERE r0.is_covered_aux = 0 AND r1.Arg0=r0.Arg0 AND r2.Arg0=r0.Arg0 AND
> r2.Arg2=r0.Arg1 AND r1.Arg0=r2.Arg0 AND r0.Arg1='F' AND r1.Arg3='3'
> 
> and table definitions with cardinality is as follows:
> 
> cardinality of pte_atm is 9189
> CREATE TABLE `pte_atm` ( `Arg0` VARCHAR(80), `Arg1` VARCHAR(80), `Arg2`
> VARCHAR(80), `Arg3` VARCHAR(80), `Arg4` DECIMAL(18,3) DEFAULT 0, `id_aux`
> INTEGER);
> 
> CREATE INDEX I13 on pte_atm(Arg0 ASC);
> 
> CREATE INDEX I14 on pte_atm(Arg1 ASC);
> 
> CREATE INDEX I15 on pte_atm(Arg2 ASC);
> 
> CREATE INDEX I16 on pte_atm(Arg3 ASC);
> 
> CREATE INDEX I17 on pte_atm(Arg4 ASC);
> 
> cardinality of pte_active is 299
> CREATE TABLE `pte_active` (`Arg0` VARCHAR(80), `Arg1` VARCHAR(80) DEFAULT
> 'F', `is_covered_aux` INTEGER DEFAULT 0, `id_aux` INTEGER NOT NULL DEFAULT
> 0);
> 
> CREATE INDEX I4 on pte_active(Arg0 ASC);
> 
> CREATE INDEX I5 on pte_active(Arg1 ASC);
> 
> I also put the following pragmas at the very beginning of my code
> rc = sqlite3_exec(db, "PRAGMA page_size=32768", NULL, 0, ); 
> rc = sqlite3_exec(db, "PRAGMA synchronous=OFF", NULL, 0, ); 
> rc = sqlite3_exec(db, "PRAGMA temp_store = MEMORY", NULL, 0, ); 
> rc = sqlite3_exec(db, "PRAGMA default_cache_size = 2000", NULL, 0, ); 
> 
> what might the problem be, how can I improve the execution time.
> 
> thanks in advance
> 
> _alenD
> 

-- 
View this message in context: 
http://old.nabble.com/poor-execution-time-with-select-queries-tp27406303p27407255.html
Sent from the SQLite mailing list archive at Nabble.com.

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


Re: [sqlite] Getting an error "table insert failed for eventLog" any idea what is the reason

2010-02-01 Thread Vasanta
Here the issue is comes when it imports configuration, the script throws an
error, since this is users group, I thought some esprts who can figure out
the issue from script, DON'T YOU?






On Sat, Jan 30, 2010 at 11:42 AM, Simon Slavin  wrote:

>
> On 30 Jan 2010, at 4:00pm, Vasanta wrote:
>
> > Thanks Simon. actually I have one sql file contains all tables info
> > (system.sql, then system.db file gets created using this command "sqlite3
> > system.sb < system.sql), then lua script runs on this database file
> using
> > default configuration (restoreDB.lua system.db def_config_ascii), then
> this
> > problem comes.
>
> Read the error messages you posted, they all say the same thing: "I tried
> to make  but it's already there.".  Whatever process is spitting out
> these errors is expecting to find a blank database, not one which already
> has schema in it.  It is complaining because when it tries to fill the blank
> database from scratch, things it's trying to create are already there.
>
> This is not a bug in sqlite.  sqlite is doing everything right.  You should
> take this matter up with whoever wrote the software you're using, or whoever
> supplied those files to you, or whoever told you which commands to issue in
> which order.
>
> > I have those files, can I attach here?.
>
> No, do not try to send them over the mailing list.
>
> Simon.
> ___
> 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] parallelizing an update

2010-02-01 Thread Nicolas Williams
On Sat, Jan 30, 2010 at 10:36:56AM +0100, Sylvain Pointeau wrote:
> echo "begin transaction" >> update.sql
> 
> sqlite3 -separator $'\t' sample.db 'select rowid, item from foo;' |
> while read rowid item ; do
>  status=$(long_running_process "${item}" )
>  echo "update foo set status=${status} where rowid=${rowid} ;" >> update.sql
> done
> 
> echo "commit transaction" >> update.sql
> 
> sqlite3 sample.db < update.sql

More aesthetic (since it seems to matter :)

(
echo "begin transaction"
sqlite3 -separator $'\t' sample.db 'select rowid, item from foo;' |
while read rowid item ; do
status=$(long_running_process "${item}" )
echo "update foo set status=${status} where rowid=${rowid} ;"
done
echo "commit transaction"
) | sqlite3 sample.db

Now to parallelize this:

function par_updates {
typeset -i n
n=$1
shift
(
trap "((n++))" CHLD
echo "begin transaction"
sqlite3 -separator $'\t' sample.db 'select rowid, item from foo;' |
while read rowid item
do
while ((n == 0))
do
sleep 1
done
(echo "update foo set status=$("$@") where rowid=$rowid;") &
((n--))
done
echo "commit transaction"
) | sqlite3 sample.db
}

You should run this like so:

par_updates 20 long_running_program [arguments]

It should run up to 20 processes to generate the updates.  And it should
batch all updates into one transaction.

I've not tested this, but it should work with recent versions of ksh93
and bash.  (Older versions of ksh93 might not handle the SIGCHLD trap
correctly, IIRC.)

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


Re: [sqlite] poor execution time with select queries

2010-02-01 Thread Jay A. Kreibich
On Mon, Feb 01, 2010 at 07:49:50AM -0800, alenD scratched on the wall:
> 
> Hi all,
> I wrote a small C code to execute a number of select queries.

  If you're doing a number of similar queries, look at the
  prepare/bind/step interface.  It is generally better than the exec()
  interface.

> SELECT COUNT(DISTINCT r0.Arg0||'-'||'F') AS A1 

  This concatenation is pointless.  You're not returning the value, so
  it is never seen in the result.  Because it is completely constant,
  it won't change the result of the distinct count.  It does turn the
  count parameter into an expression, however, so the optimizer can't
  touch the count operation.

  If at all possible, I'd also try to find a way to re-work the query so
  that the DISTINCT is not required.

> FROM pte_atm r1,pte_atm r2,pte_active r0
>  WHERE r0.is_covered_aux = 0 AND r1.Arg0=r0.Arg0 AND r2.Arg0=r0.Arg0 AND
> r2.Arg2=r0.Arg1 AND r1.Arg0=r2.Arg0 AND r0.Arg1='F' AND r1.Arg3='3'
> 
> and table definitions with cardinality is as follows:
> 
> CREATE INDEX I13 on pte_atm(Arg0 ASC);

  It is doubtful all these indexes are useful.  In general, SQLite can
  only use one index per table per query.  If you need to key off
  several values in a table, you need to create a multi-column index.
  Be aware, however, that the ordering of the columns within that index
  is extremely critical.

  I'd drop most of these and see if you can get one multi-column index
  on each table that does what you need.

> I also put the following pragmas at the very beginning of my code
> rc = sqlite3_exec(db, "PRAGMA page_size=32768", NULL, 0, ); 

  The page size can only be changed when a database is first created,
  before the first CREATE TABLE command is issued.  Unless you're
  building the DB from scratch, this won't do anything.

> rc = sqlite3_exec(db, "PRAGMA synchronous=OFF", NULL, 0, ); 

  This is unlikely to significantly improve read (e.g. SELECT) performance.

> rc = sqlite3_exec(db, "PRAGMA default_cache_size = 2000", NULL, 0, ); 

  I think you want "cache_size", not "default_cache_size", although
  this will still work.  2000 is the default, however.  Depending on
  the size of your DB, the actual size of your pages, and the
  environment you're working on, you might consider bumping this up 10x
  or larger.

-j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] poor execution time with select queries

2010-02-01 Thread alenD

Hi all,
I wrote a small C code to execute a number of select queries.
Select execution code is 

rc = sqlite3_exec(db, "BEGIN;", callback, 0, );
for(eQ = 0; eQ < queries.size(); eQ++){
cout << "Executing " << eQ << "/" << queries.size() << "\t" <<
queries[eQ].query <

Re: [sqlite] system.data.sqlite & encryption

2010-02-01 Thread Shane Harrelson
I think you should probably ask this question on the System.data.sqlite
support forums at

http://sqlite.phxsoftware.com/forums

I'm not familiar with enough with their ADO .NET implementation to answer
your question.

-Shane


On Sun, Jan 31, 2010 at 11:54 AM, Sylvain Pointeau <
sylvain.point...@gmail.com> wrote:

> Hi all,
>
> I am using System.data.sqlite from my .NET project,
> but I am planning to access my db from C/C++ and C# / C++/CI
>
> The point is that I want an encryted database, and I plan to use the
> extension from
> http://www.hwaci.com/sw/sqlite/prosupport.html#crypto
>
> how to use / implement this exension in system.data.sqlite?
> or are they compatible both?
>
> thank you in advance for your help.
>
> Best regards,
> Sylvain
> ___
> 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] overwritten iphone contacts

2010-02-01 Thread Simon Slavin

On 1 Feb 2010, at 9:42am, Jean-Denis Muys wrote:

> On 1/30/10 19:21 , "Roger Binns"  wrote:
> 
>> ishak kalkavan wrote:
>>> file I could see phone numbers and contact names but in a very complex way.
>>> I couldnt find any way to match those data.
>> 
>> The file format is documented at http://www.sqlite.org/fileformat.html
> 
> Hmm, Apple defines an official API to access the address book data. Rather
> than the hacks suggested here, I'd use that instead (short of normally using
> a back up).

The sqlite database the OP referred to is where the address book data is kept.  
Since this file has been wiped, Apple's API can't get at the information either.

The OP appears be to trying to grab data out of a sqlite database which has 
intentionally been wiped.  As others have suggested this is a specialist task 
suitable only for someone who understands the sqlite format very well, and even 
then some data will be lost.  I think if it really matters he can hire DRH's 
company to do it.

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


Re: [sqlite] overwritten iphone contacts

2010-02-01 Thread Jean-Denis Muys

On 1/30/10 19:21 , "Roger Binns"  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> ishak kalkavan wrote:
>> file I could see phone numbers and contact names but in a very complex way.
>> I couldnt find any way to match those data.
> 
> The file format is documented at http://www.sqlite.org/fileformat.html
> 

Hmm, Apple defines an official API to access the address book data. Rather
than the hacks suggested here, I'd use that instead (short of normally using
a back up).

The API is all freely documented on line. For example, you can start at:

http://developer.apple.com/iphone/library/documentation/ContactData/Conceptu
al/AddressBookProgrammingGuideforiPhone/100-Introduction/Introduction.html

Jean-Denis


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