/** * Function to safely drop trigger db object. * * @param string $name * @return boolean */ public function drop($name) { if (!$name) { return false; } return $this->connection->statement("declare\n e exception;\n pragma exception_init(e,-4080);\n begin\n execute immediate 'drop trigger {$name}';\n exception\n when e then\n null;\n end;"); }
/** * function to safely drop sequence db object * * @param string $name * @return boolean */ public function drop($name) { // check if a valid name and sequence exists if (!$name || !$this->exists($name)) { return false; } return $this->connection->statement("\n declare\n e exception;\n pragma exception_init(e,-02289);\n begin\n execute immediate 'drop sequence {$name}';\n exception\n when e then\n null;\n end;"); }