set @path_separator := '\\';
select m.id,m.receivedDate, m.sedexId as 'Verarbeitende_Instanz_Id', mandant.name as 'Verarbeitende_Instanz_Name', m.recipientId, m.senderId, processId, processName, m.currentStateMsg, m.messageId, m.folder, m.fileName, 
    concat(m.folder,@path_separator,m.fileName) as 'FullPath' 
  from Message m, ProcessMapping pm, JBPM_PROCESSINSTANCE jp, smMandant mandant 
  where pm.messageId = m.messageId and m.sedexId = mandant.sedexId
  and jp.ID_ = pm.processId and m.currentStateMsg not like '%end%' and jp.END_ is null;

-- Faster query, but doesn't give the file location.  
select messageId, ID_, START_, END_ from ProcessMapping pm, JBPM_PROCESSINSTANCE jp where jp.ID_ = pm.processId and jp.END_ is null;

