db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suavi Ali Demir <dem...@yahoo.com>
Subject Re: newbie question
Date Mon, 17 Dec 2007 01:07:21 GMT
drop the table and ignore the does not exist error.

Brad Berens <theg33k@gmail.com> wrote:
  I've googled for this but all I can find is create statements so I'm hoping someone can
just give me a quick answer.  I'm trying to write some db creation scripts.  Normally in MSSQL
I would use an if exists from the system tables to check whether or not to run a drop before
creating the table.  I found the sys.systables info about derby, but I can't seem to get the
if clause working for that.

IF EXISTS (SELECT * FROM sys.systables WHERE tablename='[tablename]') DROP TABLE [tablename];

Thanks in advance, 

Looking for last minute shopping deals?  Find them fast with Yahoo! Search.
View raw message