Re: selecting a record based on row id

From: Jon Schlatter <*jon-schlatter_at_stamats.com>
Date: Wed, 5 Sep 2001 14:43:46 -0500
Message-ID: <tpcvjvb4m4c87d_at_corp.supernews.com>


This is just what I needed. Thanks for the help and for putting up with my ignorance!

"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 Wed Sep 05 2001 - 21:43:46 CEST

Original text of this message