Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Selecting rowid from the View.

HarishSep 27 2005 — edited Sep 27 2005
Hi,
I created view selecting rowid from two different tables:
create table A
(
A NUMBER
);

create table B
(
B NUMBER
)

CREATE OR REPLACE VIEW C AS
SELECT rowid objid, a FROM a
UNION
SELECT rowid objid, b FROM b
;

Now insert record to table A:
INSERT INTO A VALUES (1);

Now Select this record:
SELECT rowid, A.a FROM A;
Result is:
ROWID A
------------------ ----------
AAAT0oAAGAAA9bgAAA 1

Following query works fine:
select * from a
where rowid = 'AAAT0oAAGAAA9bgAAA';

But selecting it from VIEW is NOT working.
select * from C
where objid = 'AAAT0oAAGAAA9bgAAA';
The error 'ORA-01410: invalid ROWID' is raised.

But selecting it with LIKE (without %) is also working.
select * from C
where objid LIKE 'AAAThgAAGAAA9SEAAA'

What is the reason for this behaviour in rowid. I 'm using Oracle 10.1.0.4.0.

Regards,
/Harish
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 25 2005
Added on Sep 27 2005
1 comment
948 views