<div>Well you need to test if the select actually returned any records before calling the drop table. All possible with SQL.</div>
<div> </div>
<div>I see a bit of research in your future :-)<br><br></div>
<div class="gmail_quote">On Wed, Jun 17, 2009 at 7:58 AM, Jeremy Coulter <span dir="ltr"><<a href="mailto:jscoulter@gmail.com">jscoulter@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Thansk for your reply edward. However, I dont normall use Interbase and your example didnt make a lot of sence. I managed to find a similar example but I dont follow part of it.<br>
<br>when I run :<br><br>select * from rdb$relations WHERE RDB$RELATION_NAME = 'MyTable'<br>and<br>DROP TABLE MyTable;<br>COMMIT;<br><br>It tells me DROP is an invalid token. So I assume the "And" is not part of the SQL statement.<br>
So what I dont follow is, just doing a "SELECT" to see if a record exists then dropping the table seems like something is missing.<br><br>in a programming sense, I would expect something like<br><br>IF select * from rdb$relations WHERE RDB$RELATION_NAME = 'MyTable' <> '' then<br>
DROP TABLE MyTable;<br><br>I know thats not real code, but my point is, just because I can do a select, doesnt tell me if the table exists or not to try to delete it.......I hope you follow what I am meaning.<br><font color="#888888"><br>
Jeremy</font>
<div>
<div></div>
<div class="h5"><br><br><br>
<div class="gmail_quote">On Tue, Jun 16, 2009 at 4:05 PM, John Bird <span dir="ltr"><<a href="mailto:johnkbird@paradise.net.nz" target="_blank">johnkbird@paradise.net.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div bgcolor="#ffffff">
<div><font face="Arial" color="#000000" size="2">For a good working example see</font></div>
<div><font face="Arial" color="#000000" size="2"></font> </div>
<div><font face="Arial" color="#000000" size="2"><a href="http://xkcd.com/327/" target="_blank">http://xkcd.com/327/</a></font></div>
<div><font face="Arial" color="#000000" size="2"></font> </div>
<div><font face="Arial" color="#000000" size="2">(Standard disclaimer - do not try this at home!)</font></div>
<div><font face="Arial" color="#000000" size="2"></font> </div>
<div>John</div>
<div><font face="Arial" color="#000000" size="2"></font> </div>
<div>----- Original Message ----- </div>
<blockquote style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<div>
<div style="BACKGROUND: rgb(228,228,228); FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><b>From:</b> <a title="jscoulter@gmail.com" href="mailto:jscoulter@gmail.com" target="_blank">Jeremy Coulter</a> </div>
<div style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><b>To:</b> <a title="delphi@delphi.org.nz" href="mailto:delphi@delphi.org.nz" target="_blank">NZ Borland Developers Group - Delphi List</a> </div>
</div>
<div>
<div></div>
<div>
<div style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><b>Sent:</b> Tuesday, June 16, 2009 3:35 PM</div>
<div style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><b>Subject:</b> Re: [DUG] Drop table in Interbase</div>
<div><font face="Arial" color="#000000" size="2"></font><br></div>ok cool I will try that.<br><br>Thanks, Jeremy<br><br>
<div class="gmail_quote">On Tue, Jun 16, 2009 at 2:54 PM, Edward Koryagin <span dir="ltr"><<a href="mailto:ed_iv2001@yahoo.co.nz" target="_blank">ed_iv2001@yahoo.co.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"><font face="Arial" color="#000000" size="2"></font><br>select * from rdb$relations ...<br>and<br>
DROP TABLE ....<br>Edward Koryagin<br><br><br>--- On Tue, 16/6/09, Jeremy Coulter <<a href="mailto:jscoulter@gmail.com" target="_blank">jscoulter@gmail.com</a>> wrote:<br><br>> From: Jeremy Coulter <<a href="mailto:jscoulter@gmail.com" target="_blank">jscoulter@gmail.com</a>><br>
> Subject: [DUG] Drop table in Interbase<br>> To: "NZ Borland Developers Group - Delphi List" <<a href="mailto:delphi@delphi.org.nz" target="_blank">delphi@delphi.org.nz</a>><br>> Received: Tuesday, 16 June, 2009, 1:31 PM<br>
<div>
<div></div>
<div>> Hi all.<br>> In interbase, how do I drop a table if it already exists?<br>> I want to check for a table exists and if it does exist,<br>> drop it.<br>><br>> I have Googled, but I cant seem to find anything. I am<br>
> prob. searching wrong :-)<br>><br>><br>> Jeremy<br>><br>><br></div></div>> -----Inline Attachment Follows-----<br>><br>> _______________________________________________<br>> NZ Borland Developers Group - Delphi mailing list<br>
> Post: <a href="mailto:delphi@delphi.org.nz" target="_blank">delphi@delphi.org.nz</a><br>> Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
> Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz" target="_blank">delphi-request@delphi.org.nz</a><br>> with Subject: unsubscribe<br><br><br><br><br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>Post: <a href="mailto:delphi@delphi.org.nz" target="_blank">delphi@delphi.org.nz</a><br>Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz" target="_blank">delphi-request@delphi.org.nz</a> with Subject: unsubscribe<br></blockquote></div><br></div></div>
<p></p>
<hr>
<div>
<p></p>_______________________________________________<br>NZ Borland Developers Group - Delphi mailing list<br>Post: <a href="mailto:delphi@delphi.org.nz" target="_blank">delphi@delphi.org.nz</a><br>Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz" target="_blank">delphi-request@delphi.org.nz</a> with Subject: unsubscribe</div></blockquote></div><br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>Post: <a href="mailto:delphi@delphi.org.nz" target="_blank">delphi@delphi.org.nz</a><br>Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz" target="_blank">delphi-request@delphi.org.nz</a> with Subject: unsubscribe<br></blockquote></div><br></div></div><br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>Post: <a href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a><br>Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject: unsubscribe<br></blockquote></div><br>