More Oracle sql fixes