On Sat, May 05, 2007 at 19:30:59 +0800, ronggui wong wrote: > Thanks. But there is no typo, what I want is a general solution. > > 2007/5/5, Tomash Brechko <[EMAIL PROTECTED]>: > >On Sat, May 05, 2007 at 14:01:56 +0800, ronggui wong wrote: > >> . update tablename set newcolname=1 where ROWID=1 > >> . update tablename set newcolname=2 where ROWID=2 > >> . update tablename set newcolname=2 where ROWID=3
If there is no correlation between newcolname and other columns that can be expressed as a formula, but rather you want to set newcolname to some known Func(ROWID), you may register this function with sqlite3_create_function() (or its equivalent for your language bindings), and then do a single statement UPDATE tablename SET newcolname = Func(ROWID); This will be faster then repeatedly searching for a row with a given ROWID. -- Tomash Brechko ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------