laravel-oci8
laravel-oci8 copied to clipboard
Problem with a table of many records
Summary of problem or feature request
I'm doing a query to an Oracle Oracle 11g using Eloquent works when I take a single record, try to do the test with 10 and the browser remains in standby mode, in the end no error but does not give an answer, under the service and attempt to new taking 1 and it does not work, it is as if you were running the process even after restarting the server.
Code
Operation::take(1) = select * from (select * from "OPERATION") where rownum = 1 - OK Operation::take(2) or more = select t2.* from ( select rownum AS "rn", t1.* from (select * from "OPERATION") t1 ) t2 where t2."rn" between 1 and 2 - PROBLEM
System details
- Windows 10
- PHP 7.3.1
- Laravel 5.6
- Laravel-OCI8 8.0
Seems working for me. Might be an issue on your database lock?
>>> DB::table('studies')->take(1)->get();
=> Illuminate\Support\Collection {#4133
all: [
{#4121
+"id": "1",
+"exclude_study_number": "C94043-01",
},
],
}
>>> DB::table('studies')->take(2)->get();
=> Illuminate\Support\Collection {#4124
all: [
{#4123
+"rn": "1",
+"id": "1",
+"exclude_study_number": "C94043-01",
},
{#4125
+"rn": "2",
+"id": "2",
+"exclude_study_number": "C94043-02",
},
],
}
>>>
>>> DB::table('studies')->take(2)->toSql();
=> "select t2.* from ( select rownum AS "rn", t1.* from (select * from "STUDIES") t1 ) t2 where t2."rn" between 1 and 2"
>>> DB::table('studies')->take(1)->toSql();
=> "select * from (select * from "STUDIES") where rownum = 1"
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.