I came from MS SQLServer and I miss a lot of nice functionalities, like for instance, If exists.
Why am I talking about this? Simple, I want to run a script that "only" drops a few tables that I'don't no if they already exists.
Easy to say, hard to find. So here's a script for doing that, without returning any errors.
set echo off;
set heading off;
spool run.sql;
select 'drop table 'table_name';' from dba_tables where UPPER(table_name) in ('TABLEA', 'TABLEB', 'TABLEC');
spool off;
@run.sql;
Enjoy.
Wednesday, January 7, 2009
Subscribe to:
Post Comments (Atom)
Archive
-
▼
2009
(21)
-
▼
January
(21)
- How to deploy files in a remote server?
- Oracle : Reduce your parsing times
- Oracle : SQLCODE and SQLERRM in Inserts
- SQL * Plus Tip - 1
- Oracle : Reducing join execution time
- PL/SQL Tip - 1
- PL/SQL : Show locked objects
- PL/SQL : How to update using select
- EIM : Shell execution order
- PL/SQL : Scripting for table drop
- EIM : DUP_RECORD_EXISTS after Update
- Localcooling . com
- How to relate a contact whit their accounts
- PL/SQL : Check script for object owners
- SQL Navigator : Code Templates
- S_POSTN_CON : Description
- Joins : Please talk ANSI SQL with me.
- WHy MINUS does NOT EXISTs in our queries?
- Get last file version
- Debugging in http://localhost:8082
- Error 452: Match column X not found in Y
-
▼
January
(21)
Translation by Google
Subscription Free
Categories
- ANSI SQL
- Back to Basics
- Best Practices
- Case Study
- cfg File
- Check In -Check Out
- Configuration
- Copy
- Debug
- Ecology
- EIM
- eScript
- Files
- Firewall
- Harvest
- How - To
- I Wish I Knew
- List of Values
- Logging
- Mapping
- Oracle
- PL/SQL
- Remote Server
- Siebel
- Siebel CRM
- Siebel Logs
- Siebel Tools
- Signals
- SQL Plus
- SQLNavigator
- Tunning
- Web Services
- Workflows
No comments:
Post a Comment