> Is there an easy way to have an "alternating" column value ...?

No easy or reliable way that I can see.

Given a table with an integer primary key (ipk), you could let
(ipk % 2 == 0) => white and (ipk % 2 != 0) => gray, but that
would work only if (1) you never delete a row or (2) you delete
only adjacent pairs of rows, meaning that if you delete a
particular ipk, you must also delete the next greater or next
smaller ipk.

Also, if you insert a row, you'd probably want to supply the
new ipk yourself [max(ipk)+1]; otherwise you'd be depending on
SQLite to suppy sequential keys automatically, and I vaguely
remember some postings to this list claiming that SQLite
sometimes skips a number.  I don't know if that issue was ever
resolved.

This also assumes that sorting by ipk gives the order that you
want.

The basic problem is that you want to do something based on
row order, and (theoretically) row order doesn't exist until
you've retrieved your data.  All in all, it would probably be
better to add the colors after you retrieve the data into an
array or list in your host language.

Regards

Reply via email to