On 9/27/06, James W. Walker <[EMAIL PROTECTED]> wrote:

 What is the fastest way to change the values in one column in every
 row?  What I thought of was like so:

 BEGIN TRANSACTION;
 UPDATE MyTable SET TheCol=7 WHERE keyCol=1;
 UPDATE MyTable SET TheCol=8 WHERE keyCol=2;
 ... and so on for each row
 COMMIT;


"Trevor Talbot" <[EMAIL PROTECTED]> wrote:

If the column values are algorithmically related to each other, then
you can have sqlite do it in one pass, possibly using custom functions
to determine relationship.  For the simple example you gave, something
like:

UPDATE MyTable SET TheCol = keyCol + 6;

There's no simple formula, but I suppose I could use a custom function to do a table lookup. That's an interesting idea!
--
  James W. Walker, ScriptPerfection Enterprises, Inc.
  <http://www.write-brain.com/>

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to