You are here

function migrate_example_oracle_uninstall in Migrate 6.2

Same name and namespace in other branches
  1. 7.2 migrate_example/migrate_example_oracle/migrate_example_oracle.install \migrate_example_oracle_uninstall()

Implementation of hook_uninstall().

File

migrate_example/migrate_example_oracle/migrate_example_oracle.install, line 76

Code

function migrate_example_oracle_uninstall() {
  global $conf;
  $connection = @oci_connect($conf['oracle_db']['username'], $conf['oracle_db']['password'], $conf['oracle_db']['connection_string'], 'UTF8');
  if (!$connection) {
    $e = oci_error();
    throw new Exception($e['message']);
  }

  // Get rid of the test data
  $query = "DROP TABLE ORACLE_CONTENT";
  $result = oci_parse($connection, $query);
  if (!$result) {
    $e = oci_error($connection);
    throw new Exception($e['message'] . "\n" . $e['sqltext']);
  }
  $status = oci_execute($result);
  if (!$status) {
    $e = oci_error($result);
    throw new Exception($e['message'] . "\n" . $e['sqltext']);
  }
}