CodeIgniter Forums

Full Version: solution to using database functions with oracle
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
when using codeigniter functions with oracle we will have problem that it will add ( " )  to table names

{EDITED - Your original post promoted a nono}

An external suggestion was to change the escape character, but that would mean modifying a core CodeIgntier file, which is not an acceptable practice.
In CI 3.0 that variable is protected, so that we cannot change it from application... any other solution?

Ref: https://github.com/bcit-ci/CodeIgniter/issues/3757
try to use capital letters in table names
for example :
dont write
PHP Code:
// dont write 
$this->db->get('employee'); 
but write
PHP Code:
// but write
$this->db->get('EMPLOYEE'); 

and the same for columns name
DO NOT EVER SUGGEST MANUAL MODIFICIATIONS OF THE FRAMEWORK'S FILES!
(04-14-2015, 11:38 AM)Bassam Wrote: [ -> ]try to use capital letters in table names
for example :
dont write

PHP Code:
// dont write 
$this->db->get('employee'); 
but write

PHP Code:
// but write
$this->db->get('EMPLOYEE'); 

and the same for columns name

This is not a good idea unless they were defined this way to begin with. SQL keywords are case-insensitive, but long-standing convention means most people use all-caps for them. The same convention usually defines table and column names in all-lowercase, making it easier to distinguish the difference in raw SQL. However, whether table and column names are case-sensitive is sometimes a configurable option, and, therefore, may change from one environment to the next.

For these reasons, the most important thing to remember is to be consistent with your table and column names. Never suggest to someone that they should change the case of these names in their code unless there is evidence that they have been inconsistent.