[sqlite] select null values in python

2012-03-22 Thread Fabio Spadaro
Using sqlite3 python and I have a problem running a query.
My table has null values​​. Now if I do a 'select * from tablename' returns
to me as the result:
[(datetime.date (2012, 3, 22), buffer ptr read-write 0x03774B90,
0x03774B58 at size 0, None, None, None, None, None, None)]
As you can see there are null values ​​that in python are None type.
If I want to run a query like select * from tablename where field1 = Null
returns no results and even if I run select * from tablename where field1
= None None because there is not in Sqlite. You should use an adapter or
something?

-- 
Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:
www.sqliteroot.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] GUI for SQLite

2012-03-08 Thread Fabio Spadaro
Il giorno 08 marzo 2012 14:13, gregorinator gregorina...@gmail.com ha
scritto:

 I've been happy with SQLite Studio:

 http://sqlitestudio.one.pl/

 One of the things I like about it is that it can do table edits not
 supported by SQLite's ALTER TABLE -- it automatically creates a new
 table and copies the existing data.  Saves me a lot of effort.  Other
 SQLite managers may be able to do this, too -- I don't know -- but
 after using SQLite Studio I would consider this a must-have feature.


You might try Sqlite Root http://www.sqliteroot.com that can change the
tables by inserting / deleting / modifying fields in any position with the
possibility of keeping the data (via form keep data yes or no)
-- 
Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:
www.sqliteroot.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] What do people think of SQLite Root?

2012-03-06 Thread Fabio Spadaro
Hi.

Il giorno 05 marzo 2012 20:50, Dimiter 'malkia' Stanev
mal...@gmail.comha scritto:



 Unfortunately I've got an error when opening our db (SQLite Root 1.9.7.4):

Traceback Info:
 Traceback (most recent call last):
  File core.pyo, line 2731, in OnOpenDialogXOpenDb
 KeyError: u'converter'

System Information:
 Timestamp: 2012-03-05 11:47:17.465000
 Operating System: Windows NT 6.1 (build 7601, Service Pack 1)
 Python Version: 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit
 (Intel)]
 wxPython Version: 2.8.12.1 (msw-unicode)
 wxPython Info: (__WXMSW__, wxMSW, unicode, wx-assertions-on, SWIG-1.3.29)
 Python Encoding: Default=ascii  File=mbcs
 wxPython Encoding: cp1252
 System Architecture: 32bit AMD64
 Byte order: little
 Frozen: windows_exe

 I'm getting file is encrypted or is not a database. But the database was
 created using amalgated SQLite (3.7.9), compiled with VS2010:

 // This was put on top of our sqlite3.c
 #define SQLITE_DEFAULT_PAGE_SIZE 65536
 #define SQLITE_MAX_DEFAULT_PAGE_SIZE 65536
 #define SQLITE_THREADSAFE 0
 #define SQLITE_DEFAULT_MEMSTATUS 0
 #define SQLITE_OMIT_SHARED_CACHE 1
 #define SQLITE_OMIT_DEPRECATED 1
 #define SQLITE_OMIT_UTF16 1

 --**--

 We have one more DB that is similar to the one above, but with lots of
 TRIGGERS (thousands), and tables with thousand of columns.

 That DB uses the .NET SQLIte (not sure which version).

 It crashes SQLIte Root right away.


 On 3/5/2012 5:50 AM, Rob Richardson wrote:

 Our company typically uses SQLite Spy for managing SQLite databases.  I
 keep hoping to find something better, because SQLite Spy does not offer the
 ability to edit a table inside a grid.  The only way to update data is to
 use an SQL UPDATE statement.  But nothing else offers the speed of
 displaying data for a decent-sized table.  The table we most often have to
 show contains three columns, and data taken once a minute and saved for
 thirty days.

 I've seen a couple of announcements recently about SQLite Root, and it
 looks like it may be worth trying next time I get a little time.  But in
 the meantime, I'm wondering what others think.  Is it a good product?

 RobR

 -Original Message-
 From: 
 sqlite-users-bounces-**CzDROfG0BjIdnm+yROfE0A@public.**gmane.orgsqlite-users-bounces-czdrofg0bjidnm%2byrof...@public.gmane.org[mailto:
 sqlite-users-bounces-**CzDROfG0BjIdnm+yROfE0A@public.**gmane.orgsqlite-users-bounces-czdrofg0bjidnm%2byrof...@public.gmane.org]
 On Behalf Of Fabio Spadaro
 Sent: Monday, March 05, 2012 3:51 AM
 To: General Discussion of SQLite Database
 Subject: [sqlite] Sqlite Root also available for Linux

 Announcement of the release Sqlite 
 Roothttp://www.sqliteroot.**com/http://www.sqliteroot.com/
   now available for Linux.
 Any feedback is appreciated.

 --
 Fabio Spadaro


 __**_
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**usershttp://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Download the latest version Sqlite Root 1.9.7.6 http://www.sqliteroot.com

-- 
Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:
www.sqliteroot.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] What do people think of SQLite Root?

2012-03-06 Thread Fabio Spadaro
Hi.

Il giorno 06 marzo 2012 17:31, Kit kit.sa...@gmail.com ha scritto:

  Announcement of the release Sqlite Root http://www.sqliteroot.com/
  now available for Linux.
  Any feedback is appreciated.
  Fabio Spadaro

 Two big problems:
 - license
 - size

 This software is unusable for me.
 --
 Kit
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


What do you mean by size.

-- 
Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:
www.sqliteroot.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Sqlite Root also available for Linux

2012-03-05 Thread Fabio Spadaro
Announcement of the release Sqlite Root http://www.sqliteroot.com/  now
available for Linux.
Any feedback is appreciated.

-- 
Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:
www.sqliteroot.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] What do people think of SQLite Root?

2012-03-05 Thread Fabio Spadaro
Hi.
Il giorno 05 marzo 2012 14:50, Rob Richardson rdrichard...@rad-con.com ha
scritto:

 ... I keep hoping to find something better, because SQLite Spy does not
 offer the ability to edit a table inside a grid ...
 RobR


With sqlite root is possbile to edit the table inside a grid and foreign
keys.
-- 
Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:
www.sqliteroot.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] ANNOUNCE: Sqlite Root 1.9.7.5 freeware for MS Windows

2012-02-28 Thread Fabio Spadaro
I am pleased to announce the new version Sqlite Root 1.9.7.5 at
www.sqliteroot.com:http://www.google.com/url?sa=Dq=www.sqliteroot.com:usg=AFQjCNHJoB0eqGz7Zg_WX0Ho-MkJLG_bZA


What is Sqlite Root?
=
Sqlite Root is a Gui Admin Tool for manage Sqlite Database

Features:
=
1. Panel that shows in detail the structure of database tables.

2.  Separate panel to indicate the indexes, views, triggers, sql  editor

3.  Backup table

4.  Changing table with insert / edit / delete fields in certain positions
and maintaining the data if possible

5.  Loading two perspectives and can customize the size of the panels

6.  Possibility to minimize the panels

7.  SQL Editors:
a. tips for each character typed
b. Ability to increase the font size

8.  Database design structured like a spreadsheet

9.  Displaying BLOB using external application

10. Form for create trigger,index,view

Mailing list here https://groups.google.com/group/sqliteroot?hl=en

Any feedbak is welcome!

Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:
www.sqliteroot.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Is there any API for counting number of rows in a particular table.

2012-02-05 Thread Fabio Spadaro
2012/1/31 John Elrick john.elr...@fenestra.com

 On Tue, Jan 31, 2012 at 6:01 AM, Fabio Spadaro fabiolinos...@gmail.com
 wrote:

  Hi
 
  2012/1/30 Bart Smissaert bart.smissa...@gmail.com
 
   How do you make it open database files that have an extension other
 than
   .slt?
  
   RBS
 
 
  Tonight I will see to create a new version with bug fixes.
  Meanwhile you could give me some feedback such as opening a file with any
  extension by entering *.* in the filename of the FileDialog.
 

 Common extensions I've seen used for SQLite:

 .sqlite
 .db
 .db3


I am pleased to announce the new version Sqlite Root 1.9.7.4 at
www.sqliteroot.com that opens the database with the extension:
sqlite
db
db3

Any feedbak is welcome!

Best regards,

Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:
www.sqliteroot.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Is there any API for counting number of rows in a particular table.

2012-01-31 Thread Fabio Spadaro
Hi

2012/1/30 Bart Smissaert bart.smissa...@gmail.com

 How do you make it open database files that have an extension other than
 .slt?

 RBS


Tonight I will see to create a new version with bug fixes.
Meanwhile you could give me some feedback such as opening a file with any
extension by entering *.* in the filename of the FileDialog.
Thanks.

-- 
Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:
www.sqliteroot.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Is there any API for counting number of rows in a particular table.

2012-01-30 Thread Fabio Spadaro
Hi

2012/1/30 bhaskarReddy uni...@gmail.com


 Its working with only table name.


 Regards,
 Bhaskar.


You could use a GUI to facilitate these requests, and your
this regard we propose to test my application
it is freeware: www.sqliteroot.com  http://www.sqliteroot.com

-- 
Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:
www.sqliteroot.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] ANNOUNCE: Sqlite Root Gui Admin Tool for manage Sqlite Database

2012-01-23 Thread Fabio Spadaro
Announcing--


 Sqlite Root version 1.9.73 has been released and is now available for

 download at http://www.sqliteroot.com http://wxpython.org/download.php.

For any request please contact sqliter...@gmail.com

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


Re: [sqlite] sqlite3 python foreign key

2011-09-15 Thread Fabio Spadaro
Hi,
 So you get no error from the INSERT command, and you can also find the new
row using  SELECT ?
No error for select

 Make a connection to the database.
 ssue PRAGMA foreign_keys and look at the value returned.
 Issue PRAGMA foreign_keys = OFF.
 Issue PRAGMA foreign_keys and look at the value returned.
 Issue PRAGMA foreign_keys = ON.
 Issue PRAGMA foreign_keys and look at the value returned.
all [ ]
-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3 python foreign key

2011-09-15 Thread Fabio Spadaro
Hi

2011/9/15 Simon Slavin slav...@bigfraud.org


 On 15 Sep 2011, at 9:12am, Fabio Spadaro wrote:

  So you get no error from the INSERT command, and you can also find the
 new
  row using  SELECT ?
  No error for select

 If the SELECT command does not show the row then the INSERT did not work.

  Make a connection to the database.
  ssue PRAGMA foreign_keys and look at the value returned.
  Issue PRAGMA foreign_keys = OFF.
  Issue PRAGMA foreign_keys and look at the value returned.
  Issue PRAGMA foreign_keys = ON.
  Issue PRAGMA foreign_keys and look at the value returned.
  all [ ]

 If you get blank responses from all of those then the version of SQLite
 you're using does not support foreign keys.  But you reported your version
 number in your earlier post and that version of SQLite should support
 foreign keys.  I don't not understand this.

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


i just installed python 2.7.2 and the value returned by PRAGMA
foreign_keys is [(0,)]; Later I will try with the tables.

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3 python foreign key

2011-09-15 Thread Fabio Spadaro
Hi.

2011/9/15 Simon Slavin slav...@bigfraud.org


 On 15 Sep 2011, at 4:36pm, Fabio Spadaro wrote:

  i just installed python 2.7.2 and the value returned by PRAGMA
  foreign_keys is [(0,)]; Later I will try with the tables.

 Can you tell whether your python installation process is installing a new
 version of whatever sqlite API you're using ?  Depending on how it's
 packaged it might be part of it or it might be separate.

 Please do this entire sequence:

 Make a connection to the database.
 Issue PRAGMA foreign_keys and look at the table returned.
 Issue PRAGMA foreign_keys = OFF.
 Issue PRAGMA foreign_keys and look at the table returned.
 Issue PRAGMA foreign_keys = ON.
 Issue PRAGMA foreign_keys and look at the table returned.

 We can tell a lot by looking at the results, including whether your version
 was compiled without foreign key support.

 Note that foreign key support is always initially off.  Currently you are
 expected to do PRAGMA foreign_keys = ON each time you open a database even
 if you have previously used foreign keys with it.

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


Sorry but I was wrong from the beginning; the result of pragma ... was
wrong with python version 2.6 because each result were not processed
in the same
connection but different connections of database.

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3 python foreign key

2011-09-14 Thread Fabio Spadaro
Hello. I use sqlite3 python.
I followed exactly the steps to create a foreign key from the site
http://www.sqlite.org/foreignkeys.html but I still can insert enter values
 not ​​allowed for constraint.
Before I do the insert properly executed the instruction PRAGMA
FOREIGN_KEYS =ON but did not return any data, the site shows that if the
result is not 0 or 1
then either the version of sqlite is more old of 3.6..19 (MAKES IT IS MY
VERSION 3.6.22) or it has been compiled with SQLITE_OMIT_FOREIGN_KEY
SQLITE_OMIT_TRIGGER ago.
Someone can give me light?
My version of python is:
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] alter table add column

2011-05-31 Thread Fabio Spadaro
Alter table add column command drop data from table.
Can you keep the data or should I store the data before the alter and then put
them in the table?

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] alter table add column

2011-05-31 Thread Fabio Spadaro
Hi

2011/5/31 Stephan Beal sgb...@googlemail.com

 On Tue, May 31, 2011 at 5:11 PM, Fabio Spadaro fabiolinos...@gmail.com
 wrote:

  Alter table add column command drop data from table.
  Can you keep the data or should I store the data before the alter and
 then
  put
  them in the table?
 

 http://www.sqlite.org/lang_altertable.html

 says:

 The execution time of the ALTER TABLE command is independent of the amount
 of data in the table. The ALTER TABLE command runs as quickly on a table
 with 10 million rows as it does on a table with 1 row.

 Implicit in that statement is that ALTER TABLE does not modify/delete any
 table data. If it did, the runtime would probably be O(N) or worse, not
 O(1)
 (as described above).

 --
 - stephan beal
 http://wanderinghorse.net/home/stephan/
  ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



Ok I have been deceived by the anomaly that I found in my application. In
practice I have renamed the table (with alter table), I inserted a row and
then I inserted a new column (with alter table add column) and to my
surprise I saw the empty table. The problem is that my insert is not
successful and what you do not understand why try to make the insert taking the
old name of the table.

To recap:
Step 1: alter table pippo rename to fabio - ok
step 2: insert into fabio (field1) values ​​('1 ') - ko
 OperationalError: no such table main.pippo
Step 3: alter table add column fabio field2 integer null - ok
result:
  empty table
Question: Why does my insert referring to the old table?

use python sqlite vers. 2.5.9


-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] date field with default current date

2011-05-23 Thread Fabio Spadaro
Hi

2011/4/22 Pavel Ivanov paiva...@gmail.com

  In my system is set up with 11:35:07 while I am in the data 9:37:30
  Why?

 http://www.sqlite.org/lang_createtable.html
 If the default value of a column is CURRENT_TIME, CURRENT_DATE or
 CURRENT_TIMESTAMP, then the value used in the new row is a text
 representation of the current UTC date and/or time.

 It won't be your local time.


 Pavel


 On Fri, Apr 22, 2011 at 5:46 AM, Fabio Spadaro fabiolinos...@gmail.com
 wrote:
  Hi.
 
  2011/4/22 Fabio Spadaro fabiolinos...@gmail.com
 
  Hi
 
 
  2011/4/22 Fabio Spadaro fabiolinos...@gmail.com
 
  Hi.
 
 
  2011/4/22 Pavel Ivanov paiva...@gmail.com
 
   What does SELECT sqlite_version() gives you in python with
 sqlite3
   module?
   [(u'3.5.9',)]
 
  Well, CURRENT_DATE should work then, it was added in 3.1.0. Could you
  show us an exact statement you are trying to execute and the exact
  text of error you get?
 
 
  Pavel
 
 
  On Thu, Apr 21, 2011 at 1:43 PM, Fabio Spadaro 
 fabiolinos...@gmail.com
  wrote:
   Hi.
  
   2011/4/21 Pavel Ivanov paiva...@gmail.com
  
Does not work on python with sqlite3 module
  
   What does SELECT sqlite_version() gives you in python with
 sqlite3
   module?
  
  
   Pavel
  
  
   On Thu, Apr 21, 2011 at 9:17 AM, Fabio Spadaro 
  fabiolinos...@gmail.com
   wrote:
Hi.
   
2011/4/21 Black, Michael (IS) michael.bla...@ngc.com
   
create table t (d default CURRENT_DATE,i number);
insert into t (i) values(1);
select * from t;
2011-04-21|1
   
   
   
Use CURRENT_TIME if you want hours/minutes too.
   
   
   
Michael D. Black
   
Senior Scientist
   
NG Information Systems
   
Advanced Analytics Directorate
   
   
   

From: sqlite-users-boun...@sqlite.org [
  sqlite-users-boun...@sqlite.org]
   on
behalf of Fabio Spadaro [fabiolinos...@gmail.com]
Sent: Thursday, April 21, 2011 5:37 AM
To: General Discussion of SQLite Database
Subject: EXT :[sqlite] date field with default current date
   
Hi.
I'm working with python and sqlite3 and i ask how to create a
 table
  with
   a
date
field wih defaults current date.
Thanks.
--
Fabio Spadaro
www.fabiospadaro.comhttp://www.fabiospadaro.com/
___
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
   
   
Does not work on python with sqlite3 module
   
--
Fabio Spadaro
www.fabiospadaro.com
___
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
  
  
   [(u'3.5.9',)]
  
  
   --
   Fabio Spadaro
   www.fabiospadaro.com
   ___
   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
 
 
  from sqlite3 import *
...
a = gestdb.cur.execute('''create table tipo (d date default
  CURRENT_DATE''')
  
  warning near CURRENT_DATE: syntax error
  --
  Fabio Spadaro
  www.fabiospadaro.com
 
 
  Sorry.
  I messed up the placement of quote.
  Work.
 
  --
  Fabio Spadaro
  www.fabiospadaro.com
 
 
 
  I just set a table with create table timest (test text, d timestamp
  default CURRENT_TIMESTAMP) 
  After i just make insert: insert into timest (test) values ('2') 
  I see these values: '(u'2', datetime.datetime (2011,4, 22, 9, 37, 30)
 '
  but the clock set up in my MS windows OS is set to different time.
  In my system is set up with 11:35:07 while I am in the data 9:37:30
  Why?
  Thanks.
  --
  Fabio Spadaro
  www.fabiospadaro.com
  ___
  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



  I resolved with:
CREATE TRIGGER insert_nameTable after insert on name_tabl  begin
update  set ww = datetime('now','localtime')
where rowid = new.rowid; end
What is the difference between sqlite3.version (typed on command
line) and SELECT
sqlite_version() because one gives a value like 2.4.1 and the other gives
as the value 3.5.9 ?
-- 
Fabio Spadaro

Re: [sqlite] date field with default current date

2011-04-22 Thread Fabio Spadaro
Hi.

2011/4/22 Pavel Ivanov paiva...@gmail.com

  What does SELECT sqlite_version() gives you in python with sqlite3
  module?
  [(u'3.5.9',)]

 Well, CURRENT_DATE should work then, it was added in 3.1.0. Could you
 show us an exact statement you are trying to execute and the exact
 text of error you get?


 Pavel


 On Thu, Apr 21, 2011 at 1:43 PM, Fabio Spadaro fabiolinos...@gmail.com
 wrote:
  Hi.
 
  2011/4/21 Pavel Ivanov paiva...@gmail.com
 
   Does not work on python with sqlite3 module
 
  What does SELECT sqlite_version() gives you in python with sqlite3
  module?
 
 
  Pavel
 
 
  On Thu, Apr 21, 2011 at 9:17 AM, Fabio Spadaro fabiolinos...@gmail.com
 
  wrote:
   Hi.
  
   2011/4/21 Black, Michael (IS) michael.bla...@ngc.com
  
   create table t (d default CURRENT_DATE,i number);
   insert into t (i) values(1);
   select * from t;
   2011-04-21|1
  
  
  
   Use CURRENT_TIME if you want hours/minutes too.
  
  
  
   Michael D. Black
  
   Senior Scientist
  
   NG Information Systems
  
   Advanced Analytics Directorate
  
  
  
   
   From: sqlite-users-boun...@sqlite.org [
 sqlite-users-boun...@sqlite.org]
  on
   behalf of Fabio Spadaro [fabiolinos...@gmail.com]
   Sent: Thursday, April 21, 2011 5:37 AM
   To: General Discussion of SQLite Database
   Subject: EXT :[sqlite] date field with default current date
  
   Hi.
   I'm working with python and sqlite3 and i ask how to create a table
 with
  a
   date
   field wih defaults current date.
   Thanks.
   --
   Fabio Spadaro
   www.fabiospadaro.comhttp://www.fabiospadaro.com/
   ___
   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
  
  
   Does not work on python with sqlite3 module
  
   --
   Fabio Spadaro
   www.fabiospadaro.com
   ___
   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
 
 
  [(u'3.5.9',)]
 
 
  --
  Fabio Spadaro
  www.fabiospadaro.com
  ___
  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


from sqlite3 import *
  ...
  a = gestdb.cur.execute('''create table tipo (d date default
CURRENT_DATE''')

warning near CURRENT_DATE: syntax error
-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] date field with default current date

2011-04-22 Thread Fabio Spadaro
Hi

2011/4/22 Fabio Spadaro fabiolinos...@gmail.com

 Hi.


 2011/4/22 Pavel Ivanov paiva...@gmail.com

  What does SELECT sqlite_version() gives you in python with sqlite3
  module?
  [(u'3.5.9',)]

 Well, CURRENT_DATE should work then, it was added in 3.1.0. Could you
 show us an exact statement you are trying to execute and the exact
 text of error you get?


 Pavel


 On Thu, Apr 21, 2011 at 1:43 PM, Fabio Spadaro fabiolinos...@gmail.com
 wrote:
  Hi.
 
  2011/4/21 Pavel Ivanov paiva...@gmail.com
 
   Does not work on python with sqlite3 module
 
  What does SELECT sqlite_version() gives you in python with sqlite3
  module?
 
 
  Pavel
 
 
  On Thu, Apr 21, 2011 at 9:17 AM, Fabio Spadaro 
 fabiolinos...@gmail.com
  wrote:
   Hi.
  
   2011/4/21 Black, Michael (IS) michael.bla...@ngc.com
  
   create table t (d default CURRENT_DATE,i number);
   insert into t (i) values(1);
   select * from t;
   2011-04-21|1
  
  
  
   Use CURRENT_TIME if you want hours/minutes too.
  
  
  
   Michael D. Black
  
   Senior Scientist
  
   NG Information Systems
  
   Advanced Analytics Directorate
  
  
  
   
   From: sqlite-users-boun...@sqlite.org [
 sqlite-users-boun...@sqlite.org]
  on
   behalf of Fabio Spadaro [fabiolinos...@gmail.com]
   Sent: Thursday, April 21, 2011 5:37 AM
   To: General Discussion of SQLite Database
   Subject: EXT :[sqlite] date field with default current date
  
   Hi.
   I'm working with python and sqlite3 and i ask how to create a table
 with
  a
   date
   field wih defaults current date.
   Thanks.
   --
   Fabio Spadaro
   www.fabiospadaro.comhttp://www.fabiospadaro.com/
   ___
   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
  
  
   Does not work on python with sqlite3 module
  
   --
   Fabio Spadaro
   www.fabiospadaro.com
   ___
   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
 
 
  [(u'3.5.9',)]
 
 
  --
  Fabio Spadaro
  www.fabiospadaro.com
  ___
  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


 from sqlite3 import *
   ...
   a = gestdb.cur.execute('''create table tipo (d date default
 CURRENT_DATE''')
 
 warning near CURRENT_DATE: syntax error
 --
 Fabio Spadaro
 www.fabiospadaro.com


Sorry.
I messed up the placement of quote.
Work.

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] date field with default current date

2011-04-22 Thread Fabio Spadaro
Hi.

2011/4/22 Fabio Spadaro fabiolinos...@gmail.com

 Hi


 2011/4/22 Fabio Spadaro fabiolinos...@gmail.com

 Hi.


 2011/4/22 Pavel Ivanov paiva...@gmail.com

  What does SELECT sqlite_version() gives you in python with sqlite3
  module?
  [(u'3.5.9',)]

 Well, CURRENT_DATE should work then, it was added in 3.1.0. Could you
 show us an exact statement you are trying to execute and the exact
 text of error you get?


 Pavel


 On Thu, Apr 21, 2011 at 1:43 PM, Fabio Spadaro fabiolinos...@gmail.com
 wrote:
  Hi.
 
  2011/4/21 Pavel Ivanov paiva...@gmail.com
 
   Does not work on python with sqlite3 module
 
  What does SELECT sqlite_version() gives you in python with sqlite3
  module?
 
 
  Pavel
 
 
  On Thu, Apr 21, 2011 at 9:17 AM, Fabio Spadaro 
 fabiolinos...@gmail.com
  wrote:
   Hi.
  
   2011/4/21 Black, Michael (IS) michael.bla...@ngc.com
  
   create table t (d default CURRENT_DATE,i number);
   insert into t (i) values(1);
   select * from t;
   2011-04-21|1
  
  
  
   Use CURRENT_TIME if you want hours/minutes too.
  
  
  
   Michael D. Black
  
   Senior Scientist
  
   NG Information Systems
  
   Advanced Analytics Directorate
  
  
  
   
   From: sqlite-users-boun...@sqlite.org [
 sqlite-users-boun...@sqlite.org]
  on
   behalf of Fabio Spadaro [fabiolinos...@gmail.com]
   Sent: Thursday, April 21, 2011 5:37 AM
   To: General Discussion of SQLite Database
   Subject: EXT :[sqlite] date field with default current date
  
   Hi.
   I'm working with python and sqlite3 and i ask how to create a table
 with
  a
   date
   field wih defaults current date.
   Thanks.
   --
   Fabio Spadaro
   www.fabiospadaro.comhttp://www.fabiospadaro.com/
   ___
   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
  
  
   Does not work on python with sqlite3 module
  
   --
   Fabio Spadaro
   www.fabiospadaro.com
   ___
   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
 
 
  [(u'3.5.9',)]
 
 
  --
  Fabio Spadaro
  www.fabiospadaro.com
  ___
  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


 from sqlite3 import *
   ...
   a = gestdb.cur.execute('''create table tipo (d date default
 CURRENT_DATE''')
 
 warning near CURRENT_DATE: syntax error
 --
 Fabio Spadaro
 www.fabiospadaro.com


 Sorry.
 I messed up the placement of quote.
 Work.

 --
 Fabio Spadaro
 www.fabiospadaro.com



I just set a table with create table timest (test text, d timestamp
default CURRENT_TIMESTAMP) 
After i just make insert: insert into timest (test) values ​​('2') 
I see these values: '(u'2', datetime.datetime (2011,4, 22, 9, 37, 30) '
but the clock set up in my MS windows OS is set to different time.
In my system is set up with 11:35:07 while I am in the data 9:37:30
Why?
Thanks.
-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] date field with default current date

2011-04-21 Thread Fabio Spadaro
Hi.
I'm working with python and sqlite3 and i ask how to create a table with a date
field wih defaults current date.
Thanks.
-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] date field with default current date

2011-04-21 Thread Fabio Spadaro
Hi.

2011/4/21 Black, Michael (IS) michael.bla...@ngc.com

 create table t (d default CURRENT_DATE,i number);
 insert into t (i) values(1);
 select * from t;
 2011-04-21|1



 Use CURRENT_TIME if you want hours/minutes too.



 Michael D. Black

 Senior Scientist

 NG Information Systems

 Advanced Analytics Directorate



 
 From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on
 behalf of Fabio Spadaro [fabiolinos...@gmail.com]
 Sent: Thursday, April 21, 2011 5:37 AM
 To: General Discussion of SQLite Database
 Subject: EXT :[sqlite] date field with default current date

 Hi.
 I'm working with python and sqlite3 and i ask how to create a table with a
 date
 field wih defaults current date.
 Thanks.
 --
 Fabio Spadaro
 www.fabiospadaro.comhttp://www.fabiospadaro.com/
 ___
 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


Does not work on python with sqlite3 module

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] date field with default current date

2011-04-21 Thread Fabio Spadaro
2011/4/21 Mihai Militaru mihai.milit...@xmpp.ro

 On Thu, 21 Apr 2011 15:17:00 +0200
 Fabio Spadaro fabiolinos...@gmail.com wrote:

  Does not work on python with sqlite3 module

 Try using the date and time functions, 'date' or 'datetime' in your case:
 INSERT INTO table(..., date) VALUES(..., datetime('now'));

 http://www.sqlite.org/lang_datefunc.html

 --
 Mihai Militaru mihai.milit...@xmpp.ro
  ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



Is 'create table ...' does not work ! :)

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] date field with default current date

2011-04-21 Thread Fabio Spadaro
Hi.

2011/4/21 Pavel Ivanov paiva...@gmail.com

  Does not work on python with sqlite3 module

 What does SELECT sqlite_version() gives you in python with sqlite3
 module?


 Pavel


 On Thu, Apr 21, 2011 at 9:17 AM, Fabio Spadaro fabiolinos...@gmail.com
 wrote:
  Hi.
 
  2011/4/21 Black, Michael (IS) michael.bla...@ngc.com
 
  create table t (d default CURRENT_DATE,i number);
  insert into t (i) values(1);
  select * from t;
  2011-04-21|1
 
 
 
  Use CURRENT_TIME if you want hours/minutes too.
 
 
 
  Michael D. Black
 
  Senior Scientist
 
  NG Information Systems
 
  Advanced Analytics Directorate
 
 
 
  
  From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org]
 on
  behalf of Fabio Spadaro [fabiolinos...@gmail.com]
  Sent: Thursday, April 21, 2011 5:37 AM
  To: General Discussion of SQLite Database
  Subject: EXT :[sqlite] date field with default current date
 
  Hi.
  I'm working with python and sqlite3 and i ask how to create a table with
 a
  date
  field wih defaults current date.
  Thanks.
  --
  Fabio Spadaro
  www.fabiospadaro.comhttp://www.fabiospadaro.com/
  ___
  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
 
 
  Does not work on python with sqlite3 module
 
  --
  Fabio Spadaro
  www.fabiospadaro.com
  ___
  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


[(u'3.5.9',)]


-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3 backup

2010-12-17 Thread Fabio Spadaro
Hi all.
I use Python's sqlite3.
it is possible to backup a database without
use the copy command file?

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] issue on blob

2010-09-09 Thread Fabio Spadaro
Hi all.
Can you determine  in the blob's data
what is buffered file type and what was its original length?
Obviously the solution to store the blob on a files would be too easy and I
do not like it.
Workaround?

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] issue on blob

2010-09-09 Thread Fabio Spadaro
HI,

2010/9/9 Igor Tandetnik itandet...@mvps.org

 Fabio Spadaro fabiolinos...@gmail.com wrote:
  Can you determine  in the blob's data
  what is buffered file type and what was its original length?

 You retrieve the size of the BLOB field with sqlite3_column_bytes function,
 or with length() function in SQL.

 I'm not familiar with the term buffered file type. SQLite certainly
 doesn't store any such thing in the BLOB column. If you need to track some
 kind of metadata about your BLOB, store it yourself in additional columns in
 the same row.
 --
 Igor Tandetnik

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


I use DB-API 2.0 interface for SQLite databases for python  and seems that
there is not a function
equivalent or wrong?

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] is there any way for create a sqlite blob field with python?

2010-06-16 Thread Fabio Spadaro
 Hi

2010/6/15 Roger Binns rog...@rogerbinns.com

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On 06/15/2010 01:46 PM, Fabio Spadaro wrote:
  I am developing an interface to Python 's SQLite and would it be
  you can store files in the sqlite database. To do this
  obviously need to create a blob field but how to store image files?

 If you are using Python 2 then use the buffer type.  If using Python 3 then
 use bytes.

 Py2:

  cursor.execute(insert into foo(image) values(?),
   (buffer(open(.../foo.jpg, rb).read()), ))

 Py3:

  cursor.execute(insert into foo(image) values(?),
   (open(.../foo.jpg, rb).read(), ))


 If you use APSW then you can also use the incremental blob API:

  http://apsw.googlecode.com/svn/publish/blob.html

 Roger

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAkwX7yAACgkQmOOfHg372QSIkQCfej/1Zw7htLxZtVFGsIsxb91m
 YnkAniPp7aScNJITD3xYOmH4MC9e4Asx
 =M6pK
 -END PGP SIGNATURE-
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


I created the table:
  CREATE TABLE blobber(file BLOB)
I inserted 2 records:
 1. gestdb.cur.execute(insert into blobber(file) values(?),
  (buffer(open('..\conf\img\file1.gif','rb').read()), ))
 2. gestdb.cur.execute(insert into blobber(file) values(?),
  (buffer(open('..\conf\img\file2.gif','rb').read()), ))
But the next time I select a single line instead of two:
 fetchall [(read-write buffer ptr 0x02CC2A68, size 1311 at
0x02CC2A30,)]

What's wrong.
-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] is there any way for create a sqlite blob field with python?

2010-06-16 Thread Fabio Spadaro
Hi,

2010/6/16 Fabio Spadaro fabiolinos...@gmail.com

  Hi

 2010/6/15 Roger Binns rog...@rogerbinns.com

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On 06/15/2010 01:46 PM, Fabio Spadaro wrote:
  I am developing an interface to Python 's SQLite and would it be
  you can store files in the sqlite database. To do this
  obviously need to create a blob field but how to store image files?

 If you are using Python 2 then use the buffer type.  If using Python 3
 then
 use bytes.

 Py2:

  cursor.execute(insert into foo(image) values(?),
   (buffer(open(.../foo.jpg, rb).read()), ))

 Py3:

  cursor.execute(insert into foo(image) values(?),
   (open(.../foo.jpg, rb).read(), ))


 If you use APSW then you can also use the incremental blob API:

  http://apsw.googlecode.com/svn/publish/blob.html

 Roger

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAkwX7yAACgkQmOOfHg372QSIkQCfej/1Zw7htLxZtVFGsIsxb91m
 YnkAniPp7aScNJITD3xYOmH4MC9e4Asx
 =M6pK
 -END PGP SIGNATURE-
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


 I created the table:
   CREATE TABLE blobber(file BLOB)
 I inserted 2 records:
  1. gestdb.cur.execute(insert into blobber(file) values(?),
   (buffer(open('..\conf\img\file1.gif','rb').read()), ))
  2. gestdb.cur.execute(insert into blobber(file) values(?),
   (buffer(open('..\conf\img\file2.gif','rb').read()), ))
 But the next time I select a single line instead of two:
  fetchall [(read-write buffer ptr 0x02CC2A68, size 1311 at
 0x02CC2A30,)]

 What's wrong.

 --
 Fabio Spadaro
 www.fabiospadaro.com


Sorry, I did not commit.

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] is there any way for create a sqlite blob field with python?

2010-06-16 Thread Fabio Spadaro
Hi,

2010/6/15 Roger Binns rog...@rogerbinns.com

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On 06/15/2010 01:46 PM, Fabio Spadaro wrote:
  I am developing an interface to Python 's SQLite and would it be
  you can store files in the sqlite database. To do this
  obviously need to create a blob field but how to store image files?

 If you are using Python 2 then use the buffer type.  If using Python 3 then
 use bytes.

 Py2:

  cursor.execute(insert into foo(image) values(?),
   (buffer(open(.../foo.jpg, rb).read()), ))

 Py3:

  cursor.execute(insert into foo(image) values(?),
   (open(.../foo.jpg, rb).read(), ))


 If you use APSW then you can also use the incremental blob API:

  http://apsw.googlecode.com/svn/publish/blob.html

 Roger

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAkwX7yAACgkQmOOfHg372QSIkQCfej/1Zw7htLxZtVFGsIsxb91m
 YnkAniPp7aScNJITD3xYOmH4MC9e4Asx
 =M6pK
 -END PGP SIGNATURE-
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Another question. If I wanted to convert the buffer to a file how should I
do?

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] is there any way for create a sqlite blob field with python?

2010-06-16 Thread Fabio Spadaro
Hi,

2010/6/16 Roger Binns rog...@rogerbinns.com

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On 06/16/2010 04:14 AM, Fabio Spadaro wrote:
  But the next time I select a single line instead of two:
   fetchall [(read-write buffer ptr 0x02CC2A68, size 1311 at
  0x02CC2A30,)]
 
  What's wrong.

 Errr, nothing.  Blobs are returned as buffers too.  (This way you can
 distinguish them from str.)  Buffers act just like str.  You can get an
 individual byte - buf[7] - or a range - buf[7:93] etc.  You can convert
 them
 to str - str(buf).

  Another question. If I wanted to convert the buffer to a file how should
 I
  do?

 Just use it as is:

  open(filename, wb).write(buf)

 Roger

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAkwZAVoACgkQmOOfHg372QTj4ACgwuDNdpMcFQEP901Sein+98Qy
 UaQAn1BwlSP1cN1xriY95XWekyg9sdjs
 =KSFO
 -END PGP SIGNATURE-
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


You can also determine the path and file name from the blob or should I
create a column attached with this information stored?

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] is there any way for create a sqlite blob field with python?

2010-06-15 Thread Fabio Spadaro
Hi all.
I am developing an interface to Python 's SQLite and would it be
you can store files in the sqlite database. To do this
obviously need to create a blob field but how to store image files?

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] data type from join multiple tables

2010-05-14 Thread Fabio Spadaro
I need to identify data types extracted from a
join between multiple tables without using cross-checking table_info more
pragmatic.

Is there a faster way to do it?

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] data type from join multiple tables

2010-05-14 Thread Fabio Spadaro
hi,

2010/5/14 P Kishor punk.k...@gmail.com

 On Fri, May 14, 2010 at 9:01 AM, Fabio Spadaro fabiolinos...@gmail.com
 wrote:
  I need to identify data types extracted from a
  join between multiple tables without using cross-checking table_info more
  pragmatic.
 

 Could you clarify what you really want to do? Your question is not
 clear at all, at least to me. What do you mean by using
 cross-checking table_info more pragmatic? More pragmatic than what?

  Is there a faster way to do it?
 

 Faster than what?

 If you want data_types, you can use SELECT Typeof(column_name)




 



 --
 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


I use python sqlite embedded and in my application I have a panel where you
can
type a query and see the results in a panel's grid
Now suppose that I type a query like select
a.field1, b.field2 from table1 a, table2 b  such data
will be displayed in grid but I need to know what types of data I obtained.
How do it?

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] data type from join multiple tables

2010-05-14 Thread Fabio Spadaro
Hi,

2010/5/14 P Kishor punk.k...@gmail.com

 On Fri, May 14, 2010 at 9:49 AM, Fabio Spadaro fabiolinos...@gmail.com
 wrote:
  hi,
 
  2010/5/14 P Kishor punk.k...@gmail.com
 
  On Fri, May 14, 2010 at 9:01 AM, Fabio Spadaro fabiolinos...@gmail.com
 
  wrote:
   I need to identify data types extracted from a
   join between multiple tables without using cross-checking table_info
 more
   pragmatic.
  
 
  Could you clarify what you really want to do? Your question is not
  clear at all, at least to me. What do you mean by using
  cross-checking table_info more pragmatic? More pragmatic than what?
 
   Is there a faster way to do it?
  
 
  Faster than what?
 
  If you want data_types, you can use SELECT Typeof(column_name)
 
 
 
 
  
 
 
 
  --
  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
 
 
  I use python sqlite embedded and in my application I have a panel where
 you
  can
  type a query and see the results in a panel's grid
  Now suppose that I type a query like select
  a.field1, b.field2 from table1 a, table2 b  such data
  will be displayed in grid but I need to know what types of data I
 obtained.
  How do it?


 SELECT a.field1, Typeof(a.field1), b.field2, Typeof(b.field2)
 FROM table1 a, table2 b...


 
  --
  Fabio Spadaro
  www.fabiospadaro.com
  ___
  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


It does not work, It always return data type text.

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] data type from join multiple tables

2010-05-14 Thread Fabio Spadaro
Hi,

2010/5/14 P Kishor punk.k...@gmail.com

 On Fri, May 14, 2010 at 10:11 AM, Fabio Spadaro fabiolinos...@gmail.com
 wrote:
  Hi,
 
  2010/5/14 P Kishor punk.k...@gmail.com
 
  On Fri, May 14, 2010 at 9:49 AM, Fabio Spadaro fabiolinos...@gmail.com
 
  wrote:
   hi,
  
   2010/5/14 P Kishor punk.k...@gmail.com
  
   On Fri, May 14, 2010 at 9:01 AM, Fabio Spadaro 
 fabiolinos...@gmail.com
  
   wrote:
I need to identify data types extracted from a
join between multiple tables without using cross-checking
 table_info
  more
pragmatic.
   
  
   Could you clarify what you really want to do? Your question is not
   clear at all, at least to me. What do you mean by using
   cross-checking table_info more pragmatic? More pragmatic than what?
  
Is there a faster way to do it?
   
  
   Faster than what?
  
   If you want data_types, you can use SELECT Typeof(column_name)
  
  
  
  
  
   I use python sqlite embedded and in my application I have a panel
 where
  you
   can
   type a query and see the results in a panel's grid
   Now suppose that I type a query like select
   a.field1, b.field2 from table1 a, table2 b  such data
   will be displayed in grid but I need to know what types of data I
  obtained.
   How do it?
 
 
  SELECT a.field1, Typeof(a.field1), b.field2, Typeof(b.field2)
  FROM table1 a, table2 b...
 
 
  
 
  It does not work, It always return data type text.
 

 That is because your table has probably defined those columns as TEXT.
 Consider the following --

 sqlite CREATE TABLE t (a TEXT, b INTEGER);
 sqlite INSERT INTO t VALUES ('foo', 5);
 sqlite SELECT a, Typeof(a), b, Typeof(b) FROM t;
 a   Typeof(a)   b   Typeof(b)
 --  --  --  --
 foo text5   integer
 sqlite






 --
 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


No, i'm sure. Probably typeof in python's sqlite is not supported very mell
or there is other explanation.

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] store query

2010-01-07 Thread Fabio Spadaro
hi all.

I'm building an wxPython' application  in advanced cases may require a
user to write a query and run it. I would also expect that the same
query is saved in the database to be reused whenever you want.
Someone gives me an indication?

-- 
Fabio Spadaro
www.fabiospadaro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users