How can I change the optimizer_mode with in a PL/SQL procedure?
It's untested, but this might work ... Code: begin execute immediate 'alter session set optimizer_mode=''first_rows'''; end; /
begin execute immediate 'alter session set optimizer_mode=''first_rows'''; end; /
David Aldridge, "The Oracle Sponge" Senior Manager, Business Intelligence Development XM Satellite Radio Washington, DC Oracle ACE
slimdave, execute immediate worked nicely. I was wondering if there was any oracle supplied package to do the same.
nope, not as far as i know, but you could always create your own procedure.
Forum Rules
Bookmarks