Re: [sqlite] Booleans in SQLite

2009-09-02 Thread sub sk79
>
>                I'm just curious how difficult it would be to add
> support for booleans in SQLite.
>
> as well as use those keywords instead of creating integer
> fields using 0 and 1.
>

Check out StepSqlite PL/SQL compiler for SQLite which supports
BOOLEAN data type among many other goodies.

http://www.metatranz.com/stepsqlite

It lets you script SQLite to do things like:

create table  admissions(fn varchar(20), ln varchar(20), accepted BOOLEAN);
begin
  for student in (select * from admissions where accepted = TRUE)
  loop
dbms_output.put_line('First name:' || student.fn || '  Last name:'
|| student.ln || '  Accepted: '||student.accepted );

 if student.accepted then
  dbms_output.put_line(student.fn ||'  '|| student.ln || '  has
been admitted.' );
 else
  dbms_output.put_line(student.fn ||'  '|| student.ln || '  has
NOT been admitted.' );
 end if;
  end loop;
end;

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


Re: [sqlite] SQLite Porting: Adding new VFS

2009-09-02 Thread Dave Toll
Hi Mwnn

If you don't require persistent storage and always call
sqlite3_open[_v2]() with the filename ":memory:" for an in-memory
database, then yes you should be able to assign pMethods to NULL. In
fact if you only use ":memory:", you should be able to compile with
SQLITE_OMIT_DISKIO and you won't need a VFS at all. You may have to
check whether this compile option is supported by the amalgamation
source, if you use that.

Cheers,
Dave.


-Original Message-
From: mwnn [mailto:mwnn...@gmail.com] 
Sent: 02 September 2009 18:50
To: sqlite-users@sqlite.org
Subject: [sqlite] SQLite Porting: Adding new VFS

Hi all,
I am working on porting SQLite on to a proprietary Operating
system. The 
application that uses SQLite keeps the database in memory.. So in this
case 
can I assign NULL to pMethods pointer in sqlite3_file structure.

Regards,
mwnn 

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


[sqlite] help

2009-09-02 Thread malin

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


Re: [sqlite] Problems encountered on upgrade from SQLite2 to -3

2009-09-02 Thread Gerry Snyder
Rod Dav4is wrote:
> Thanks for reminding me: A thing's value is generally proportional to 
> its cost. And the attitude of its support team figures in there, too.
> -R.

There is only one person with attitude I see here, and it is not Dr. 
Hipp and it is not P. Kishor.

I have never seen a program, free or commercial, with better support.


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


Re: [sqlite] Booleans in SQLite

2009-09-02 Thread Jay A. Kreibich
On Wed, Sep 02, 2009 at 05:44:38PM -0400, Shaun Seckman (Firaxis) scratched on 
the wall:

> I'm just curious how difficult it would be to add
> support for booleans in SQLite.  This would most likely involve adding a
> new type affinity as well as adding "true" and "false" keywords to the
> lexer.  There's much more that could be done but I'm just looking for
> rudimentary support.

  It is easier to just use integers.  As most of you know, in SQLite3
  the size of the storage data for an integer scales, depending on the
  size of the integer.  Integer values between -128 and 127 use only a
  single byte of storage above and beyond the header size that all
  values have.  That's not nothing, but it is pretty small.  
  
  If you want syntax, write a TRUE() function that returns 1, and a
  FALSE() function that returns 0.  You could also write a BOOL(x)
  function that returns a 'true' or 'false' string (or 'T' and 'F')
  if passed a 1 or 0 integer value, and returns an integer 1 or 0 if
  passed the strings 'true', 'T', 'false' or 'F'.  That wouldn't be a
  new native type, exactly, but it would make for some fairly readable
  SQL and the ability to generate reports with 'T' and 'F' rather
  than 1 and 0.



  As for data savings, the Version 4 file format extended the integer
  data representation to include "zero length" integers.  This was done
  specifically to make Boolean values even less expensive.  The
  integer values 0 and 1 have a specific storage type that requires
  no additional data, similar to the NULL value type.  This saves one
  data byte per Boolean value.



  OK, let me see if I can get this straight   *deep breath*

  The V4 file was introduced and made the default in 3.3.0.  About eight
  months later, in 3.3.6, the default format for new databases was
  changed back to the old V1 file format.  However, every version of
  SQLite since 3.3.0 has had the ability to read and write the newer
  file format-- the only change was to the default format used for new
  databases.  Once a database is created in a specific format, it stays
  in that format (until you VACUUM it).

  To build SQLite such that it uses the new format by default, define
  the build option SQLITE_DEFAULT_FILE_FORMAT=4.  You can also specify
  the default format for new database at runtime via the "PRAGMA
  legacy_file_format" command.  If you want to make a new database in
  the V4 format, you'd set "PRAGMA legacy_file_format=false" as soon as
  you open the database, before any I/O is done (e.g. before the first
  CREATE TABLE).

  You can convert a V1 database into a V4 database by opening it,
  setting the legacy PRAGMA to false, and the VACUUMing the database.
  You can convert back in a similar way.  In fact, be cautious of that.
  If you have a build that defaults to V1, make sure you turn the
  legacy PRAGMA off before you VACUUM a V4 database, or it will convert
  it back to V1 (I think...).

  http://www.sqlite.org/compile.html#default_file_format
  http://www.sqlite.org/pragma.html#pragma_legacy_file_format

  I think that's all correct.  I'm sure someone will jump in and
  correct me if I got something mix up.  It's a bit confusing.

   -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] Making Update fast

2009-09-02 Thread souvik.datta

Hello,

I am having a table which contains meta data of some Mp3 files. The table may 
contain 6000 to 7000 records. Every time a device is inserted, I am reading the 
device and based on a logic, I update a column value - from 0 to 1. This needs 
to be done for every record that are there in the table.
The sql statement is:

Update  set Flag=1 where Filename=;

The updates taking huge amount of time. I tried to wrap these updates within 
transactions (50 updates within one transaction) but that is actually causing 
the a Read thread (the one which is trying to read the Metadata info ) to 
starve.
If I am not using the transaction , the read thread response is much better but 
then the updates are running real slow.

Can some suggest how I can improve this?

Thanks and Regards,
Souvik

Please do not print this email unless it is absolutely necessary. 

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
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problems encountered on upgrade from SQLite2 to -3

2009-09-02 Thread Rod Dav4is
Thanks for reminding me: A thing's value is generally proportional to 
its cost. And the attitude of its support team figures in there, too.
-R.

P Kishor wrote:
> On Wed, Sep 2, 2009 at 3:54 PM, Rod Dav4is wrote:
>   
>> Whether _you_ consider them problems or not, they were certainly
>> problems for me, migrating a working application to version 3 and having
>> it fall over in subtle ways because of these undocumented two vs three
>> differences. They cost me several hours of unnecessary analysis time.
>> 
>
> You should bill DRH for this. Or, ask for your money back. Seriously,
> esp. since the product is still under warranty.
>
>
>
>
>   
>> D. Richard Hipp wrote:
>> 
>>> On Sep 1, 2009, at 4:38 PM, Rod Dav4is wrote:
>>>
>>>
>>>   
 Aren't these problems considered worth fixing ?

 
>>> I do not consider them to be problems.
>>>
>>>
>>>   
 Rod Dav4is wrote:

 
>   1.   *OID vs ROWID*: Specification of the OID field name (in
> SELECT)
>  did not set Rexx variables X.OID.n, but instead set variables
>  x.ROWID.n
>
>   
>>> The "name" of a result column is undefined unless you use the "AS"
>>> clause.  We try to be reasonably consistent, but there are no
>>> promises.  There are especially no promises when moving form 2.8 to 3.6
>>>
>>>
>>>
>>>   
>   2. *Quotes in SELECT*: Specification of Field='3' failed to find
>  hits; Field=3 (i.e. without quotes) was required.
>
>   
>>> This is a feature, not a bug.  SQLite 3.x distinguishes between
>>> integers and strings and does not consider them equal to one another.
>>> You might have some rows where Field='3' and different rows where
>>> Field=3 and SQLite will distinguish between them.
>>>
>>> D. Richard Hipp
>>> d...@hwaci.com
>>>
>>>
>>>
>>> ___
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>>
>>>
>>>
>>>   
>> --
>> Regards, Rod Dav4is / P.O. Box 118 / Hyde Park, NY 12538 / USA
>> Genealogy, et Cetera: http://freepages.rootsweb.ancestry.com/~dav4is/
>> 538 ancestral & collateral families, mostly 17°-19° century
>> New England & European roots. Total population: 136,000+
>> Annex: http://www.gencircles.com/users/dav4is/
>> email: dav...@yahoo.com
>> A Democrat, a Republican and a giraffe walk into a bar. The
>> bartender looks up from his want ads and says, "What is this, a joke?"
>> -unknown
>>
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>> 
>
>
>
>   

-- 
Regards, Rod Dav4is / P.O. Box 118 / Hyde Park, NY 12538 / USA
Genealogy, et Cetera: http://freepages.rootsweb.ancestry.com/~dav4is/
538 ancestral & collateral families, mostly 17°-19° century 
New England & European roots. Total population: 136,000+
Annex: http://www.gencircles.com/users/dav4is/
email: dav...@yahoo.com
A Democrat, a Republican and a giraffe walk into a bar. The 
bartender looks up from his want ads and says, "What is this, a joke?"
-unknown


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


[sqlite] SQLite Porting: Adding new VFS

2009-09-02 Thread mwnn
Hi all,
I am working on porting SQLite on to a proprietary Operating system. 
The 
application that uses SQLite keeps the database in memory.. So in this case 
can I assign NULL to pMethods pointer in sqlite3_file structure.

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


Re: [sqlite] SQLite 3.6.17

2009-09-02 Thread P Kishor
On Wed, Sep 2, 2009 at 6:14 PM, Simon Slavin wrote:
>
> On 2 Sep 2009, at 8:27pm, P Kishor wrote:
>
>> Simon
>> Slavin wrote:
>>>
>>> On 2 Sep 2009, at 2:39pm, Alberto Simões wrote:
>>>
 Can you please send me your env?
>>>
>>> It works fine for me on Leopard, and I have done no special
>>> environment setting at all: I use the default Unix settings and the
>>> default SQLite settings for 10.5.
>>>
>>> You might want to check which shell you're using (csh ?  bash ?) to
>>> see if the shell is filtering out your funny characters for you.
>>
>> actually, does not work for me.
>
> I apologise.  You're quite right: you can't type non-ASCII characters into
> the sqlite3 command-line tool.  What I'd done when I was testing was to put
> commands into a text file and use the '.read' command.  I just tested this:
> make a text file with the following in:
>
> CREATE TABLE myTab (myCol TEXT);
> INSERT INTO myTab (myCol) VALUES ('pub');
> INSERT INTO myTab (myCol) VALUES ('café');
>
> Then I did this:
>
> SimonsMBP2009:Desktop simon$ sqlite3 testchars.sql
> SQLite version 3.4.0
> Enter ".help" for instructions
> sqlite> .read commands.txt
> sqlite> SELECT * FROM myTab;
> pub
> café
> sqlite> .dump
> BEGIN TRANSACTION;
> CREATE TABLE myTab (myCol TEXT);
> INSERT INTO "myTab" VALUES('pub');
> INSERT INTO "myTab" VALUES('café');
> COMMIT;
> sqlite>
>
> As you can see, the accented character went in fine, and sqlite retained and
> displays it fine.  The problem is you just can't type such a character, or
> you can't using an unchanged bash shell.  The setting for the bash
> command-line would be
>
> set input-meta on
>
> This allows bash to handle the accented e correctly.  But it's not passed
> into the command-line tool that comes with OS X 10.5.  I'll be able to test
> this with the version of sqlite3 that comes with 10.6 soon.
>

well, I think the problem is with the sqlite3 command line tool. I can
type accented characters in the Terminal.app using bash and no fancy
setting just fine. See below

punk...@lucknow ~$I ate at el niño café çirca 1984 with ümlaut and hei∫e in øslo
-bash: I: command not found
punk...@lucknow ~$sqlite3
SQLite version 3.6.11
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table t1(x);
sqlite> insert into t1 values ('I ate at el nio caf irca 1984 with
mlaut e in Heislo');
sqlite> select * from t1;
I ate at el nio caf irca 1984 with mlaut e in Heislo
sqlite>


setting input-meta on doesn't change the above behavior at all.


> Simon.



-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
---
Assertions are politics; backing up assertions with evidence is science
===
Sent from Madison, WI, United States
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite 3.6.17

2009-09-02 Thread Simon Slavin

On 2 Sep 2009, at 8:27pm, P Kishor wrote:

> Simon
> Slavin wrote:
>>
>> On 2 Sep 2009, at 2:39pm, Alberto Simões wrote:
>>
>>> Can you please send me your env?
>>
>> It works fine for me on Leopard, and I have done no special
>> environment setting at all: I use the default Unix settings and the
>> default SQLite settings for 10.5.
>>
>> You might want to check which shell you're using (csh ?  bash ?) to
>> see if the shell is filtering out your funny characters for you.
>
> actually, does not work for me.

I apologise.  You're quite right: you can't type non-ASCII characters  
into the sqlite3 command-line tool.  What I'd done when I was testing  
was to put commands into a text file and use the '.read' command.  I  
just tested this: make a text file with the following in:

CREATE TABLE myTab (myCol TEXT);
INSERT INTO myTab (myCol) VALUES ('pub');
INSERT INTO myTab (myCol) VALUES ('café');

Then I did this:

SimonsMBP2009:Desktop simon$ sqlite3 testchars.sql
SQLite version 3.4.0
Enter ".help" for instructions
sqlite> .read commands.txt
sqlite> SELECT * FROM myTab;
pub
café
sqlite> .dump
BEGIN TRANSACTION;
CREATE TABLE myTab (myCol TEXT);
INSERT INTO "myTab" VALUES('pub');
INSERT INTO "myTab" VALUES('café');
COMMIT;
sqlite>

As you can see, the accented character went in fine, and sqlite  
retained and displays it fine.  The problem is you just can't type  
such a character, or you can't using an unchanged bash shell.  The  
setting for the bash command-line would be

set input-meta on

This allows bash to handle the accented e correctly.  But it's not  
passed into the command-line tool that comes with OS X 10.5.  I'll be  
able to test this with the version of sqlite3 that comes with 10.6 soon.

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


[sqlite] Booleans in SQLite

2009-09-02 Thread Shaun Seckman (Firaxis)
Hello everyone,

I'm just curious how difficult it would be to add
support for booleans in SQLite.  This would most likely involve adding a
new type affinity as well as adding "true" and "false" keywords to the
lexer.  There's much more that could be done but I'm just looking for
rudimentary support.



I understand that ANSI C doesn't have native support for
booleans and that's fine, I would just like to reduce some memory
overhead as well as use those keywords instead of creating integer
fields using 0 and 1.

 

-Shaun

 

 

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


Re: [sqlite] Booleans in SQLite

2009-09-02 Thread Nicolas Williams
On Wed, Sep 02, 2009 at 05:44:38PM -0400, Shaun Seckman (Firaxis) wrote:
> I'm just curious how difficult it would be to add
> support for booleans in SQLite.  This would most likely involve adding a
> new type affinity as well as adding "true" and "false" keywords to the
> lexer.  There's much more that could be done but I'm just looking for
> rudimentary support.

The SQL Standard does specify and OPTIONAL boolean type.

> I understand that ANSI C doesn't have native support for
> booleans and that's fine,

ANSI C99 most certainly does have a boolean type.

>   I would just like to reduce some memory
> overhead as well as use those keywords instead of creating integer
> fields using 0 and 1.

SQLite3 uses a variable length encoding for integers on disk, so you
will gain no space on disk by having a native boolean type.

Well, if you had a table with a single column and that column was a
boolean, an RDBMS could express the entire table as a sparse bitstring
indexed by row number/ID/OID, with two bits per row (two bits would be
needed to encode: true, false, null/unknown, and "this record doesn't
exist").  But such a thing would be a huge new feature for SQLite3, with
very few uses.

And you're not really going to save memory in SQLite3 by having a
boolean type either -- 31 or 63 bits are a wash in the context of
evaluating a prepared statement.

_Your_ application could save memory by treating booleans as a single
bit and packing them into bitstrings, but you can do that now without
any help from SQLite3.

A group_concat() like aggregation function could be defined that groups
and concatenates boolean inputs into a bitstring -- this might be
helpful to you.

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


[sqlite] Determining which DB a journal or temp file belongs to

2009-09-02 Thread Dave Toll
Hello list

 

I'm using SQLite with a custom VFS on an embedded platform. I'd like to
place an upper (soft) limit on the amount of disk space used by a
database - i.e. the sum of the main database file size, journal file
size, and any associated temp file sizes. At the VFS level, is there any
way to determine which database an sqlite3_file* belongs to?

 

There was an interesting thread on this topic last year involving
sqlite3_file_control():

http://www.nabble.com/How-to-limit-the-size-of-the-database-files--td201
29606.html

 

However I think sqlite3_file_control() can only be used to access the
sqlite3_file* object corresponding to the main database file, not the
journal or temp files.

 

Cheers,

Dave.

 

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


Re: [sqlite] Booleans in SQLite

2009-09-02 Thread Pavel Ivanov
> I would just like to reduce some memory
> overhead as well as use those keywords instead of creating integer
> fields using 0 and 1.

I'm curious, what "memory overhead" do you think will be reduced in
case of using booleans instead of integers?

Pavel

On Wed, Sep 2, 2009 at 5:44 PM, Shaun Seckman
(Firaxis) wrote:
> Hello everyone,
>
>                I'm just curious how difficult it would be to add
> support for booleans in SQLite.  This would most likely involve adding a
> new type affinity as well as adding "true" and "false" keywords to the
> lexer.  There's much more that could be done but I'm just looking for
> rudimentary support.
>
>
>
>                I understand that ANSI C doesn't have native support for
> booleans and that's fine, I would just like to reduce some memory
> overhead as well as use those keywords instead of creating integer
> fields using 0 and 1.
>
>
>
> -Shaun
>
>
>
>
>
> ___
> 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] Problems encountered on upgrade from SQLite2 to -3

2009-09-02 Thread P Kishor
On Wed, Sep 2, 2009 at 3:54 PM, Rod Dav4is wrote:
> Whether _you_ consider them problems or not, they were certainly
> problems for me, migrating a working application to version 3 and having
> it fall over in subtle ways because of these undocumented two vs three
> differences. They cost me several hours of unnecessary analysis time.

You should bill DRH for this. Or, ask for your money back. Seriously,
esp. since the product is still under warranty.




>
> D. Richard Hipp wrote:
>> On Sep 1, 2009, at 4:38 PM, Rod Dav4is wrote:
>>
>>
>>> Aren't these problems considered worth fixing ?
>>>
>>
>> I do not consider them to be problems.
>>
>>
>>> Rod Dav4is wrote:
>>>
   1.   *OID vs ROWID*: Specification of the OID field name (in
 SELECT)
      did not set Rexx variables X.OID.n, but instead set variables
      x.ROWID.n

>>
>> The "name" of a result column is undefined unless you use the "AS"
>> clause.  We try to be reasonably consistent, but there are no
>> promises.  There are especially no promises when moving form 2.8 to 3.6
>>
>>
>>
   2. *Quotes in SELECT*: Specification of Field='3' failed to find
      hits; Field=3 (i.e. without quotes) was required.

>>
>> This is a feature, not a bug.  SQLite 3.x distinguishes between
>> integers and strings and does not consider them equal to one another.
>> You might have some rows where Field='3' and different rows where
>> Field=3 and SQLite will distinguish between them.
>>
>> D. Richard Hipp
>> d...@hwaci.com
>>
>>
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>>
>>
>
> --
> Regards, Rod Dav4is / P.O. Box 118 / Hyde Park, NY 12538 / USA
> Genealogy, et Cetera: http://freepages.rootsweb.ancestry.com/~dav4is/
> 538 ancestral & collateral families, mostly 17°-19° century
> New England & European roots. Total population: 136,000+
> Annex: http://www.gencircles.com/users/dav4is/
> email: dav...@yahoo.com
> A Democrat, a Republican and a giraffe walk into a bar. The
> bartender looks up from his want ads and says, "What is this, a joke?"
> -unknown
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


Re: [sqlite] Problems encountered on upgrade from SQLite2 to -3

2009-09-02 Thread Rod Dav4is
Whether _you_ consider them problems or not, they were certainly 
problems for me, migrating a working application to version 3 and having 
it fall over in subtle ways because of these undocumented two vs three 
differences. They cost me several hours of unnecessary analysis time.

D. Richard Hipp wrote:
> On Sep 1, 2009, at 4:38 PM, Rod Dav4is wrote:
>
>   
>> Aren't these problems considered worth fixing ?
>> 
>
> I do not consider them to be problems.
>
>   
>> Rod Dav4is wrote:
>> 
>>>   1.   *OID vs ROWID*: Specification of the OID field name (in  
>>> SELECT)
>>>  did not set Rexx variables X.OID.n, but instead set variables
>>>  x.ROWID.n
>>>   
>
> The "name" of a result column is undefined unless you use the "AS"  
> clause.  We try to be reasonably consistent, but there are no  
> promises.  There are especially no promises when moving form 2.8 to 3.6
>
>
>   
>>>   2. *Quotes in SELECT*: Specification of Field='3' failed to find
>>>  hits; Field=3 (i.e. without quotes) was required.
>>>   
>
> This is a feature, not a bug.  SQLite 3.x distinguishes between  
> integers and strings and does not consider them equal to one another.   
> You might have some rows where Field='3' and different rows where  
> Field=3 and SQLite will distinguish between them.
>
> D. Richard Hipp
> d...@hwaci.com
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>   

-- 
Regards, Rod Dav4is / P.O. Box 118 / Hyde Park, NY 12538 / USA
Genealogy, et Cetera: http://freepages.rootsweb.ancestry.com/~dav4is/
538 ancestral & collateral families, mostly 17°-19° century 
New England & European roots. Total population: 136,000+
Annex: http://www.gencircles.com/users/dav4is/
email: dav...@yahoo.com
A Democrat, a Republican and a giraffe walk into a bar. The 
bartender looks up from his want ads and says, "What is this, a joke?"
-unknown


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


Re: [sqlite] SQLite 3.6.17

2009-09-02 Thread P Kishor
2009/9/2 Alberto Simões :
> Simon, try to compile a gnu version of readline, and then compile sqlite
> againt it. It should do the trick.


actually, it is me, not Simon, who is experiencing this problem.
Before I jump into compiling a new readline lib, I want to ascertain
if that is what others (such as Simon or DRH) did who are *not* having
any such issues on the Mac.

>
> All the best,
> Alberto
>
> On Wed, Sep 2, 2009 at 8:27 PM, P Kishor  wrote:
>>
>> On Wed, Sep 2, 2009 at 10:55 AM, Simon
>> Slavin wrote:
>> >
>> > On 2 Sep 2009, at 2:39pm, Alberto Simões wrote:
>> >
>> >> Can you please send me your env?
>> >
>> > It works fine for me on Leopard, and I have done no special
>> > environment setting at all: I use the default Unix settings and the
>> > default SQLite settings for 10.5.
>> >
>> > You might want to check which shell you're using (csh ?  bash ?) to
>> > see if the shell is filtering out your funny characters for you.
>>
>>
>> actually, does not work for me. I am using bash, and while both in
>> Terminal.app and in iTerm.app, the character encoding is set to
>> Unicode (UTF-8), none of the accented characters work. When I type
>> 'café', for example, upon typing Option-e, I get the accent mark, but
>> when I type e, instead of getting é, I get nothing. It wipes the
>> accent, and the cursor doesn't move.
>>
>>
>> >
>> > Simon.
>> > --
>> >  http://www.hearsay.demon.co.uk | I'd expect if a computer was involved
>> >                                 | it all would have been much worse.
>> >    No Buffy for you.            |                -- John "West" McKenna
>> >    Leave quickly now. -- Anya   |          THE FRENCH WAS THERE
>> >
>> > ___
>> > sqlite-users mailing list
>> > sqlite-users@sqlite.org
>> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> >
>>
>>
>>
>> --
>> Puneet Kishor http://www.punkish.org
>> Carbon Model http://carbonmodel.org
>> Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
>> Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
>> Nelson Institute, UW-Madison http://www.nelson.wisc.edu
>> ---
>> Assertions are politics; backing up assertions with evidence is science
>> ===
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> --
> Alberto Simões
>
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite 3.6.17

2009-09-02 Thread Alberto Simões
Simon, try to compile a gnu version of readline, and then compile sqlite
againt it. It should do the trick.

All the best,
Alberto

On Wed, Sep 2, 2009 at 8:27 PM, P Kishor  wrote:

> On Wed, Sep 2, 2009 at 10:55 AM, Simon
> Slavin wrote:
> >
> > On 2 Sep 2009, at 2:39pm, Alberto Simões wrote:
> >
> >> Can you please send me your env?
> >
> > It works fine for me on Leopard, and I have done no special
> > environment setting at all: I use the default Unix settings and the
> > default SQLite settings for 10.5.
> >
> > You might want to check which shell you're using (csh ?  bash ?) to
> > see if the shell is filtering out your funny characters for you.
>
>
> actually, does not work for me. I am using bash, and while both in
> Terminal.app and in iTerm.app, the character encoding is set to
> Unicode (UTF-8), none of the accented characters work. When I type
> 'café', for example, upon typing Option-e, I get the accent mark, but
> when I type e, instead of getting é, I get nothing. It wipes the
> accent, and the cursor doesn't move.
>
>
> >
> > Simon.
> > --
> >  http://www.hearsay.demon.co.uk | I'd expect if a computer was involved
> > | it all would have been much worse.
> >No Buffy for you.|-- John "West" McKenna
> >Leave quickly now. -- Anya   |  THE FRENCH WAS THERE
> >
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> Puneet Kishor http://www.punkish.org
> Carbon Model http://carbonmodel.org
> Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
> Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
> Nelson Institute, UW-Madison http://www.nelson.wisc.edu
> ---
> Assertions are politics; backing up assertions with evidence is science
> ===
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


Re: [sqlite] SQLite 3.6.17

2009-09-02 Thread P Kishor
On Wed, Sep 2, 2009 at 10:55 AM, Simon
Slavin wrote:
>
> On 2 Sep 2009, at 2:39pm, Alberto Simões wrote:
>
>> Can you please send me your env?
>
> It works fine for me on Leopard, and I have done no special
> environment setting at all: I use the default Unix settings and the
> default SQLite settings for 10.5.
>
> You might want to check which shell you're using (csh ?  bash ?) to
> see if the shell is filtering out your funny characters for you.


actually, does not work for me. I am using bash, and while both in
Terminal.app and in iTerm.app, the character encoding is set to
Unicode (UTF-8), none of the accented characters work. When I type
'café', for example, upon typing Option-e, I get the accent mark, but
when I type e, instead of getting é, I get nothing. It wipes the
accent, and the cursor doesn't move.


>
> Simon.
> --
>  http://www.hearsay.demon.co.uk | I'd expect if a computer was involved
>                                 | it all would have been much worse.
>    No Buffy for you.            |                -- John "West" McKenna
>    Leave quickly now. -- Anya   |          THE FRENCH WAS THERE
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
---
Assertions are politics; backing up assertions with evidence is science
===
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] load extension -- unload hook?

2009-09-02 Thread sub sk79
Sure!

Here are the results:
 Good:
   The 'destructor' function attribute works just as advertised. I
have included below the modified half.so example code from sqlite website
with the 'constructor' and  'destructor' functions (for linux using gcc).

Bad:
The '.q' command on sqlite command-line utility  attempts to close
the database before calling 'dlclose' on the loaded extension library. I
think this should be fixed in SQLite code.  Here is the log:
===
sqlite> .load ./libMyLib.so
Success create function: MyLib_test
sqlite> .q
error closing database: Unable to close due to unfinalised statements
Success drop function: MyLib_test
===

MODIFIED HALF.c
===
#include 
SQLITE_EXTENSION_INIT1

void construct() __attribute__ ((constructor));
void construct(){
printf("-In Constructor-\n");
};
void destruct() __attribute__ ((destructor));
void destruct(){
printf("-In Destructor-\n");
};
/*
** The half() SQL function returns half of its input value.
*/
static void halfFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  sqlite3_result_double(context, 0.5*sqlite3_value_double(argv[0]));
}

/* SQLite invokes this routine once when it loads the extension.
** Create new functions, collating sequences, and virtual table
** modules here.  This is usually the only exported symbol in
** the shared library.
*/
int sqlite3_extension_init(
  sqlite3 *db,
  char **pzErrMsg,
  const sqlite3_api_routines *pApi
){
//sqlite3_enable_load_extension(db,1);
  SQLITE_EXTENSION_INIT2(pApi)
  sqlite3_create_function(db, "half", 1, SQLITE_ANY, 0, halfFunc, 0, 0);
  return 0;
}

===


LOG OF HALF.SO
===
sqlite> .load ./half.so
-In Constructor-
sqlite> .q
-In Destructor-
===

Thanks,
SK

On Tue, Sep 1, 2009 at 5:54 PM, Jean-Christophe Deschamps wrote:

> Hi,
>
> ´¯¯¯
> >2. Following up on windows dllmain  info - which was very useful in itself
> >-  but since we use both windows and linux, I checked the equivalent for
> >linux as well and yes, luckily, gcc allows you to define a 'function
> >attribute' called 'constructor' and 'destructor' which can be used to
> >export
> >the functions in your shared lib to  invoke at dlopen and dlclose. So, I
> >should be able to use this 'destructor'-attributed function for library
> >stuff cleanup on linux - haven't gotten to testing it yet though.
> `---
>
> I wasn't sure such a possibility was available on Linux, but it was
> nonetheless probable nowadays.
>
> So if it works more or less similarily, you are just a few #ifdef away
> from a workable solution for both systems.  That's a good news.  Let us
> know how it turns out.  I bet others would love to find an already
> tested solution in some future.
>
>
>
> ___
> 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] SQLite 3.6.17

2009-09-02 Thread Simon Slavin

On 2 Sep 2009, at 2:39pm, Alberto Simões wrote:

> Can you please send me your env?

It works fine for me on Leopard, and I have done no special  
environment setting at all: I use the default Unix settings and the  
default SQLite settings for 10.5.

You might want to check which shell you're using (csh ?  bash ?) to  
see if the shell is filtering out your funny characters for you.

Simon.
-- 
  http://www.hearsay.demon.co.uk | I'd expect if a computer was involved
 | it all would have been much worse.
No Buffy for you.|-- John "West" McKenna
Leave quickly now. -- Anya   |  THE FRENCH WAS THERE

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


Re: [sqlite] Integer Storage class

2009-09-02 Thread Simon Slavin

On 2 Sep 2009, at 3:26pm, Sebastian Bermudez wrote:

> i chose Integer for Performance isues... i'm develop. an POS  
> Software and our articles table has lot's of records. i need to  
> optimize search. an Integer (1,2,4,6,8 bytes) is faster that 13- 
> bytes-ean text for comparison.

Do you really need that performance ?  Are you comparing thousands of  
records every minute ?  Because handing those codes as if they're  
integers is going to cause problems in the future.  If you really need  
the extra speed you're getting it might be worth it, but if you're  
making things fast just because you know how, you're probably better  
off handling that column as if it's strings, not integers.

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


Re: [sqlite] Integer Storage class

2009-09-02 Thread Gerry Snyder
Beau Wilkinson wrote:
>> i chose Integer for Performance isues... i'm develop. an POS Software 
>> and our articles table has lot's of >records. i need to optimize 
>> search. an Integer (1,2,4,6,8 bytes) is faster that 13-bytes-ean text 
>> for >comparison.
>> 
>
> That's reasonable, but I think Sqlite stores everything as textual data 
> anyway. I think the implication is that this data will take at least 
> one-byte-per-digit. 

Not true in SQLite 3. See: http://www.sqlite.org/datatype3.html


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


Re: [sqlite] Integer Storage class

2009-09-02 Thread Jay A. Kreibich
On Wed, Sep 02, 2009 at 10:47:53AM -0500, Beau Wilkinson scratched on the wall:

> That's reasonable, but I think Sqlite stores everything as textual
> data anyway.

  SQLite2 did store everything as text strings, but SQLite3 does not.
  
  See "Storage Classes":   http://sqlite.org/datatype3.html

   -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] Integer Storage class

2009-09-02 Thread Beau Wilkinson
>i chose Integer for Performance isues... i'm develop. an POS Software and 
>our articles table has lot's of >records. i need to optimize search. 
>an Integer (1,2,4,6,8 bytes) is faster that 13-bytes-ean text for >comparison.

That's reasonable, but I think Sqlite stores everything as textual data anyway. 
I think the implication is that this data will take at least 
one-byte-per-digit. INT should still be a bit smaller than TEXT for your 
purposes, because it will drop the zeros (e.g. string "100" is smaller in 
memory than "100" even though both are still larger than the integer 
100). But if INT simply doesn't have the necessary range, your options are 
limited.


--- El mié 2-sep-09, Beau Wilkinson  escribió:

> De: Beau Wilkinson 
> Asunto: Re: [sqlite] Integer Storage class
> Para: "General Discussion of SQLite Database" 
> Fecha: miércoles, 2 de septiembre de 2009, 11:14 am
> I probably wouldn't use INT for that
> data. I would use TEXT. My feeling is that the data is not
> so much a number as it is an incoming stream of characters
> from an IO device. So, I suspect code built around a TEXT
> column will ultimately be more rational looking. For
> example, you won't have to pad periodically pad your data
> with zeros, there won't be any signed-vs.-unsigned
> confusion, etc.
>
> The one drawback is that an INT implementation may be more
> optimal than a TEXT implementation. The string "65535" takes
> up at least 5 bytes, for example, whereas the number 65535
> (base 10) will fit in two bytes.
> 
> From: sqlite-users-boun...@sqlite.org
> [sqlite-users-boun...@sqlite.org]
> On Behalf Of Simon Davies [simon.james.dav...@googlemail.com]
> Sent: Wednesday, September 02, 2009 9:05 AM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Integer Storage class
>
> 2009/9/2 Sebastian Bermudez :
> > Ok. my problem is my SQLITE front end (SQLITE
> ADMINISTRATOR v 0.8.3.2) ... show me 0 (cero) in that
> column.
>
> Looks like SQLITE ADMINISTRATOR v 0.8.3.2 only deals with
> signed 32
> bit values. 2147483647 it accepts as a valid value,
> 2147483648 it
> rejects, saying that it is not a valid integer.
>
> >
> > thanks
> >
>
> Regards,
> Simon
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> The information contained in this e-mail is privileged and
> confidential information intended only for the use of the
> individual or entity named.  If you are not the
> intended recipient, or the employee or agent responsible for
> delivering this message to the intended recipient, you are
> hereby notified that any disclosure, dissemination,
> distribution, or copying of this communication is strictly
> prohibited.  If you have received this e-mail in error,
> please immediately notify the sender and delete any copies
> from your system.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


  Yahoo! Cocina

Encontra las mejores recetas con Yahoo! Cocina.


http://ar.mujer.yahoo.com/cocina/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

The information contained in this e-mail is privileged and confidential 
information intended only for the use of the individual or entity named.  If 
you are not the intended recipient, or the employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any disclosure, dissemination, distribution, or copying of this communication 
is strictly prohibited.  If you have received this e-mail in error, please 
immediately notify the sender and delete any copies from your system.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] mod_python & sqlite: Doesnt the INSERT istance

2009-09-02 Thread Linknpark



Swithun Crowe wrote:
> 
> Hello
> 
> L the error is
> L OperationalError: unable to open database file
> L 
> L can anyone fix it?
> L note: the db file has the 777 rights and my user has the file owner
> 
> You might need to have write access to the directory containing the 
> database file, as a journal file may be created temporarily in the same 
> directory.
> 
> Swithun.
> 
> 

Thank u man! you were right!
Now i have no error, but doesnt insert the record, it remains empty without
error!!!
very strange isnt it???
-- 
View this message in context: 
http://www.nabble.com/mod_python---sqlite%3A-Doesnt-work-the-INSERT-istance-tp25258303p25259753.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


[sqlite] Compiling SQLite with custom readline

2009-09-02 Thread Alberto Simões
Hello

I am trying to find out why my SQLite does not accept non ascii characters.
So, I compiled readline 6.0 and tried to compile sqlite with it.
As you might imagine at first SQLite detects the system (MAC OS) readline
library.

To use a custom readline I noticed in the configure script:
  --with-readline-lib specify readline library
  --with-readline-inc specify readline include paths

But I found out these flags not working as one usually expect on a configure
script.
I was expecting something like:

  --with-readline-lib=/opt/local/lib
--with-readline-inc=/opt/local/include/readline

but what the configure script was expecting was something like

  --with-readline-lib="-L/opt/local/lib -lreadline"
--with-readline-inc="-I/opt/local/include/readline"

(well, at least it compiled this way)

Therefore, this mail is a suggestion of making that two documentation line
clearer, probably with an example of what is expected.

Oh, by the way, the non-ascii characters are now recognized :)

Cheers
Alberto
-- 
Alberto Simões
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Integer Storage class

2009-09-02 Thread Sebastian Bermudez
i chose Integer for Performance isues... i'm develop. an POS Software and 
our articles table has lot's of records. i need to optimize search. an 
Integer (1,2,4,6,8 bytes) is faster that 13-bytes-ean text for comparison.

--- El mié 2-sep-09, Beau Wilkinson  escribió:

> De: Beau Wilkinson 
> Asunto: Re: [sqlite] Integer Storage class
> Para: "General Discussion of SQLite Database" 
> Fecha: miércoles, 2 de septiembre de 2009, 11:14 am
> I probably wouldn't use INT for that
> data. I would use TEXT. My feeling is that the data is not
> so much a number as it is an incoming stream of characters
> from an IO device. So, I suspect code built around a TEXT
> column will ultimately be more rational looking. For
> example, you won't have to pad periodically pad your data
> with zeros, there won't be any signed-vs.-unsigned
> confusion, etc.
> 
> The one drawback is that an INT implementation may be more
> optimal than a TEXT implementation. The string "65535" takes
> up at least 5 bytes, for example, whereas the number 65535
> (base 10) will fit in two bytes.
> 
> From: sqlite-users-boun...@sqlite.org
> [sqlite-users-boun...@sqlite.org]
> On Behalf Of Simon Davies [simon.james.dav...@googlemail.com]
> Sent: Wednesday, September 02, 2009 9:05 AM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Integer Storage class
> 
> 2009/9/2 Sebastian Bermudez :
> > Ok. my problem is my SQLITE front end (SQLITE
> ADMINISTRATOR v 0.8.3.2) ... show me 0 (cero) in that
> column.
> 
> Looks like SQLITE ADMINISTRATOR v 0.8.3.2 only deals with
> signed 32
> bit values. 2147483647 it accepts as a valid value,
> 2147483648 it
> rejects, saying that it is not a valid integer.
> 
> >
> > thanks
> >
> 
> Regards,
> Simon
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> The information contained in this e-mail is privileged and
> confidential information intended only for the use of the
> individual or entity named.  If you are not the
> intended recipient, or the employee or agent responsible for
> delivering this message to the intended recipient, you are
> hereby notified that any disclosure, dissemination,
> distribution, or copying of this communication is strictly
> prohibited.  If you have received this e-mail in error,
> please immediately notify the sender and delete any copies
> from your system.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 


  Yahoo! Cocina

Encontra las mejores recetas con Yahoo! Cocina.


http://ar.mujer.yahoo.com/cocina/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Integer Storage class

2009-09-02 Thread Beau Wilkinson
I probably wouldn't use INT for that data. I would use TEXT. My feeling is that 
the data is not so much a number as it is an incoming stream of characters from 
an IO device. So, I suspect code built around a TEXT column will ultimately be 
more rational looking. For example, you won't have to pad periodically pad your 
data with zeros, there won't be any signed-vs.-unsigned confusion, etc.

The one drawback is that an INT implementation may be more optimal than a TEXT 
implementation. The string "65535" takes up at least 5 bytes, for example, 
whereas the number 65535 (base 10) will fit in two bytes.

From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] On 
Behalf Of Simon Davies [simon.james.dav...@googlemail.com]
Sent: Wednesday, September 02, 2009 9:05 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Integer Storage class

2009/9/2 Sebastian Bermudez :
> Ok. my problem is my SQLITE front end (SQLITE ADMINISTRATOR v 0.8.3.2) ... 
> show me 0 (cero) in that column.

Looks like SQLITE ADMINISTRATOR v 0.8.3.2 only deals with signed 32
bit values. 2147483647 it accepts as a valid value, 2147483648 it
rejects, saying that it is not a valid integer.

>
> thanks
>

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

The information contained in this e-mail is privileged and confidential 
information intended only for the use of the individual or entity named.  If 
you are not the intended recipient, or the employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any disclosure, dissemination, distribution, or copying of this communication 
is strictly prohibited.  If you have received this e-mail in error, please 
immediately notify the sender and delete any copies from your system.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] mod_python & sqlite: Doesnt the INSERT istance

2009-09-02 Thread Swithun Crowe
Hello

L the error is
L OperationalError: unable to open database file
L 
L can anyone fix it?
L note: the db file has the 777 rights and my user has the file owner

You might need to have write access to the directory containing the 
database file, as a journal file may be created temporarily in the same 
directory.

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


[sqlite] mod_python & sqlite: Doesnt the INSERT istance

2009-09-02 Thread Linknpark

Hello everybody,
im trying to make a simple INSERT query into a sqlite db with the mod_python
module.
the query is:
python code embembed into a web page:
query="""
INSERT INTO Message
VALUES('%s','%s','%s','%s','F');""" % (_ID_, name, email, messaggio)

the error is
OperationalError: unable to open database file

can anyone fix it?
note: the db file has the 777 rights and my user has the file owner

Thank u
-- 
View this message in context: 
http://www.nabble.com/mod_python---sqlite%3A-Doesnt-the-INSERT-istance-tp25258303p25258303.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] Integer Storage class

2009-09-02 Thread Simon Davies
2009/9/2 Sebastian Bermudez :
> Ok. my problem is my SQLITE front end (SQLITE ADMINISTRATOR v 0.8.3.2) ... 
> show me 0 (cero) in that column.

Looks like SQLITE ADMINISTRATOR v 0.8.3.2 only deals with signed 32
bit values. 2147483647 it accepts as a valid value, 2147483648 it
rejects, saying that it is not a valid integer.

>
> thanks
>

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


Re: [sqlite] SQLite 3.6.17

2009-09-02 Thread Alberto Simões
On Wed, Sep 2, 2009 at 2:52 PM, D. Richard Hipp  wrote:

>
> On Sep 2, 2009, at 9:46 AM, D. Richard Hipp wrote:
> >>>
> >>> It worked for me before. No idea what is happenning.
> >> Can you please send me your env?
> >
> >
>
>
> sqlite-imac:bld drh$ ./sqlite3
> SQLite version 3.6.17
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite> create table t1(x);
> sqlite> insert into t1 values('Alberto Simões ξ €  夷');
> sqlite> select * from t1;
> Alberto Simões ξ € 夷
> sqlite> select hex(x) from t1;
> 416C626572746F2053696DC3B5657320CEBE20E282AC20E5A4B7
> sqlite> sqlite-imac:bld drh$ env
> MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11/man
> TERM_PROGRAM=Apple_Terminal
> TERM=xterm-color
> SHELL=/bin/bash
> TMPDIR=/var/folders/9H/9H+KCJI3F5K1xNlxD8BM7TI/-Tmp-/
> Apple_PubSub_Socket_Render=/tmp/launch-CFpjwW/Render
> TERM_PROGRAM_VERSION=240.2
> USER=drh
> COMMAND_MODE=unix2003
> SSH_AUTH_SOCK=/tmp/launch-FWX7Up/Listeners
> __CF_USER_TEXT_ENCODING=0x1F5:0:0
> PATH=/opt/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/
> X11/bin
> PWD=/Users/drh/sqlite/bld
> LANG=en_US.UTF-8
> SHLVL=1
> HOME=/Users/drh
> LOGNAME=drh
> VISUAL=e
> DISPLAY=/tmp/launch-GNoo4x/:0
> SECURITYSESSIONID=a8c400
> _=/usr/bin/env
> OLDPWD=/Users/drh/sqlite/sqlite
> sqlite-imac:bld drh$
>

Thank you. Nothing easy to detect.
I'll dig a little more on it.

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


Re: [sqlite] SQLite 3.6.17

2009-09-02 Thread D. Richard Hipp

On Sep 2, 2009, at 9:46 AM, D. Richard Hipp wrote:
>>>
>>> It worked for me before. No idea what is happenning.
>> Can you please send me your env?
>
>


sqlite-imac:bld drh$ ./sqlite3
SQLite version 3.6.17
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table t1(x);
sqlite> insert into t1 values('Alberto Simões ξ €  夷');
sqlite> select * from t1;
Alberto Simões ξ € 夷
sqlite> select hex(x) from t1;
416C626572746F2053696DC3B5657320CEBE20E282AC20E5A4B7
sqlite> sqlite-imac:bld drh$ env
MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11/man
TERM_PROGRAM=Apple_Terminal
TERM=xterm-color
SHELL=/bin/bash
TMPDIR=/var/folders/9H/9H+KCJI3F5K1xNlxD8BM7TI/-Tmp-/
Apple_PubSub_Socket_Render=/tmp/launch-CFpjwW/Render
TERM_PROGRAM_VERSION=240.2
USER=drh
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-FWX7Up/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:0
PATH=/opt/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/ 
X11/bin
PWD=/Users/drh/sqlite/bld
LANG=en_US.UTF-8
SHLVL=1
HOME=/Users/drh
LOGNAME=drh
VISUAL=e
DISPLAY=/tmp/launch-GNoo4x/:0
SECURITYSESSIONID=a8c400
_=/usr/bin/env
OLDPWD=/Users/drh/sqlite/sqlite
sqlite-imac:bld drh$

D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] SQLite 3.6.17

2009-09-02 Thread D. Richard Hipp


On Sep 2, 2009, at 9:39 AM, Alberto Simões wrote:


Hello, drh.

On Wed, Sep 2, 2009 at 2:28 PM, D. Richard Hipp  wrote:





Works for me:

sqlite-imac:bld drh$ ./sqlite3
SQLite version 3.6.17
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table t1(x);
sqlite> insert into t1 values('Alberto Simões ξ €  夷');
sqlite> select * from t1;
Alberto Simões ξ € 夷
sqlite>

It worked for me before. No idea what is happenning.

Can you please send me your env?






Thank you
Alberto
--
Alberto Simões
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] SQLite 3.6.17

2009-09-02 Thread Alberto Simões
Hello, drh.

On Wed, Sep 2, 2009 at 2:28 PM, D. Richard Hipp  wrote:

>
>
>
> Works for me:
>
> sqlite-imac:bld drh$ ./sqlite3
> SQLite version 3.6.17
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite> create table t1(x);
> sqlite> insert into t1 values('Alberto Simões ξ €  夷');
> sqlite> select * from t1;
> Alberto Simões ξ € 夷
> sqlite>
>
> It worked for me before. No idea what is happenning.
Can you please send me your env?

Thank you
Alberto
-- 
Alberto Simões
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite 3.6.17

2009-09-02 Thread D. Richard Hipp

On Sep 2, 2009, at 9:06 AM, Alberto Simões wrote:

> Hellows
>
> Noticed today (with SQLite 3.6.17) that I can't insert non latin1  
> character
> using the sqlite3 shell.
> I am running under Mac OS Leopard (not yet the white one), and using  
> an
> unicode terminal.


Works for me:

sqlite-imac:bld drh$ ./sqlite3
SQLite version 3.6.17
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table t1(x);
sqlite> insert into t1 values('Alberto Simões ξ €  夷');
sqlite> select * from t1;
Alberto Simões ξ € 夷
sqlite>


D. Richard Hipp
d...@hwaci.com



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


[sqlite] SQLite 3.6.17

2009-09-02 Thread Alberto Simões
Hellows

Noticed today (with SQLite 3.6.17) that I can't insert non latin1 character
using the sqlite3 shell.
I am running under Mac OS Leopard (not yet the white one), and using an
unicode terminal.

This worked before, but not sure with which version... :-/

Thanks for any hint.
Alberto
-- 
Alberto Simões
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Integer Storage class

2009-09-02 Thread Sebastian Bermudez
Ok. my problem is my SQLITE front end (SQLITE ADMINISTRATOR v 0.8.3.2) ... show 
me 0 (cero) in that column.

thanks

--- El mié 2-sep-09, Simon Davies  escribió:

> De: Simon Davies 
> Asunto: Re: [sqlite] Integer Storage class
> Para: "General Discussion of SQLite Database" 
> Fecha: miércoles, 2 de septiembre de 2009, 9:12 am
> 2009/9/2 Sebastian Bermudez :
> > hi! i have an table ( articles ) with a column for
> EAN13 Barcodes like (
> > 7790080066784).
> > I have created the column with Integer data type... (
> i have chose that data type after read the SQLITE DOC where
> it' say: "INTEGER. The value is a signed integer, stored in
> 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the
> value.") but when i insert this value for that column... i
> get 0 (cero) stored in that place...
> 
> SQLite version 3.6.16
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite>
> sqlite> create table tst( c1 integer );
> sqlite>
> sqlite> insert into tst values( 7790080066784 );
> sqlite>
> sqlite> select * from tst;
> 7790080066784
> sqlite>
> 
> No apparent problem...
> 
> >
> >
> > Have any idea ?
> 
> You need to provide more information on what you are
> doing.
> 
> >
> > Att.
> > Sebastian
> >
> > PD: Sorry i don't study english
> >
> 
> Regards,
> Simon
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 


  Yahoo! Cocina

Encontra las mejores recetas con Yahoo! Cocina.


http://ar.mujer.yahoo.com/cocina/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Integer Storage class

2009-09-02 Thread Simon Davies
2009/9/2 Sebastian Bermudez :
> hi! i have an table ( articles ) with a column for EAN13 Barcodes like (
> 7790080066784).
> I have created the column with Integer data type... ( i have chose that data 
> type after read the SQLITE DOC where it' say: "INTEGER. The value is a signed 
> integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of 
> the value.") but when i insert this value for that column... i get 0 (cero) 
> stored in that place...

SQLite version 3.6.16
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
sqlite> create table tst( c1 integer );
sqlite>
sqlite> insert into tst values( 7790080066784 );
sqlite>
sqlite> select * from tst;
7790080066784
sqlite>

No apparent problem...

>
>
> Have any idea ?

You need to provide more information on what you are doing.

>
> Att.
> Sebastian
>
> PD: Sorry i don't study english
>

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


[sqlite] Integer Storage class

2009-09-02 Thread Sebastian Bermudez
hi! i have an table ( articles ) with a column for EAN13 Barcodes like (
7790080066784).
I have created the column with Integer data type... ( i have chose that data 
type after read the SQLITE DOC where it' say: "INTEGER. The value is a signed 
integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the 
value.") but when i insert this value for that column... i get 0 (cero) stored 
in that place...


Have any idea ?

Att.
Sebastian

PD: Sorry i don't study english


  Yahoo! Cocina

Encontra las mejores recetas con Yahoo! Cocina.


http://ar.mujer.yahoo.com/cocina/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Looking for a w_char alternative for sqlite3_get_table

2009-09-02 Thread A.J.Millan
>If you believe you really need it for some reason, you can write your
>own. There's no black magic in sqlite3_get_table, it uses public API
>only. The source code is freely available in SQLite distribution.Igor: 
>Thanks again.Indeed, sometimes the most obvious solution is difficult to 
>see. I need to take a closer look to that code.A.J.Millan 

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


Re: [sqlite] Looking for a w_char alternative for sqlite3_get_table

2009-09-02 Thread A.J.Millan
Absolutely agree; only mention that my request for "a 16 bit version of the 
sqlite3_get_table" refers to a UTF-16 version -as usual in the actual C/C++ 
API-.

Of course, besides -or instead- the requested function, would be great 
disclose the SQLite UTF-8/UTF-16 conversion mechanism.

A.J.Millan

- Original Message - 
From: "Nicolas Williams" 

> On Tue, Sep 01, 2009 at 10:41:27AM +0200, A.J.Millan wrote:
>> *  Make sure there was no 16-bit version of the sqlite3_get_table at
>> function -perhaps it would be a good idea to include it in the standard 
>> API.
>> The reason is the same who advised include the current version.
>
> It might be easier to provide utility functions for UTF-8<->UTF-16
> conversion and let developers use those when 16 variants of various
> functions are missing.
>
> (Yes, there should be libraries in your OS for UTF-8<->UTF-16
> conversion, but SQLite3 already has its own.  Exporting them should not
> hurt.)
>
> But wchar_t <-> UTF-8 and wchar_t <-> UTF-16 conversions should
> definitely be out of scope for SQLite3.  (wchar_t is very OS- and
> locale-specific.  Expecting SQLite3 to know about wchar_t seems to me
> like asking for bloat.)
>

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