Closed Aminot1 closed 9 years ago
Actually I just tried it with Laravel 4, used "laravel-admin-template-master", connected to same Oracle server and got same error. I'm starting to think something is wrong on my side, PHP configurations or Oracle settings? I'm using xampp v3.2.1, PHP 5.5 x86 ts, Windows 7 x64.
Could use some help.
I am working on a Laravel 5 starter template and having no issue like this. So I assume that the error must be something on your configurations. Can you please attach here the error stack trace so we can further check.
Should I take a screen shot of this ?
Error Code : 904 Error Message : ORA-00904: "EMAIL": invalid identifier Position : 28 Statement : insert into wts_user (name, email) values (:autoparam0, :autoparam1) returning id into :autoparam2 Bindings : []
PHP Info
oci8 OCI8 Support enabled OCI8 DTrace Support disabled OCI8 Version 2.0.8 Revision $Id: f04114d4d67cffea4cdc2ed3b7f0229c2caa5016 $ Oracle Run-time Client Library Version 11.1.0.6.0 Oracle Compile-time Instant Client Version 11.1
Does the table created via migration or it was already existing? I think the column names defined in your table DDL uses double quotes and thus the column name would be case sensitive.
Check this thread: http://stackoverflow.com/questions/6027961/ora-00904-invalid-identifier
Tables already existed, but I just created another table with Navicat For Oracle, still same issue.
Even if I try to insert using Navicat, still requires the quotation around column names, any suggestions ? like contacting DB administrator, or playing with the code to add the quotes ?
Maybe you should contact your DBA and ask him why it is required to add quotes. I do not suggest adding quotes coz it will force you to always use raw query and Eloquent will not work as well.
Alright thanks mate :)
Your welcome. Please post here if you find the solution for future reference. Thanks!
Hi Yajra, finally figured out what was wrong, after my DBA took a look, it seemed that Oracles standard is to have column names in CAPS not small letter, i.e. NAME, EMAIL...etc. After changing tables fields all is working well, without the quotes around field name. Thanks a lot :dancers:
It's not a Framework/package issue, because even when column names were in small letter, Oracle's client (APEX) and Navicat required them to have quotes around them.
Although, FYI, I tried CodeIgniter v2 (latest stable version), connected it to Oracles and it automatically encapsulates fields names with double quotations.
Anyways thanks again mate :)
Great! I didn't know that Oracle can set standard for columns to be all CAPS. Thanks for the heads up!
Hello, I am using this package with Laravel 5 and Oracle 11.
The thing is, when I use the ORM, OracleElequent, and try to insert, I get Invalid Identifier around the field name itself, example:
$user = new User(); $user->name = 'Amin'; $user->save();
The query produced, and sent to Oracle is: "Insert into user(name) values('Amin'); And Oracle returns an error, invalid identifier NAME, meaning it wants 'name' instead of name.
Writing Raw queries works fine as long as I add the quotations myself, but Query Builder isn't easy to modify.
Can you please help ?