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: join on ROWID in EXECUTE IMMEDIATE

Re: join on ROWID in EXECUTE IMMEDIATE

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Mon, 26 Jan 2004 08:21:51 -0800
Message-ID: <1075134047.994787@yasure>


Per Haglund wrote:

> My problem looks like this:
>
> I do an Insert based on joining two tables "P3000_" and
> "P3000_al_level"
> on ROWID, with this where condition:
>
> WHERE decode(P3000_al_level.al_id,null,2059, P3000_al_level.al_id) =
> 2059
> AND decode(P3000_al_level.al_level,null,99,P3000_al_level.al_level)
>

>>5

>
> AND P3000_al_level.row_id(+) = P3000_.rowid
>
> Row_id in "P3000_al_level" is a column with rowid datatype. In
> "P3000_" i use oracle rowid.
> When I run the insertstatement in Toad it generate 0 inserts =correct.
> , when i run the statement using EXECUTE IMMEDIATE <string> in PL/SQL
> it generate 11 inserts (there are 11 rowids matching in p3000_al_level
> but with al_level=5).
>
> /Per

I can't help you with your specific question but you seem to be storing ROWID in a table. Do you understand that the ROWID of a table row is not a static value? The fact that you are pointing to it from stored data is no guarantee it will still have that same ROWID at some point in the future.

I may be misinterpreting what you wrote but your design looks fatally flawed to me.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Mon Jan 26 2004 - 10:21:51 CST

Original text of this message

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