The script above will do that, call the stored proceure proc with the envirionemnt variable as it's parameter.