Giter VIP home page Giter VIP logo

Comments (5)

yajra avatar yajra commented on July 17, 2024

first: Does your updates for 12c support will also work on lower versions of oracle?

second: Please submit a PR if you can. Don't have time yet to update the package unless we a have a big issue. thanks!

from laravel-oci8.

hamedmohammadi avatar hamedmohammadi commented on July 17, 2024

in file yajra/Oci8/Query/Grammars/OracleGrammar.php :

protected function compileTableExpression($sql, $constraint, $query)
{
    // mohammadi Edited
    //if oracle 12c
    return $sql;

    //if old versions
    if ($query->limit > 0) {
        return "select t2.* from ( select rownum AS \"rn\", t1.* from ({$sql}) t1 ) t2 where t2.\"rn\" {$constraint}";
    } else {
        return "select * from ({$sql}) where rownum {$constraint}";
    }
}

//and the following func was left empty :)
protected function compileLimit(Builder $query, $limit)
{
    return "FETCH NEXT $limit ROWS ONLY";
}

/**
* Compile the "offset" portions of the query.
*
* @param  \Illuminate\Database\Query\Builder  $query
* @param  int  $offset
* @return string
*/
protected function compileOffset(Builder $query, $offset)
{
    return "OFFSET $offset ROWS";
}

////////////////////////////////////////////////////////////////////////////////
// in file :vendor\laravel\framework\src\Illuminate\Database\Query\Grammars
protected $selectComponents = array(
        'aggregate',
        'columns',
        'from',
        'joins',
        'wheres',
        'groups',
        'havings',
        'orders',
        'offset',
        'limit',
        'unions',
        'lock',
    );

i've changed the order of offset and limit
:) ok?

from laravel-oci8.

yajra avatar yajra commented on July 17, 2024

Can you please create a pull request (PR) so i can test and review it on my side? Having a hard time reading the comments :) ... thanks!

from laravel-oci8.

hamedmohammadi avatar hamedmohammadi commented on July 17, 2024

okay but not now i will do that for tomorrow arjay i'm a bit busy :)

On Tue, Jul 15, 2014 at 10:33 AM, Arjay Angeles [email protected]
wrote:

Can you please create a pull request (PR) so i can test and review it on
my side? Having a hard time reading the comments :) ... thanks!


Reply to this email directly or view it on GitHub
#21 (comment).

from laravel-oci8.

yajra avatar yajra commented on July 17, 2024

I think this is not highly needed and I may not be able to work on this because I don't use 12c atm. But open to PR's in case someone wants to implement this. Thanks!

from laravel-oci8.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.