Re: How to UPDATE using ROWNUM and ORDER BY

From: Niall Litchfield <niall.litchfield_at_dial.pipex.com>
Date: 11 Aug 2004 01:00:02 -0700
Message-ID: <b6beca79.0408110000.46ba72c7_at_posting.google.com>


sandy_lucca_at_yahoo.com (Sandy) wrote in message news:<f2c5a2a1.0408100643.841f9eb_at_posting.google.com>...
> I am trying to do the following:
>
> EXEC SQL
> UPDATE MY TABLE
> SET COL1 = :newValue
> WHERE COL1 = 0
> AND ROWNUM = 1
> ORDER BY COL2;
>
> (index on COL1, COL2)
>
> Pro*C does not process the "ORDER BY" statement.
>
> How can I achieve the above
>
> Thanks
> Sandra

If the above worked you would be updating an unpredictable row in the database. Why would you wish to do this.

Niall Litchfield
Oracle DBA
http://www.niall.litchfield.dial.pipex.com Received on Wed Aug 11 2004 - 10:00:02 CEST

Original text of this message