function - order by clause with concatenated string in oracle 11 -


i getting below error while using order clause on concatenated column.

"inconsistent datatypes: expected - got clob"

function:

create or replace function list_pnum (cid  in number) return clob        l_text clob := null; begin    cur_rec in (select c.e_device customer_pcn a, cp_device b, et_device c a.c_id = cid , a.cp_id = b.cp_id , b.et_device_id=c.et_device_id , rownum <= 250 order c.e_device )    loop           l_text := l_text || ',' || cur_rec.e_device;     end loop;     return ltrim(l_text, ',');   end list_pnum; 

view:

create or replace view "myview" ("p_id", "e_device")  select p.p_id, list_pnum(c.customer_id) e_device        table .....  condition; 

select statement:

select p_id, e_device myview order e_device desc; 

error:

"inconsistent datatypes: expected - got clob"


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -