Oracle Solution for Error ora-01042

Solution for Oracle Error ORA-01042

ORA-01042: detaching a session with open cursors not allowed

What triggered the Error:

An attempt was made to detach a seesio n which had open cursors.

What should we do to fix it:

Close all the cursors before detaching the session.