KRACOEUS-6980: Fixing oracle SQL