How to return temporary CLOB instance from stored function in Pl/SQL?
My stored function creates temporary LOB instance using: Dbms_Lob.CreateTemporary(BUFFER, TRUE, Dbms_Lob.SESSION); where BUFFER is a local CLOB variable. After that the function fills BUFFER with some data and returns it. Duration parameter of Dbms_Lob.CreateTemporary in my case is Dbms_Lob.SESSION , but according to oracle documentation : The duration parameter passed to dbms_lob.createtemporary() is a hint . The duration of the new temp LOB is the same as the duration of the locator variable in PL/SQL. For example, in the preceding program block, the program variable a has the duration of