select d.doc, d.fname, d.contenttype from #entity#_doc d where #entity#_doc_id= #errMsg#