convert long to anything else (clob, varchar2) in select on the fly - help !!!

From: bzamfir <bzamfir_at_gmail.com>
Date: 14 Mar 2006 12:12:22 -0800
Message-ID: <1142367142.749294.284810_at_p10g2000cwp.googlegroups.com>



Hi,

I have query, which is used to generate the proper data to create a RSS (xml) file
My query is

select x.headline || ' ' || x.refno as title,

          p_base_url || 'wd_pds?p_web_page_id=' || x.web_page_id as weblink,

          to_lob(x.text) as descr            <------------------- THE
PROBLEM IS HERE
        from (
          select *
            from wd_web_pages
            where web_site_id = p_site_id
              and (

(refno is not null and p_pagetype='JOBS') or
p_pagetype='NEWS') and (
(category_id = p_job_categ_id and p_pagetype='JOBS') or

(category_id <> p_job_categ_id and p_pagetype='NEWS'))
and publish_status = 'A' and publish_to in ('BOTH','WWW') and trunc(sysdate) between trunc(date_on) and trunc(nvl(date_off,sysdate+1)) order by nvl(date_updated, current_date) desc ) x where rownum <= p_maxitems order by headline

The problem is text field is LONG, and get compile error at the line specified.
If I change field type to CLOB, all works perfectly, but the problem is [Quoted] the sistem is complex, and started long time ago, and I cannot change type to clob.
Does anyone knows how to handle that?

Thank you for all suggestions.

Regards,
Bogdan Received on Tue Mar 14 2006 - 21:12:22 CET

Original text of this message