-504 Referenced item has not been declared or prepared
Possible Cause
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.
Possible Solution
Ensure the dynamic statement is prepared before attempting the reference.