Robert Zajda <[EMAIL PROTECTED]>
wrote:

On 11/12/06, Igor Tandetnik <[EMAIL PROTECTED]>
wrote:
Robert Zajda
<[EMAIL PROTECTED]>
wrote:
Perhaps something like this:

update articles set order=-1 where order=:oldorder
update articles set order=:oldorder where order=:neworder
update articles set order=:neworder where order=-1

Forgive me, my english is not good enough.
I want to "move up" row with order 2 (on first position - to have
order 1).

So you execute the sequence I've shown with :oldorder bound to 2 and :neworder to 1.

Maybe it's trivial quastion but should I use:
update articles set order=-1 where order=:oldorder and order=2
update articles set order=:oldorder where order=:neworder
update articles set order=:neworder where order=-1

:oldorder and :neworder are meant as parameters. You should use actual values there, either by physically substituting them into the queries, or by using SQLite's parameter binding mechanism (see sqlite3_prepare, sqlite3_bind_int et al).

It wont works.

What makes you say so? What difficulty do you foresee?

Igor Tandetnik

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

Reply via email to