Re: [GENERAL] argument of CASE/WHEN must not return a set

2014-01-10 Thread Sameer Kumar
On Fri, Jan 10, 2014 at 12:02 AM, George Weaver wrote: > Thanks David, > > I found that if the whole expression is made a sub-select it works: > I too eventually got there. :-) Check the plan for two queries that you have. Best Regards, *Sameer Kumar | Database Consultant* *ASHNIK PTE. LTD.

Re: [GENERAL] argument of CASE/WHEN must not return a set

2014-01-09 Thread George Weaver
- Original Message - From: David Johnston >The condition (WHEN) in a case cannot be a set. You have to make the >expression always resolve to a single row/value. >I'd suggest creating a regexp_matches_single(...) function that calls >regexp_matches(...) in a sub-select so that no matc

Re: [GENERAL] argument of CASE/WHEN must not return a set

2014-01-09 Thread David Johnston
Sameer Kumar wrote > On Thu, Jan 9, 2014 at 1:26 AM, George Weaver < > gweaver@ > > wrote: > >> ARRAY_TO_STRING( REGEXP_MATCHES('12-70510','^[0-9,0-9.0-9]+') >> development(# , ',') > > > I guess this part of your statement will return 1,2, which is a set > >

Re: [GENERAL] argument of CASE/WHEN must not return a set

2014-01-09 Thread Sameer Kumar
On Thu, Jan 9, 2014 at 6:05 PM, Sameer Kumar wrote: > > On Thu, Jan 9, 2014 at 1:26 AM, George Weaver wrote: > >> ARRAY_TO_STRING( REGEXP_MATCHES('12-70510','^[0-9,0-9.0-9]+') >> development(# , ',') > > > I guess this part of your statement will return 1,2, whic

Re: [GENERAL] argument of CASE/WHEN must not return a set

2014-01-09 Thread Sameer Kumar
On Thu, Jan 9, 2014 at 1:26 AM, George Weaver wrote: > ARRAY_TO_STRING( REGEXP_MATCHES('12-70510','^[0-9,0-9.0-9]+') > development(# , ',') I guess this part of your statement will return 1,2, which is a set Can you try below: SELECT CASE WHEN LEN

[GENERAL] argument of CASE/WHEN must not return a set

2014-01-08 Thread George Weaver
Good morning, I've have solved my problem in another way, but I am curious as to why I am getting the following error. The following returns a boolean value a expected: development=# SELECT LENGTH(ARRAY_TO_STRING( REGEXP_MATCHES('12-70510','^[0-9,0-9.0-9]+') development(#