I want to drop a table from within Python. The command
  1. cur.execute('drop table if exists tab1')
and
  1. cur.executescript('drop table if exists tab1;')
both work fine if execute python script directly under Linux command window.

But why the first one doesn't work if call python script from
some tinuous integration tools, such as, Hudson (http://hudson.dev.java.net/)
Why Question: drop table in python with sqlite3?-LMLPHP?


My script for example: drop.py

  1. import os, re
  2. import sqlite3

  3. conn = sqlite3.connect("./SQLiteDatabase.db3")
  4. cursor = conn.cursor()

  5. cursor.execute("drop view if exists table1")
  6. cursor.executescript("drop view if exists table2;")
  7. conn.close()



10-05 01:41