EXECUTE IMMEDIATE is throwing NO_DATA_FOUND exception when it shouldn't
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