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!

EXECUTE IMMEDIATE is throwing NO_DATA_FOUND exception when it shouldn't

Goofy GiraffeApr 28 2012 — edited Apr 29 2012
Hi all,

I have written a PL/SQL anonymous block which on paper should be OK, but one of it's EXECUTE IMMEDIATE commands is runnning out of steam prematurely and throwing a NO_DATA_FOUND exception, when it shouldn't as I know that there is data in the table.

Here's the line that I suspect is running out of steam after 8 attempts :


---
execute immediate 'INSERT INTO ple101.circular35 (ID,SLAVETABLEID,SLAVEITEMID,MASTERTABLEID,MASTERITEMID,PRO)( SELECT * FROM SLAVETASKS where mastertableid=' || subTableID || 'and masteritemid=' || subitemID ||' and subtableid=' || mastTableID || ' and SLAVEITEMID=' || mastItemId ||')';
------

It is supposed to search the entire SLAVETASKS table for records matching the WHERE clause but it gives up after 8 cycles.
SLAVETASKS table has got 10228 records.

The above statement (and the entire PLSQL block) is good in that it fetches the records if they are wthin the first 8 records in the SLAVETASKS table, but as I said after 8 records it gives up throwing a NO_DATA_FOUND exception.

Edited by: user10390960 on 28-Apr-2012 03:21

Edited by: user10390960 on 28-Apr-2012 03:22

Edited by: user10390960 on 28-Apr-2012 03:23

Edited by: user10390960 on 28-Apr-2012 05:08
This post has been answered by Himanshu Binjola on Apr 29 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 27 2012
Added on Apr 28 2012
11 comments
1,260 views