update om and create reference cursor