how to convert SQLserver proc to work in Oracle?

Original text of this message