I am creating a stored procedure for gathering table stats and am getting an error on my select statement but I don't see what the problem is? Any ideas?
select 'dbms_stats.gather_table_stats(
ownname => user,
tabname => '||table_name||',
estimate_percent => 2,
block_sample => TRUE,
cascade => TRUE);'
FROM user_tables WHERE TABLE_NAME='TABLEA';