Hello,

I have try to insert some data from a dict into my table and I have used 
the description 
on http://docs.sqlalchemy.org/en/rel_0_8/core/tutorial.html#insert-expressions
I run this command:

connect.execute( sqlalchemy.Table( tablename, metadata ).insert().values( 
i.keys() ).compile(), **i )

where i is my dict. A changing to .valies( i ) create an error, so it is 
different to the tutorial, because the tutorial shows IMHO that I can push 
the dict full into the value

method. On my command I get an error:

'SQLCompiler' object has no attribute 'positiontup' (original cause: 
AttributeError: 'SQLCompiler' object has no attribute 'positiontup') 
'INSERT INTO mytable2 ("fieldB", pk) VALUES (:fieldB, :pk)' [{'fieldB': 
'blub', 'fieldA': '1234'}]

My i is defined like i = {"fieldB" : "blub", "fieldA" : "1234"}, the error 
is also shown, if I used the dict values in the execute call. 

I would like to add different fields to my value clause, the field names 
are the keys of my dict and the dict values are the content which should be 
inserted.

I don't understand, why the values() call add the "pk" field, it is not in 
my dict and why generates the execute a list of my dict.

Thanks for help

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to