Wildcard Operator and Truncate Command

Posted on 1998-10-15
Last Modified: 2012-08-14
Does Oracle support a wildcard operator?

I'd like to issue the command:


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?
Question by:aumdavis
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

Accepted Solution

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.

Author Comment

ID: 1082096
Thanks for your help, junfeb.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

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