From derby-user-return-6624-apmail-db-derby-user-archive=db.apache.org@db.apache.org Tue Apr 17 20:35:22 2007 Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 7106 invoked from network); 17 Apr 2007 20:35:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Apr 2007 20:35:18 -0000 Received: (qmail 99035 invoked by uid 500); 17 Apr 2007 20:35:23 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 98892 invoked by uid 500); 17 Apr 2007 20:35:22 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 98870 invoked by uid 99); 17 Apr 2007 20:35:22 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Apr 2007 13:35:22 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [32.97.182.142] (HELO e2.ny.us.ibm.com) (32.97.182.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Apr 2007 13:35:14 -0700 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e2.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id l3HKYrOV019949 for ; Tue, 17 Apr 2007 16:34:53 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l3HKYrlx546268 for ; Tue, 17 Apr 2007 16:34:53 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l3HKYakw021113 for ; Tue, 17 Apr 2007 16:34:36 -0400 Received: from [127.0.0.1] (sig-9-48-118-56.mts.ibm.com [9.48.118.56]) by d01av03.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l3HKYPTV020028 for ; Tue, 17 Apr 2007 16:34:36 -0400 Message-ID: <46252F13.4050304@sbcglobal.net> Date: Tue, 17 Apr 2007 13:33:23 -0700 From: Mike Matrigali Reply-To: mikem_app@sbcglobal.net User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Discussion Subject: Re: Drop Table References: <10042954.post@talk.nabble.com> In-Reply-To: <10042954.post@talk.nabble.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org 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!