Oracle issues |
[eluser]iffs[/eluser]
First, good day to all! Now, let's go to business. I'm trying to create a simple application with CI, with 2 databases, one in Oracle, and the other in PostgreSQL. I've managed to successfully connect and perform queries to both databases, thanks to what I've found in these two posts: http://www.abbett.org/2007/12/02/using-o...deigniter/ http://ellislab.com/forums/viewthread/74105/ I've had issues with Oracle, returning an unnumbered error, then the errors listed in the first site, and finally errors with multiple queries. So the first question is: will all these changes apply to CI? Are they indeed correct? These changes worked fine for me. :lol: Another thing, now about encoding. Both of the databases have LATIN1 encoding. The code I used for testing follows: First, the Controller: Code: <?php Then, the view: Code: <html> And finally, my database connection settings: Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); Some results in my page are as follows: Gerencia de Conservac?o da Biodiversidade (SBF/DCBIO) Gerencia de Gest?o de Recursos Geneticos (SBF/DCBIO) Gerencia de Gest?o de Recursos Pesqueiros (SBF/DCBIO) SBF/DCBIO/PROBIO II - Projeto de Conservac?o e Uso Sustentavel da Biodiversidade e Ac?es Integradas, Publicas/Privadas para Biodiversidade (SBF/DCBIO) It does not matter which browser encoding I choose, the ? characters still appear. Can you help me with this one? Thanks to all, and happy coding!! Igor Felix
[eluser]unficyp[/eluser]
hi, i'm not sure what CI does with $db['seguranca']['char_set'] = "latin1"; $db['seguranca']['dbcollat'] = "latin1_general_ci"; to set a proper Oracle NLS Environment. Try setting NLS_LANG=.... at your apache startup script or try putenv("NLS_LANG=...."); in your php code. Which Oracle Version do you use ? Which nls setting does the database have ? (select * from v$nls_parameters)
[eluser]iffs[/eluser]
Thanks a lot!! =) I've set NLS_LANG to putenv("NLS_LANG=american_america.WE8ISO8859P1"); And everything worked just fine!! :lol: God, I wish I could convince everyone here at work to use CI!! It's just like natural programming, much much better than the framework we use here... Again, thanks!! Igor Felix
[eluser]Weblizard[/eluser]
Well I don't want to dig this up but : both db_connect AND db_pconnect method of oci8_driver missed 4th parameter (charset) and if you are using Oracle 9.2+ you MUST set charset to something sensible so here is my 2 cents edit CI_root/database/drivers/oci8/oci8_drive.php around line 73 change this: Code: return @ocilogon($this->username, $this->password, $this->hostname); Code: return @ocilogon($this->username, $this->password, $this->hostname, $this->char_set); Now you can set your NLS lang under CI_root/config/database.php something like this for utf8 Code: $db['default']['char_set'] = "al32utf8"; |
Welcome Guest, Not a member yet? Register Sign In |