db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject Re: Drop Table
Date Tue, 17 Apr 2007 20:33:23 GMT


tbrazao wrote:
> Hi,
> 
> i'm a new user of derby.
> 
> My question is about the ideia of sql : "drop table if exists ...".
> 
> I read some explanations in this forum, but i didn´t find answers to work in
> sql line commander.
> 
> I know that derby doens't support this job, but i want to ensure that if an
> table exists it is dropped. So i think we can use something like...
> 
> select count(*) from SYS.SYSTABLES where TABLENAME = tableName,
> 
> where tableName  could be an arg for an procedure,
> but i don´t know how to relate this with an drop call. It was simple if we
> have one "if" clause. 
> 
> The problem is that i need to do this without java sintax, i know that seems
> strange, but life it's strange and nobody cares about it...
> 
> If anyone could help, Thanks!

Why not just drop the table and let derby return an error if it did not 
exist?

> 
> And sorry my English!


Mime
View raw message