> -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Tanmoy > Sent: 03 April 2009 14:30 > To: [email protected] > Subject: [sqlalchemy] Re: Insertion issues > > import sqlalchemy > from sqlalchemy import * > > engine = create_engine('mysql://root:voxta...@localhost/stock') > > metadata = MetaData() > > users=Table('NSE', metadata, > Column('Company_ID',String(40),primary_key=True), > Column('10:00',Numeric(8,2)), > ) > > metadata.create_all(engine) > > conn = engine.connect() > > conn.execute(users.insert(), [{'name':'joe', '10:00':'1200'}]) > > Run this snippet.........if u cld..........thr r errors > cropping up........... > > > Tom >
You aren't passing a value for the 'Company_ID' column. If I change your 'name' parameter to 'Company_ID' instead, and run the script on sqlite (ie. dburi = 'sqlite:///:memory:'), it works for me. Simon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
