Ya..  I thought about all that, but the web pages will be built based
on queries, so the support needs to come from the SQL statement.
Using the key value is just not practical.

What I am thinking about is adding a custom function (I think sqlite
supports that) and just using a boolean static variable that toggles
between two supplied strings each time.

I am just wondering if it was done or there is an easy way..

Thanks

Randall Fox

On Wed, 21 Jul 2004 08:55:09 -0500, you wrote:

>> 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