Solved

Wildcard Operator and Truncate Command

Posted on 1998-10-15
2
1,261 Views
Last Modified: 2012-08-14
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?
0
Comment
Question by:aumdavis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
junfeb earned 10 total points
ID: 1082095
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
 
LVL 1

Author Comment

by:aumdavis
ID: 1082096
Thanks for your help, junfeb.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question