My Oracle Support Banner

ORA-21780 Maximum Number Of Object Durations Exceeded: Using A Loop With EXECUTE IMMEDIATE And XMLTYPE (Doc ID 1345804.1)

Last updated on JULY 03, 2023

Applies to:

PL/SQL - Version and later
Information in this document applies to any platform.


Populating an XMLSEQUENCETYPE (SYS.XMLTYPE) via an EXECUTE IMMEDIATE in a loop fails on approx 65k iterations with

ORA-21780 "Maximum number of object durations exceeded."

Works when calling the procedure directly instead of using Execute Immediate.

Below is an example to demonstrate the error:


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.