Thank you for your help and for answering!
It works but it returns only one of the companies, the logistic.
We need to have as well get.compnr() because the user should have 2 options:either the financial or the logistic.
We could get the financial from this sql,
where tcemm170.comp = :comp
but how we could combine it to your code?