Re: Complex find() using Oracle

2010-02-18 Thread Tony Fugere
Do I post those here? If so, here goes... I only have time for a quick test case /** * test that fields() will accept objects made from DboSource::expression * * @return void */ function testFieldsWithExpression() { $expression =& $this->testDb->expression("SUM(DECODE(SUBSTR(Sample

Re: Complex find() using Oracle

2010-02-18 Thread Martin Radosta
I would only change: $this->find('all', array('fields' => $fields,...etc, etc.) Would be great if you post the test case (or even better, a patch) to avoid other people waste time with the same issue. Bye MARTIN On 02/18/2010 05:39 PM, Tony Fugere wrote: It does not fix the problem. Am I

Re: Complex find() using Oracle

2010-02-18 Thread Tony Fugere
It does not fix the problem. Am I doing it correctly? $dbo = $this->getDataSource(); $expression = $dbo->expression('SUM(DECODE(SUBSTR(ServiceData.stat_parameter,22), \'service1\', ServiceData.stat_value,0)) AS "ServiceData.service1"'); $fields = array('ServiceData.stat_date', $ex

Re: Complex find() using Oracle

2010-02-18 Thread Martin Radosta
Check the text case in this commit for an example: http://github.com/cakephp/cakephp1x/commit/02330b2d9c292110240c606e976e182c973897e9 let me know if that fix the problem, if not, you can prepare a test case and report the issue. On 02/18/2010 03:21 PM, TonyFugere wrote: I don't follow wha

Re: Complex find() using Oracle

2010-02-18 Thread TonyFugere
I don't follow what you mean by "Try using expression for fields." Can you clarify or give me an example? On Feb 18, 11:12 am, Martin Radosta wrote: > CakePhp is not correctly parsing the alias for the decode fields, thats > why you see decode... on array keys. > Try using expression for fields.

Re: Complex find() using Oracle

2010-02-18 Thread Martin Radosta
CakePhp is not correctly parsing the alias for the decode fields, thats why you see decode... on array keys. Try using expression for fields. If that works, should also fix the data missmatch. Regards MARTIN On 02/18/2010 02:38 PM, TonyFugere wrote: I've search this group and Google for a

Complex find() using Oracle

2010-02-18 Thread TonyFugere
I've search this group and Google for a solution without any luck. I can read (SELECT) data, but cannot change this database at all. To get the data I run the following find: $this->find('all', array( 'fields' => array( 'ServiceData.stat_date', 'SUBSTR(ServiceData.stat_parameter