Hi Scott and thanks for your answer.
As I stated in my last post, the web service already has the orderID as a parameter. As the stored procedure is called at the same step, the orderID must be available in the code section executed after payment. Why it is not transmitted to the stored procedure too ?
And it will be dangerous to consider that the order reccord is the reccord who reference the last payment reccord as 2 orders can be done at the same time (or near) and the PayPal IPN can be postponed (as indicated in the PayPal help).