Content window is blank

mike

Member³
Oracle's program fnd_message code contents is blank until I comment out the lines in the purge procedure as shown below. If I paste the procedure in a blank package without the lines commented, the code contents is blank as well. I took out most of the code trying to make the example simpler.
Code:
procedure PURGE is

        L_TO_DATE date;

        cursor del_curs(l_till_date date) is
        select rowid from FND_LOG_MESSAGES WHERE TIMESTAMP <= l_till_date;

    begin
                open del_curs(L_TO_DATE);

                LOOP
                   FETCH del_curs BULK COLLECT INTO L_ROWID  LIMIT 1000;
                   IF L_ROWID.COUNT > 0 THEN
--                      FORALL i IN 1 .. L_ROWID.COUNT
--                        EXECUTE IMMEDIATE 'delete /*+ PARALLEL(T) ROWID(T) */ FND_LOG_MESSAGES T where T.ROWID = :x' USING L_ROWID(i);
                  END IF;
                     EXIT WHEN del_curs%NOTFOUND;
                END LOOP;
        CLOSE del_curs;

end PURGE;
 
As mike states, it is the EXECUTE IMMEDIATE statement that breaks it. It can be broken down into more simplified code:

SQL:
procedure PURGE is
  list sys.role_id_list;
begin
  FORALL i IN 1 .. list.count
    EXECUTE IMMEDIATE 'x' USING list(i);
end PURGE;

The code can compile, but probably not execute.

If you replace the EXECUTE IMMEDIATE with an INSERT, UPDATE, DELETE, MERGE, SAVE EXCEPTIONS or similar statement, it works
 
Last edited:
Back
Top