From 1676751a45ea77d2962750e20cec5bde5a06e6ab Mon Sep 17 00:00:00 2001 From: Sudheert7 <140300710+Sudheert7@users.noreply.github.com> Date: Thu, 5 Sep 2024 16:07:51 +0300 Subject: [PATCH 1/2] fix #882 --- src/Oci8/Schema/Sequence.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Oci8/Schema/Sequence.php b/src/Oci8/Schema/Sequence.php index f57363c3..1cab8d81 100644 --- a/src/Oci8/Schema/Sequence.php +++ b/src/Oci8/Schema/Sequence.php @@ -122,7 +122,7 @@ public function nextValue($name) $name = $this->wrap($name); - return $this->connection->selectOne("SELECT $name.NEXTVAL as \"id\" FROM DUAL")->id; + return $this->connection->selectOne("SELECT '$name.NEXTVAL' as \"id\" FROM DUAL")->id; } /** @@ -151,6 +151,6 @@ public function lastInsertId($name) $name = $this->wrap($name); - return $this->connection->selectOne("select {$name}.currval as \"id\" from dual")->id; + return $this->connection->selectOne("select '{$name}.currval' as \"id\" from dual")->id; } } From 3597bf4f4000e4d4e0d2a7a2354081e7b906b1eb Mon Sep 17 00:00:00 2001 From: Sudheert7 <140300710+Sudheert7@users.noreply.github.com> Date: Sun, 8 Sep 2024 08:54:56 +0300 Subject: [PATCH 2/2] Update Sequence.php --- src/Oci8/Schema/Sequence.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Oci8/Schema/Sequence.php b/src/Oci8/Schema/Sequence.php index 1cab8d81..a90bb9e6 100644 --- a/src/Oci8/Schema/Sequence.php +++ b/src/Oci8/Schema/Sequence.php @@ -151,6 +151,6 @@ public function lastInsertId($name) $name = $this->wrap($name); - return $this->connection->selectOne("select '{$name}.currval' as \"id\" from dual")->id; + return $this->connection->selectOne("select {$name}.currval as \"id\" from dual")->id; } }