Writing 2 versions of each stored procedure is probably the best approach in fact. This allows you to cater for and use the different behaviour and features of the DBMSs. It isn't just a matter of finding the lowest common denominator SQL, it is also about understanding that the same logic, while syntactically valid in both DBMSs, may perform differently, even maybe have different results due to different locking mechansims, treatment of nulls etc.
Oracle guru Tom Kyte goes into this
here
Search the page for "database independence". If you search the site you will find other discussions on the topic also.