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: Noel <tbal_at_go2.pl>
Date: Wed, 5 Sep 2001 09:08:16 +0200
Message-ID: <3b95cd19$1@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 - 02:08:16 CDT

Original text of this message

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