Wildcard Operator and Truncate Command

Does Oracle support a wildcard operator?

I'd like to issue the command:

TRUNCATE TABLE TEST_PRE_*

and have Oracle truncate all tables that begin with TEST_PRE_

When I try to execute this statement, I get the error "SQL command not properly ended"  Is there a way to make this work?
LVL 1
aumdavisAsked:
Who is Participating?
 
junfebConnect With a Mentor Commented:
Nope! you'd have to specify individual table_names.

But though you could generate a scritp to truncate all tables with the TEst_

select 'truncate table '||table_name || ';' from user_tables where table_name like 'TEST_PRE%' ;

This will generate a script which you can then run.
0
 
aumdavisAuthor Commented:
Thanks for your help, junfeb.
0
All Courses

From novice to tech pro — start learning today.