Roberto,

Just a couple of things.

Functions do allow you to do inserts, it must be the way you are trying to do the insert that is at fault. If you post the code I (or someone else) could have a look and point you at the error.

Procedures do allow return values, in the procedure specification you can specify OUT or IN OUT and that will return the value to the calling procedure.

Hope this is of help.