-504 Referenced item has not been declared or prepared
The referenced dynamic statement has not been successfully prepared prior to the current request. This error may be returned for a DESCRIBE or EXECUTE request. Dynamic statements become unprepared when a commit or rollback occurs.
Ensure the dynamic statement is prepared before attempting the reference.