[bugs] [Bug 1060] New - oracle and probably other database problem

bugs@bugs.horde.org bugs@bugs.horde.org
Fri, 27 Sep 2002 15:40:36 -0300


http://bugs.horde.org/show_bug.cgi?id=1060

*** shadow/1060	Fri Sep 27 15:40:36 2002
--- shadow/1060.tmp.26365	Fri Sep 27 15:40:36 2002
***************
*** 0 ****
--- 1,32 ----
+ Bug#: 1060
+ Product: Horde
+ Version: other
+ Platform: PHP Code
+ OS/Version: All
+ Status: NEW   
+ Resolution: 
+ Severity: critical
+ Priority: P2
+ Component: Core
+ Area: BUILD
+ AssignedTo: chuck@horde.org                            
+ ReportedBy: jluis@ciudad.com.ar               
+ URL: 
+ Summary: oracle and probably other database problem
+ 
+ I've found in hordebase/lib/Prefs/sql.php that you are using 
+ DB_FETCHMODE_ASSOC to fetch rows. This has a problem on Oracle and maybe other 
+ databases too: when you do a "select column1,column2..." the result columns 
+ are COLUMN1, COLUMN2, etc (in uppercase). So if you reference a column as $row
+ ['column1'], it will not bring the expected value. I think the best solution 
+ would be to add alias to the columns in the select: 'select column1 "column1", 
+ column2 "column2" '... The " must be in the query, if not Oracle will return 
+ the column alias in uppercase. This does not affect mysql and I think that 
+ will not affect others database either.
+ This approach should be used on every select done in DB_FETCHMODE_ASSOC. I'm 
+ using imp & turba also, but haven't had a problem with them, as I found no 
+ query with this issue.
+ This is my first bug report! Hope someone can answer me if you receive this.
+ Glad to help and good job everyone!!
+ Jose Luis
+ jluis@ciudad.com.ar