Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> SQL giving problem over the database link
Greetings,
Here is the scenario.
We are trying to insert records into a remote table via database link after selecting the data locally.
This query hangs for ever:
(select fw.fwlot.sysid from fw.fwlot where fw.fwlot.appid = '2000005956');
select fw.fwlot.sysid from fw.fwlot where fw.fwlot.appid = '2000005956' : This query returns only one row.
SELECT * FROM FW.FWLOT_PN2M WHERE FW.FWLOT_PN2M.fromid = (.....) : This select returns 15 rows.
If I replace the subquery as follows then it works great :
I tried to do the same insert locally and it works great :
For some reason the combination of database link and the subquery in the select clause is going for full table scan for each occurence of formid. I am wondering if this is a bug or something against the rule. WHERE FW.FWLOT_PN2M.fromid =
(select fw.fwlot.sysid from fw.fwlot where fw.fwlot.appid = '2000005956');
Any explanation or help is appreciated.
Thanks,
Ashoke
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mandal, Ashoke INET: ashoke.k.mandal_at_medtronic.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Mon Apr 22 2002 - 10:48:29 CDT
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
![]() |
![]() |