change some PostgreSQL fiels in a table

Home
Photography
Projects
About me
Robots
Publications
Friends' pages:
Chris
Jeff
John
Minu
Raeed
Email me:
alex AT joni.ro


Share

UPDATE purchase_order set name=substring(name for 3) || '_' || substring(name from 4) || '_2010' WHERE id > 35 and id < 57;


This changes the name field in the purchase_order table of the current DB.

The new value will be = first 3 chars of the old value with '_' appended, then the rest of the original text + '_2010'.

Only fields where id is > 35 and < 57 are affected.



For updating outgoing products (wrongly set as already invoiced, but changing to stat='2binvoiced'

(the id can be read in Koo, bottom line : Editing document (id=xxxx)



psql -U openerp CLR

\d; (for printing all tables)

CLR=> UPDATE stock_picking set invoice_state='2binvoiced' WHERE id=5455;



[æ]