Fix#4310 wrong database selected while creating new procedure

Signed-off-by: Umair Khan <omerjerk@gmail.com>