public function autoIncrement($table, $column, $triggerName, $sequenceName)
    {
        if (! $table || ! $column || ! $triggerName || ! $sequenceName) {
            return false;
        }

        if ($this->connection->getConfig('prefix_schema')) {
            $table        = $this->connection->getConfig('prefix_schema') . '.' . $table;
            $triggerName  = $this->connection->getConfig('prefix_schema') . '.' . $triggerName;
            $sequenceName = $this->connection->getConfig('prefix_schema') . '.' . $sequenceName;
        }

        $table  = $this->wrapValue($table);
        $column = $this->wrapValue($column);

        return $this->connection->statement("
            create trigger $triggerName
            before insert on {$table}
            for each row
                begin
            if :new.{$column} is null then
                select {$sequenceName}.nextval into :new.{$column} from dual;
            end if;
            end;");
    }
public function autoIncrement($table, $column, $triggerName, $sequenceName)
    {
        if (! $table || ! $column || ! $triggerName || ! $sequenceName) {
            return false;
        }

        if ($this->connection->getConfig('prefix_schema')) {
            $table        = $this->connection->getConfig('prefix_schema') . '.' . $table;
            $triggerName  = $this->connection->getConfig('prefix_schema') . '.' . $triggerName;
            $sequenceName = $this->connection->getConfig('prefix_schema') . '.' . $sequenceName;
        }

        $table  = $this->wrapValue($table);
        $column = $this->wrapValue($column);

        return $this->connection->statement("
            create trigger $triggerName
            before insert on {$table}
            for each row
                begin
            if :new.{$column} is null then
                select {$sequenceName}.nextval into :new.{$column} from dual;
            end if;
            end;");
    }
public function autoIncrement ( $ table , $ column , $ triggerName , $ sequenceName ) { if ( ! $ table || ! $ column || ! $ triggerName || ! $ sequenceName ) { return false ; } if ( $ this -> connection -> getConfig ( 'prefix_schema' ) ) { $ table = $ this -> connection -> getConfig ( 'prefix_schema' ) . '.' . $ table ; $ triggerName = $ this -> connection -> getConfig ( 'prefix_schema' ) . '.' . $ triggerName ; $ sequenceName = $ this -> connection -> getConfig ( 'prefix_schema' ) . '.' . $ sequenceName ; } $ table = $ this -> wrapValue ( $ table ) ; $ column = $ this -> wrapValue ( $ column ) ; return $ this -> connection -> statement ( "
            create trigger $triggerName
            before insert on {$table}
            for each row
                begin
            if :new.{$column} is null then
                select {$sequenceName}.nextval into :new.{$column} from dual;
            end if;
            end;" ) ; }
Function to create auto increment trigger for a table.

@param  string $table
@param  string $column
@param  string $triggerName
@param  string $sequenceName
@return bool
Function to create auto increment trigger for a table .