WCM Forum

WCM Forum (http://www.wcm.at/forum/index.php)
-   Programmierung (http://www.wcm.at/forum/forumdisplay.php?f=17)
-   -   drop table (http://www.wcm.at/forum/showthread.php?t=215856)

rotkiv 17.05.2007 09:25

drop table
 
Hi leute,
nur eine kurze frage:
wie lösche ich tabellen, die alle mit "jos" anfangen per SQL?
für euch sicher ganz easy, aber für mich nicht.
DROP TABLE jos* ?? oder so
vielen dank
rotkiv

pong 17.05.2007 09:31

Nein, Name muss explizit angegeben werden

Welche DB?

pong

rotkiv 17.05.2007 09:42

MySQL mit phpmyadmin
geht das wirklich nicht?

The_Lord_of_Midnight 03.06.2007 01:47

Ganz einfach, du machst ein SQL Generatorscript und führst dann das generierte Programm aus.

spool droptbl.sql
select
'drop table ' || table_name || ';'
from all_tables
where table_name LIKE 'jos%';
spool off

Philipp 03.06.2007 09:56

Das ist aber für Oracle ;)

The_Lord_of_Midnight 03.06.2007 10:19

Darum gehts ja nicht, es geht um den Ansatz.
Wie man das in diversen Dialekten codiert ist ja nicht das Problem.
;)


Alle Zeitangaben in WEZ +2. Es ist jetzt 00:20 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© 2009 FSL Verlag