Hi Marc Weber

> Another example: Updating the age of a pupil:
> 
>   row = SELECT * FROM pupils where age = 13;
>   UPDATE pupils SET age = 14 WHERE id = <the id you got above>
> 
>   p = session.query(Pupil).filter(Pupil.age==13).one().age=14
>   session.commit()
> 
>   difference?
>   You don't have to care about ids. you just assign a new value and
> tell
>   the engine that it should commit.
>   So again less chances to get something wrong.
> 

Could you not do in SQL:

UPDATE pupils SET age = 14 WHERE age = 13

That is, without using ids.


Greetings,

Mads Lindstrøm

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to