Hello,
Althought the following code works, I think it can be improved.
Unfortunatly my mastering of SQLalchemy is not perfect.
Thank you to all those who can help me.
db = create_engine('postgres://<moi>@localhost/test')
metadata = BoundMetaData(db)
users = Table('users',metadata
Column('user_id',Integer,primary-key = True),
Column('user_name',String(40)),
)
users.create()
t = "COPY users FROM '<myfile.dat>'"
conn = db.connect()
trans = conn.begin()
conn.execute(t)
trans.commit()
conn.close()
s = select([users])
result = s.execute()
rows = result.fetchall()
And many thanks to the author(s) of sqlalchemy.
Etienne Marache
Avignon France
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---