title: Drop DB2 table if exists
body: <p>In my script I have to do a lot of selects to a joined table, so instead I decided to put this join into a temporal table. </p>
  
  <p>First I thought: </p>
  
  <pre><code>1. Create table
  2. Put the data from the join into a table
  3. Drop the table 
  </code></pre>
  
  <p>But then I thought, what if the script fails before I dropped the table? </p>
  
  <p>So I decided to go with: </p>
  
  <pre><code>1. Drop the table
  2. Create the table
  3. Put the data from the join into a table
  </code></pre>
  
  <p>I don't really mind if the table is left there until the next time I run the script, so the second option works too. </p>
  
  <p>But what if somebody had already dropped the table? </p>
  
  <p>I saw some systems have a "drop if exists" but unfortunately not DB2. I would like to do something that won't make the script die when the drop table fails. </p>
  
  <p>Ideas? On any of this? Thanks! </p>
  
  <p>EDIT: I forgot to say this is in a PERL script! </p>