[sqlalchemy] multiple insert with default values

2009-08-26 Thread menuge
Hi all, I d like to insert a list of dictionary in a simple MySQL table but, I have a problem, in my case, the MySQL default values are not supported... The table is very simple; 2 columns and a default value on the col2: ## CREATE TABLE `test` ( `col1` int(11) default NULL, `col2`

[sqlalchemy] Re: multiple insert with default values

2009-08-26 Thread menuge
INTO test (col1, col2) VALUES (?, ?) x...94f0 [[2, 5], [1, None]] x...94f0 COMMIT Implied rule is: when inserting many records, provide same value list for each row. -- Mike Conley On Wed, Aug 26, 2009 at 5:36 AM, menuge men...@gmail.com wrote: Hi all, I d like to insert a list

[sqlalchemy] compare 2 tables

2009-04-01 Thread menuge
Hi, I have to write a table comparator. Actually, I have 2 sqlite files (file1.db, file2.db) with the same schema (2 tables tab1, tab2). I d like to compare the values of the tables (values added, values deleted, values modified). I don't know how to start. Can someone help me? Thanks in

[sqlalchemy] insert NULL value

2008-10-08 Thread menuge
Hi all, I don't know how to insert a NULL value in a mysql table... Here is my code: ## table = Table(table, metadataConfig, autoload=True) i = table.insert() i.execute({param1:'HIHIIH',param2:Null}) ## I tried to replace Null by None, but in Mysql, the result is None... Is the a

[sqlalchemy] catch warning when insert

2008-08-26 Thread menuge
Hi all, I have 2 tables: - info (id: integer, cfg: integer) - info_with_error (id:integer, cfg: varchar(32)) I'd like to check the query before inserting into table. For instance: if I build this query: INSERT INTO info VALUES(STRING) I d like to catch the warning generated during the