Toad World® Forums

Error - gather_table_stats

I get an error about regular expressions when I try to run stats (see below and attached). When I run the same statement in sqlplus the statement runs successfully. Is there a workaround?

EXEC dbms_stats.gather_table_stats('&&1','&&2',estimate_percent => dbms_stats.AUTO_SAMPLE_SIZE, degree => DBMS_STATS.AUTO_DEGREE, no_invalidate => true, cascade => true, method_opt => 'FOR ALL INDEXED COLUMNS',granularity => 'ALL');

I don't get any error on this one. What values did you put into those variables?

Maybe Toad has some saved value for them that is causing problems. What if you change the variable names to something you haven't used before?

I used espotnitz for username and fact_product for the table name. Give me a minute to try changing the variable names.

After changing the variable names I get the same error. I will play around and see if I can get this to work.

Hi. I played around and tried different things. The only time the error occurs is when I use "Toad Script Runner". When I run from the Toad editor I do not get an error.

I can reproduce that. TSR still works for other SQL. The problem seems to be more about substitution variables than anything else. I don't think it supports prompting for them like Toad does. I'm logging it so it doesn't get forgotten.

Thanks for the update

FYI. I tried running this same statement using Toad Runner in Toad version 15.0.97.1178 and I get prompted for the variables and the statement runs successfully. I thought this worked before.

Yes. It was broken when I added support in Toad to change the Substitution character. It will be fixed next beta.

Looking forward to the next beta. Thank you