Closed apit closed 8 years ago
@apit thanks for the PR. Can you please provide some snippet on how to test this?
CREATE TABLE test_maintable(
name nvarchar2(100),
kind nvarchar2(8)
)
/
INSERT INTO test_maintable VALUES ('lorem ipsum', 'A');
INSERT INTO test_maintable VALUES ('dolores anum', 'A');
INSERT INTO test_maintable VALUES ('lazy fox', 'B');
CREATE OR REPLACE FUNCTION func_test_refcursor(k in nvarchar2)
RETURN SYS_REFCURSOR AS
rc SYS_REFCURSOR;
BEGIN
OPEN rc FOR select * from test_maintable where kind=k;
RETURN rc;
END;
/
-> % ./artisan tinker
Psy Shell v0.7.2 (PHP 5.6.21 — cli) by Justin Hileman
>>> $rows = DB::select('select func_test_refcursor(:kind) as rc from dual', [':kind'=>'A']);
>>> // Expected/with this patch
=> [
{#817
+"name": "lorem ipsum",
+"kind": "A",
},
{#818
+"name": "dolores anum",
+"kind": "A",
}
]
>>> // Actual result
=> [
{#812
+"rc": oci8 statement resource #521,
},
]
Thanks a lot @apit. Merged and released on v1.0.5.
in laravel-oci8, DB::select() of function returning SYS_REFCURSOR will returns