Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: selecting a record based on row id

Re: selecting a record based on row id

From: Andrew Hardy <nobody_at_spam.from.news.AdvanticaTech.com>
Date: Thu, 6 Sep 2001 13:57:54 +0100
Message-ID: <9n7rss$ssi$1@sun-cc204.lut.ac.uk>


But doesn't this assume that the order in which the update will act is the same as the order in which the unknown select query is retrieving the data?

I'd have thought that you need to get the 'key' or the rowid for the bad data?

Andy

"Noel" <tbal_at_go2.pl> wrote in message news:3b95cd19$1_at_news.vogel.pl...
>
> Użytkownik "Jon Schlatter" <*jon-schlatter_at_stamats.com> napisał w
wiadomości
> news:tp9qvsj0jvv5c4_at_corp.supernews.com...
> > Is there a SQL Plus/PLSQL command to select a record based on row id? I
> have
> > a table which has a single records with malformed data. The tables
> contains
> > 140,000 records so it is difficult to review manually, but I know that
> > record 63,873 has the bad data. How can I view/change just that record
> > without knowing what specific data it contains.
>
> Just add column and fill it from a sequence.
>
> ALTER TABLE <Your_Table> ADD record_no NUMBER;
> CREATE SEQUENCE S_TMP;
> UPDATE <Your Table> SET record_no = s_tmp.NextVal;
> COMMIT;
> DROP SEQUENCE S_TMP;
>
> SELECT * FROM Your_Table WHERE record_no = 63873;
>
> If you store a ROWID of a row, you can find it by that value, but using
> rownum you fail.
>
> SELECT * FROM Your_Table WHERE rownum = 63873 returns no rows.
>
> You can of corse SELECT <data>, rownum FROM Your_Table and browse results
> until rownum = 63873....
>
> PS.
> Rowid looks like this.
> example:
> AAAOb8AASAABlRgAAA
>
> ------
> Noel
>
>
>
>
>
Received on Thu Sep 06 2001 - 07:57:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US