I propose changing the format of the access_log from "common" to "combined", so that the User-agent and Referer are also logged. Does anybody object? .robin. -- select replace(a, CHR(88), replace(a,'''','''''')) from ( select 'select replace(a, CHR(88), replace(a,'''''''','''''''''''')) from ( select ''X'' a from dual)' a from dual)