Greetings,Alvaro Tejada GalindoDevelopment ExpertDeveloper ExperienceSAP Labs Montreal
As promised...here's the link on the SAP Community Network...
http://scn.sap.com/community/developer-center/hana/blog/2012/11/29/sqlalchemy-and-sap-hana
query = Session.query(Singer.singer_id).\
order_by(desc(Singer.singer_id)).first()
singer_id = int(query[0]) + 1
My eyes are hurting: if two persons ask for the same form (at almost the same time), but the first fill it in slower than the second one, then, the second's data will be lost.
You'd rather not specify the ID and normally by asking Singer.singer_id after saving it you got your last inserted id. If singer_id is not an autoincremented field, you have a problem.
Cheers
--
Julien Tayon
I know :) But this is just a simple example, so I didn't want to go into much details...also...I have only used SQLAlchemy for 15 hours and I don't work with Python in a regular basis (only when I need to write a blog about it)...so I'm sure there might be more "you shouldn't do it like this" on my code...How would you do it? AFAIK in SQLite that can be done automatically...in SAP HANA I don't think so, so it must be handled on the SQLAlchermy or Python side...