Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql to create sql 1

Status
Not open for further replies.

scohan

Programmer
Dec 29, 2000
283
US
I've done this before but can't remember the syntax nor find a saved script. I want to run a sql statement to create a 'drop table ...' for every table in a schema, but I can't remember the sytax surrounding the table_name column in the select statement. I have something like:

select "drop table " table_name " cascade contraints;" from user_tables;

but it's not working.

????

Thanks.
 
try :

select 'drop table '||table_name||' cascade contraints;' from user_tables;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top