ORA-00928: missing SELECT keyword Laravel

First of all a great thanks to the contributors of Oracle Database Driver package https://github.com/yajra/laravel-oci8 for Laravel and making life easy for the developers who are developing applications on top of Laravel as framework and Oracle DB as the persistence layer.

The error 'ORA-00928: missing SELECT keyword' is possibly a result of the following scenarios.
1) You may be using resource controller and creating records using the 'create' method on model, i.e. Model::create.
2) You have already generated sequence number and passing it as a value to insert in the record.

To resolve the annoying error 'ORA-00928: missing SELECT keyword' while using Laravel with the Oracle Database Driver package, change the create method to insert, i.e. Model::insert($data);.


No comments:

Post a Comment