Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Wildcard Operator and Truncate Command

Posted on 1998-10-15
2
Medium Priority
?
1,275 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 30 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

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…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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 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.

721 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