protected function processInsertGetIdForOdbc(Connection $connection)
    {
        $result = $connection->selectFromWriteConnection(
            'SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS int) AS insertid'
        );

        if (! $result) {
            throw new Exception('Unable to retrieve lastInsertID for ODBC.');
        }

        $row = $result[0];

        return is_object($row) ? $row->insertid : $row['insertid'];
    }
protected function processInsertGetIdForOdbc(Connection $connection)
    {
        $result = $connection->selectFromWriteConnection(
            'SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS int) AS insertid'
        );

        if (! $result) {
            throw new Exception('Unable to retrieve lastInsertID for ODBC.');
        }

        $row = $result[0];

        return is_object($row) ? $row->insertid : $row['insertid'];
    }
protected function processInsertGetIdForOdbc ( Connection $ connection ) { $ result = $ connection -> selectFromWriteConnection ( 'SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS int) AS insertid' ) ; if ( ! $ result ) { throw new Exception ( 'Unable to retrieve lastInsertID for ODBC.' ) ; } $ row = $ result [ 0 ] ; return is_object ( $ row ) ? $ row -> insertid : $ row [ 'insertid' ] ; }
Process an "insert get ID" query for ODBC.

@param  \Illuminate\Database\Connection  $connection
@return int

@throws \Exception
Process an insert get ID query for ODBC .