Re: [sqlite] select from commandprompt with output to file

2006-11-16 Thread Derrell . Lipman
"RB Smissaert" <[EMAIL PROTECTED]> writes:

> How would I run these 4 commands via a .bat file or via whatever means:
>
> cd c:\test\ReadCodes
> c:\test\Program\sqlite3 c:\test\ReadCodes\ReadCode.db"
> .output testfile.txt
> select * from readcode where read_code glob 'G2*';

I haven't been tracking this thread so apologies if I'm misunderstanding what
you want.  Are you doing this from a DOS (Command) shell?  I'm far from a DOS
expert, but how about something like this:

cd c:\test\ReadCodes
echo "select * from readcode where read_code glob 'G2*'" | 
c:\test\Program\sqlite3 c:\test\ReadCodes\ReadCode.db > testfile.txt

Derrell

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



Re: [sqlite] fts1 and copying memory dbs to disk

2006-11-16 Thread Scott Hess

On 10/31/06, Bryan Oakley <[EMAIL PROTECTED]> wrote:

Given that, is there a reliable, portable way to copy a memory db to
disk, when that db makes use of the FTS1 module?


I've been pondering this, and nothing good came of it :-).

My best suggestion would be to modify your copy system to first create
the virtual tables, then create all other tables using "if not
exists", then copy all the data for the non-virtual tables.  The idea
would be to copy the backing of the virtual tables, only using the
virtual table interface to handle creation.  This might fail if at
some point a virtual table uses some sort of backwards compatibility,
where the aux table names in an existing database may not match those
which would be created for a new table.

My second-best suggestion would be to first copy the virtual tables in
the standard way _through_ the virtual table interface, then skip any
non-virtual tables which already exist in the copy.  Two downsides
come to mind.  This might not get you a dataset which precisely
matches the original (in the case of fts1, deletions stored in the
doclists would fall away - sort of like a VACUUM operation, which
might be good!).  Also, it might make things slower.  I don't think
the default tokenizer for fts1 would be particularily slower for
datasets which fit in memory in the first place, but in the general
case it's certainly possible.

Sounds like you want something like table-renaming, maybe "ALTER TABLE
 COPY TO ;".  Hmm.  But you'd still have to figure out
which ones to copy!

-scott

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



Re: [sqlite] SELECT FOR UPDATE

2006-11-16 Thread Jay Sprenkle

Hi,

We are newbie to SQLite and we would like to lock a table through a select +
update.

Something like that:

BEGIN TRANSACTION

   currentValue = select currentValue from sequence_transactions;

   update sequence_transactions set currentValue = currentValue + 1;

   COMMIT;

END TRANSACTION

When the program reachs the select, we would like other threads /
applications wait for that transaction to finish.

Is there any way of achiving that?



Read through the documentation on locking. It should do what you want
and explain
it so you can understand it. I think what you already have written will probably
work fine, but as always, the difficulty is in the details.

http://sqlite.org/lockingv3.html



--
SqliteImporter and SqliteReplicator: Command line utilities for Sqlite
http://www.reddawn.net/~jsprenkl/Sqlite

Cthulhu Bucks!
http://www.cthulhubucks.com

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



RE: [sqlite] select from commandprompt with output to file

2006-11-16 Thread RB Smissaert
Kees,

How would I run these 4 commands via a .bat file or via whatever means:

cd c:\test\ReadCodes
c:\test\Program\sqlite3 c:\test\ReadCodes\ReadCode.db"
.output testfile.txt
select * from readcode where read_code glob 'G2*';

It must be simple, but I can't see it.

RBS

-Original Message-
From: Kees Nuyt [mailto:[EMAIL PROTECTED] 
Sent: 16 November 2006 21:36
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] select from commandprompt with output to file


Hi RBS,

On Thu, 16 Nov 2006 19:56:36 -, you wrote:

>How do I do this:
>From the command prompt issue a simple select query to a specified database
>and direct the output to a file.
>I can see there is the .output FILENAME option, but nothing seems to
happen.
>.output stdout works fine with output to the screen.
>Must be overlooking something simple here.
>
>RBS

.output FILENAME 
doesn't do anything by itself, it only sets the name of the file
any follwing commands will write output to.
Once you execute a query afterwards the file should be created.
If you want the file in another directory than the current one,
use slashes in the path, not backslashes.

The following code works for me:

C:\DATA\opt\test>sqlite3 tmp/test.db3
SQLite version 3.3.8
Enter ".help" for instructions
sqlite> .mode list
sqlite> .headers off
sqlite> .output tmp/master.html
sqlite> SELECT 'Database schema';
sqlite> SELECT 'Report on database schema TESTtables';
sqlite> .mode html
sqlite> .headers on
sqlite> select * from sqlite_master order by type,name;
sqlite> .mode list
sqlite> .headers off
sqlite> SELECT '';
sqlite> .q

C:\DATA\opt\test>
-- 
  (  Kees Nuyt
  )
c[_]


-
To unsubscribe, send email to [EMAIL PROTECTED]

-




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



[sqlite] beginner question

2006-11-16 Thread Qiang
hello, 

two questions.. 

1. comparing select one or two columns from one row
from a bigger table ( 20,000 - 30,000 rows, 20 columns
).
   with 
   select the same column from one row from a smaller
table (20,000 - 30,000 rows, 2 columns). does it make
much different on performance? if yes, what makes it?

2. Comparing select a sequence number first from a
small table THEN select all rows from another table
that have the same sequence number ( hence two selects
)
   with
   join select on this two tables where they have the
same sequence number. any difference here?

thanks,

Qiang


 

Sponsored Link

Mortgage rates near 39yr lows. 
$420k for $1,399/mo. Calculate new payment! 
www.LowerMyBills.com/lre

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



Re: [sqlite] INSERT INTO with SELECT

2006-11-16 Thread Jay Sprenkle

On 11/16/06, RB Smissaert <[EMAIL PROTECTED]> wrote:

My text file is only an intermediate and I can make the way I want.
I need to move data from Interbase to SQLite. Fastest method sofar is:
IB > ADO recordset
ADO recordset > text file
Import text file with SQLite .import command

Problem with .import is that it doesn't like double quotes.


I put together my own import program. You're welcome to try it if you
don't get it fixed.
You can find it at the link below. I would think a loop inside your program
would be faster though.


--
SqliteImporter and SqliteReplicator: Command line utilities for Sqlite
http://www.reddawn.net/~jsprenkl/Sqlite

Cthulhu Bucks!
http://www.cthulhubucks.com

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



RE: [sqlite] select from commandprompt with output to file

2006-11-16 Thread RB Smissaert
Hi Kees,

Not sure what I did wrong, but I got it working now.
Just wondering now if I actually need the VB wrapper. Looks all can be done
with command-line work.

RBS

-Original Message-
From: Kees Nuyt [mailto:[EMAIL PROTECTED] 
Sent: 16 November 2006 21:36
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] select from commandprompt with output to file


Hi RBS,

On Thu, 16 Nov 2006 19:56:36 -, you wrote:

>How do I do this:
>From the command prompt issue a simple select query to a specified database
>and direct the output to a file.
>I can see there is the .output FILENAME option, but nothing seems to
happen.
>.output stdout works fine with output to the screen.
>Must be overlooking something simple here.
>
>RBS

.output FILENAME 
doesn't do anything by itself, it only sets the name of the file
any follwing commands will write output to.
Once you execute a query afterwards the file should be created.
If you want the file in another directory than the current one,
use slashes in the path, not backslashes.

The following code works for me:

C:\DATA\opt\test>sqlite3 tmp/test.db3
SQLite version 3.3.8
Enter ".help" for instructions
sqlite> .mode list
sqlite> .headers off
sqlite> .output tmp/master.html
sqlite> SELECT 'Database schema';
sqlite> SELECT 'Report on database schema TESTtables';
sqlite> .mode html
sqlite> .headers on
sqlite> select * from sqlite_master order by type,name;
sqlite> .mode list
sqlite> .headers off
sqlite> SELECT '';
sqlite> .q

C:\DATA\opt\test>
-- 
  (  Kees Nuyt
  )
c[_]


-
To unsubscribe, send email to [EMAIL PROTECTED]

-




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



Re: [sqlite] select from commandprompt with output to file

2006-11-16 Thread Kees Nuyt

Hi RBS,

On Thu, 16 Nov 2006 19:56:36 -, you wrote:

>How do I do this:
>From the command prompt issue a simple select query to a specified database
>and direct the output to a file.
>I can see there is the .output FILENAME option, but nothing seems to happen.
>.output stdout works fine with output to the screen.
>Must be overlooking something simple here.
>
>RBS

.output FILENAME 
doesn't do anything by itself, it only sets the name of the file
any follwing commands will write output to.
Once you execute a query afterwards the file should be created.
If you want the file in another directory than the current one,
use slashes in the path, not backslashes.

The following code works for me:

C:\DATA\opt\test>sqlite3 tmp/test.db3
SQLite version 3.3.8
Enter ".help" for instructions
sqlite> .mode list
sqlite> .headers off
sqlite> .output tmp/master.html
sqlite> SELECT 'Database schema';
sqlite> SELECT 'Report on database schema TESTtables';
sqlite> .mode html
sqlite> .headers on
sqlite> select * from sqlite_master order by type,name;
sqlite> .mode list
sqlite> .headers off
sqlite> SELECT '';
sqlite> .q

C:\DATA\opt\test>
-- 
  (  Kees Nuyt
  )
c[_]

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



Re: [sqlite] Migration from sqlite2 to sqlite3 -> no tablename in p3 of Open* rows when explaining sql?

2006-11-16 Thread Mario Wolff

Funny thing!
My project is written in PHP! I've just modified pdo_sqlite to get
access to the set_authorizer-call!
My first solution was much more simple!
But hey, you are right!

Regards,
Mario

2006/11/14, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:

"Mario Wolff" <[EMAIL PROTECTED]> wrote:
> Hello Group,
> i try to migrate my (alpha-state) project from sqlite2 to sqlite3. To
> realize table based acl's i call explain and take the
> OpenRead/OpenWrite lines and check for p3 entry which gives the
> affected table. With sqlite3 the p3 is not set!
>

The opcodes in SQLite are not part of the defined interface and
are subject to change without notice.  Opcodes can and do change
sometimes drastically between point releases.  Do not write code
that reads opcodes.  Doing so is considered bad style.

To implement table or even column-level access control, use the
sqlite3_set_authorizer() API.  There are examples of how to do
this in the source code to CVSTrac. http://www.cvstrac.org/

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


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




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



[sqlite] select from commandprompt with output to file

2006-11-16 Thread RB Smissaert

How do I do this:
>From the command prompt issue a simple select query to a specified database
and direct the output to a file.
I can see there is the .output FILENAME option, but nothing seems to happen.
.output stdout works fine with output to the screen.
Must be overlooking something simple here.

RBS



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



[sqlite] SELECT FOR UPDATE

2006-11-16 Thread jfbaro

Hi,

We are newbie to SQLite and we would like to lock a table through a select +
update.

Something like that:

BEGIN TRANSACTION

   currentValue = select currentValue from sequence_transactions;   

   update sequence_transactions set currentValue = currentValue + 1;

   COMMIT;

END TRANSACTION

When the program reachs the select, we would like other threads /
applications wait for that transaction to finish.

Is there any way of achiving that?

Cheers


-- 
View this message in context: 
http://www.nabble.com/SELECT-FOR-UPDATE-tf2645383.html#a7384913
Sent from the SQLite mailing list archive at Nabble.com.


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



Re: [sqlite] Importing text file via .bat file

2006-11-16 Thread Clark Christensen
Aah, I see "Shell" means something different to you than to me.  I'm sorry, I 
was thinking SQLite shell.  I can't help with any specific VB examples.

 -Clark

- Original Message 
From: RB Smissaert <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Sent: Wednesday, November 15, 2006 5:11:38 PM
Subject: RE: [sqlite] Importing text file via .bat file

Not sure if Shell can do something like that.
What would the VB code be?

RBS

-Original Message-
From: Clark Christensen [mailto:[EMAIL PROTECTED] 
Sent: 15 November 2006 23:53
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Importing text file via .bat file

Shell

- Original Message 
From: RB Smissaert <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Sent: Wednesday, November 15, 2006 2:16:32 PM
Subject: RE: [sqlite] Importing text file via .bat file

>   sqlite3 c:\sqlite\ReadCode.db ".read c:\sqlite\ReadCode.sql"

Not sure how that would work from VBA. Did you mean to run this with Shell
or the Windows API?

RBS


-Original Message-
From: Clark Christensen [mailto:[EMAIL PROTECTED] 
Sent: 15 November 2006 21:37
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Importing text file via .bat file

RBS,

Sorry to jump in late here.  Others have given good advice, but I'm
wondering, since this is all running from VB, why not do all the work in VB
and skip the batch (or cmd) file.  I'm not a VB guy, but I do know it's
pretty powerful.

Are you having some trouble with a VB wrapper for SQLite?  If no, then what
you propose should be as simple as iterating through the IB recordset and
inserting what you need into your SQLite table.  If you are having trouble
with a wrapper, then it seems to me like VB can (and should) do everything
except the actual import.

If you create your SQL script as:

--ReadCode.sql to build and populate ReadCode.db
drop table if exists ReadCode;
create table ReadCode
  (
SUBJECT_TYPE   varchar(5),
READ_CODE   varchar(5),
TERM30   varchar(30),
TERM60  varchar(60)
  );
.mode csv
.import c:\sqlite\ReadCode.txt ReadCode
--END SQL

Then, from VB, you issue a single command like:

sqlite3 c:\sqlite\ReadCode.db ".read c:\sqlite\ReadCode.sql"

and wait for SQLite to finish (or read the exit code, or read SQLite's
stdout output).  If it's a success, there'll be no output from SQLite.

If what you really want is to have one single SQL file to do the job, you
would have your "Recordset to text" step write out each row as an insert
statement into ReadCode.sql, so ReadCode.sql would then look like:

--ReadCode.sql to build and populate ReadCode.db

drop table if exists ReadCode;

create table ReadCode

  (

SUBJECT_TYPE   varchar(5),

READ_CODE   varchar(5),

TERM30   varchar(30),

TERM60  varchar(60)

  );

begin transaction;
insert into ReadCode values (...);
insert into ReadCode values (...);
insert into ReadCode values (...);
...
commit;
--END SQL

Then issue the same command from VB to start the job:

sqlite3 c:\sqlite\ReadCode.db ".read c:\sqlite\ReadCode.sql"

Either way, you would be able to eliminate the batch file, and handle
everything from within VB.

 -Clark
- Original Message 
From: RB Smissaert <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Sent: Tuesday, November 14, 2006 3:44:12 PM
Subject: [sqlite] Importing text file via .bat file

Have figure out now what the quickest way is to move data from Interbase to
a SQLite db file:
IB to ADO recordset
Recordset to text
Import the text file with the .import command.

Now I am trying to figure out how to automate the last step with a .bat
file.
What I got sofar is:
Have a SQL file with:

create table ReadCode
  (
SUBJECT_TYPE   varchar(5),
READ_CODE   varchar(5),
TERM30   varchar(30),
TERM60  varchar(60)
  );

Run a .bat file with this:

cd C:\SQLite
del ReadCode.db
type ReadCode.sql | sqlite3 ReadCode.db

Then run from the command prompt:

Cd C:\SQLite  (press return)
SQLite3 ReadCode.db  (press return)
.mode csv(press return)
.import ReadCode.txt ReadCode   (press return)

This runs nice and quick, but how would I combine all this in one .bat file
or how could I run this all from VB? I know very little about .bat files,
but I would think that somehow it must be possible.
Thanks for any assistance.


RBS





-
To unsubscribe, send email to [EMAIL PROTECTED]

-






-
To unsubscribe, send email to [EMAIL PROTECTED]

-





-
To unsubscribe, send email to [EMAIL PROTECTED]

Re: Re: [sqlite] Sqlite books

2006-11-16 Thread Vikram Bhandoh

There is nothing in the book about compiling either sqlite or PHP.
It's more of a reference for someone who wants to know how SQLite
is build and how one should use it. The compiling stuff you are going
to have to find it on the web as the stuff in the book is pretty close to
the sqlite wiki.

On 11/16/06, Christian Smith <[EMAIL PROTECTED]> wrote:

Michael Young uttered:

> I've had PHP5 for two months now and have not been able to compile it
> successfully on my Mac so that SQLite 3.x files can be accessed. I had hoped
> to find help in compiling in Mike Owens' book.
>
> Does the book offer any details on compiling that might make the purchase
> worthwhile? I've tried in vain to find Mike Owens' email address to ask this
> simple question. Can't find it though.


I've not got the book to hand, so can't answer, but my guess is no. Try
posting your problems to this or a PHP list, someone may be able to help.


>
> Mike
>
>
> On Nov 15, 2006, at 8:38 AM, Christian Smith wrote:
>
>> John Gunnarsson uttered:
>>
>>> Hi,
>>>
>>> I'm about to buy a book about Sqlite. I'm coding in C++ so I'm looking
>>> for the best book to suite my needs.
>>>
>>> In my local bookstore I have:
>>> The Definitive Guide to SQLite, APress
>>> http://www.apress.com/book/bookDisplay.html?bID=10130
>>>
>>> and
>>>
>>> SQLite, Sams
>>> http://safari.samspublishing.com/067232685X
>>>
>>> Have anyone of you a opinion of the books above, or maybe an even
>>> better recommendation?
>>
>>
>> The former is more up to date, covering SQLite 3.x. The latter covers only
>> 2.x, which is unfortunate.
>>
>> I have both books, and the former is more comprehensive IMO. If you want
>> just the one book, go for the former.
>>
>>
>>>
>>> //John
>>>
>>
>>
>> Christian
>>
>> --
>>/"\
>>\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
>> X   - AGAINST MS ATTACHMENTS
>>/ \
>>
>> -
>> To unsubscribe, send email to [EMAIL PROTECTED]
>> -
>>
>
>
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -

--
 /"\
 \ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
  X   - AGAINST MS ATTACHMENTS
 / \

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





--
"Don't worry about what anybody else is going to do. The best way to
predict the future is to invent it." - Alan Kay

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



Re: [sqlite] Sqlite books

2006-11-16 Thread Christian Smith

Michael Young uttered:

I've had PHP5 for two months now and have not been able to compile it 
successfully on my Mac so that SQLite 3.x files can be accessed. I had hoped 
to find help in compiling in Mike Owens' book.


Does the book offer any details on compiling that might make the purchase 
worthwhile? I've tried in vain to find Mike Owens' email address to ask this 
simple question. Can't find it though.



I've not got the book to hand, so can't answer, but my guess is no. Try 
posting your problems to this or a PHP list, someone may be able to help.





Mike


On Nov 15, 2006, at 8:38 AM, Christian Smith wrote:


John Gunnarsson uttered:


Hi,

I'm about to buy a book about Sqlite. I'm coding in C++ so I'm looking
for the best book to suite my needs.

In my local bookstore I have:
The Definitive Guide to SQLite, APress
http://www.apress.com/book/bookDisplay.html?bID=10130

and

SQLite, Sams
http://safari.samspublishing.com/067232685X

Have anyone of you a opinion of the books above, or maybe an even
better recommendation?



The former is more up to date, covering SQLite 3.x. The latter covers only 
2.x, which is unfortunate.


I have both books, and the former is more comprehensive IMO. If you want 
just the one book, go for the former.





//John




Christian

--
   /"\
   \ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X   - AGAINST MS ATTACHMENTS
   / \

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




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


--
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \

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



RE: [sqlite] SQLITE readonly Performance on a CD DB

2006-11-16 Thread Christian Smith

Vis Naicker uttered:


[EMAIL PROTECTED] uttered:


the blob database... within 1.5sec or less from the CD. ... LED on the

CD rom blinking only occasionally, not

constantly like when I copy a file.




[If the LED only lights when data is being transferred, then what

you're
seeing is the latency of individual reads. This is not surprising, as
cdroms have horrendously slow seek times. When copying regular files,
the
file itself is likely to be contiguous on the CD, therefore no seeks are

required. A SQLite database, on the other hand, has tree structure
scattered around the file. Seeks are common and slow. Vacuuming, as DRH
suggests, will reduce the seeks as tables will be more contiguous.]

* The database is only populated once , I posted search fields into one
database which performs badly, and posted the text as blobs which
performs well even on CD. I also have a system in place where I can post
the blobs as either sqlite or zip or raw files and I am happy with that
performance



The blobs are most likely largely contiguous.





[The OS should shield you from this. One way to possibly increase

performance is to the prime the OS cache by reading in the CD file in
it's
entirety (just read the raw file). Hopefully, the file should fit in the

OS's memory cache, and subsequent SQLite reads can be satisfied from the

OS cache, though that may be unfeasable with a database of your size.]

* The records db is 20MB indexed, and the blob is 140MB.



So it may be feasible to prime your machine cache with the records db. Not 
neccessary for the blob database if it's working fine.






[You might also want to increase the database page size when creating

the
database in the first place, as you'll have less actual pages and hence
less seeks for a given database size.]

* I am using a Delphi wrapper, I need to investigate further.



Execute "PRAGMA page_size=;" to set the page size, BEFORE you put 
any data in the database. Try, off the bat, a page size of 16384.





[* sorry first time with outlook I have to set it up later properly]




You have no hope of setting it up properly:)


--
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \

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



Re: [sqlite] Character set

2006-11-16 Thread Dan Kennedy

To my knowledge SQLite can only store text using UTF-8 or UTF-16
encoding. 

I guess in some circumstances the latin1 representation
would be more compact than UTF-8, but if that's an issue for
you then you would probably want to apply some kind of external
compression algorithm to your strings and then store them as
blobs.

Dan.




--- C�cilia Vigny <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> is it possible to specify the character set for a table ? I would like 
> my data to be in latin1 instead of utf-8.
> 
> Thanks !
> 
> 
> Ce message est prot?g? par les r?gles relatives au secret des 
> correspondances. Il est donc
> ?tabli ? destination exclusive de son destinataire. Celui-ci peut donc 
> contenir des informations
> confidentielles. La divulgation de ces informations est ? ce titre 
> rigoureusement interdite. Si
> vous avez re?u ce message par erreur, merci de le renvoyer ? l'exp?diteur 
> dont l'adresse e-mail
> figure ci-dessus et de d?truire le message ainsi que toute pi?ce jointe.
> 
> This message is protected by the secrecy of correspondence rules. Therefore, 
> this message is
> intended solely for the attention of the addressee. This message may contain 
> privileged or
> confidential information, as such the disclosure of these informations is 
> strictly forbidden.
> If, by mistake, you have received this message, please return this message to 
> the addressser
> whose e-mail address is written above and destroy this message and all files 
> attached.
> 
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
> 
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [sqlite] 回复: [sqlite] Re: Newbie sqlite questions: check existence of column

2006-11-16 Thread Florent THIERY

Yup i updated too. I had only sqlite-2 python bindings installed (debian)

On 11/16/06, Linker M Lin <[EMAIL PROTECTED]> wrote:


And mine is:

>>> import sqlite
>>> sqlite.version
'1.1.8'
>>>


[sqlite] Character set

2006-11-16 Thread Cécilia Vigny

Hi,

is it possible to specify the character set for a table ? I would like 
my data to be in latin1 instead of utf-8.


Thanks !


Ce message est prot?g? par les r?gles relatives au secret des correspondances. 
Il est donc ?tabli ? destination exclusive de son destinataire. Celui-ci peut 
donc contenir des informations confidentielles. La divulgation de ces 
informations est ? ce titre rigoureusement interdite. Si vous avez re?u ce 
message par erreur, merci de le renvoyer ? l'exp?diteur dont l'adresse e-mail 
figure ci-dessus et de d?truire le message ainsi que toute pi?ce jointe.

This message is protected by the secrecy of correspondence rules. Therefore, 
this message is intended solely for the attention of the addressee. This 
message may contain privileged or confidential information, as such the 
disclosure of these informations is strictly forbidden. If, by mistake, you 
have received this message, please return this message to the addressser whose 
e-mail address is written above and destroy this message and all files attached.



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



Re: [sqlite] Handling null characters in blob data

2006-11-16 Thread Vivien Malerba

On 11/15/06, John Stanton <[EMAIL PROTECTED]> wrote:

Vivien Malerba wrote:
> On 11/13/06, Shivshankar Subramani - TLS , Chennai <[EMAIL PROTECTED]>
> wrote:
>
>> Hi all,
>>
>> > SQLite version 2.8 and earlier could not (easily) store binary
>> > data - data with embedded \000 characters.  Thus the encode/decode
>> > routines were provide to transform data so that it contained no
>> > \000 characters.
>> >
>> > SQLite version 3.0 can store binary data without difficulty.
>>
>> This is what  I read in the site
>> 
>> http://www.mail-archive.com/sqlite-users@sqlite.org/msg04332.html
>> . but
>> i am having difficulty in storing data with null characters in it.Is
>> there
>> any specific method in which i can solve this problem?
>>
>
> I personally use the X'AABBCCDD' syntax to store BLOBS where AABBCCDD
> is the hexadecimal representation of my binary data (one byte
> translated into ist 2 digits hexa equivalent). for example:
> "insert into mytable values (1, X'AABBCCDD');"
>
> Regards,
>
> Vivien
>
> -
>
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
>
>
That is exapnsion, not compression!



It's just a notation, I believe SQLite does the conversion the other
way and stores the BLOB as a binary chunck.

Vivien

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



Re: [sqlite] autoincrement and integer primary key

2006-11-16 Thread Mario Frasca

[EMAIL PROTECTED] wrote:


In the FAQ's on the web site it indicated that when the primary key is
autoincrement, the data type is a signed 64 bit number.  Has this been your
experience?
 

never noticed...  not in Python with the sqlite modules I have...  and 
no difference whether I use the 'autoincrement' keyword or not, as long 
as we're talking about 'integer primary key' / oid...


Python 2.3.5 (#2, Oct 16 2006, 19:19:48)
{also tried with no difference:
Python 2.4.1 (#2, Oct 18 2006, 20:58:01)
}
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pysqlite2 import dbapi2 as sqlite
>>> db = sqlite.connect(':memory:')
>>> cr = db.cursor()
>>> cr.execute('create table test(pk integer primary key autoincrement, 
v string)')

>>> cr.execute("insert into test (v) values ('test')")
>>> cr.execute("select * from test")
>>> cr.fetchone()
(1, u'test')
>>> cr.execute("select * from test")
>>> [type(i) for i in cr.fetchone()]
[, ]
>>> type(1L)

>>>

Python 2.4.4 (#2, Oct 20 2006, 00:57:46)
[GCC 4.1.2 20061007 (prerelease) (Debian 4.1.1-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite
>>> db = sqlite.connect(':memory:')
>>> cr = db.cursor()
>>> cr.execute('create table test(pk integer primary key, v string)')
>>> cr.execute("insert into test (v) values ('test')")
>>> cr.execute("select * from test")
>>> cr.fetchone()
(1, 'test')
>>> cr.execute("select * from test")
>>> [type(i) for i in cr.fetchone()]
[, ]
>>>

in short: no, it's not my experience.

MF

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