Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: formatting column in sql

Re: formatting column in sql

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Thu, 14 Oct 2004 19:49:38 +0200
Message-ID: <416ebbc9$0$29522$636a15ce@news.free.fr>

"root" <root_at_aol.com> a écrit dans le message de news:u9ybd.30339$QJ3.29048_at_newssvr21.news.prodigy.com...
>
> Im tring to set a column format for a rather large column.
>
> COLUMN '<AHREF="REPORT'||SYSDATE||'.HTML#'||A.US_ID||'">' HEADING link
>
>
> select '<a href="report'||sysdate||'.html#'||a.us_id||'">', a.first_name||'
> '||a.last_name||'</a>',
> a.phone_area||'-'||a.phone_exchange||'-'||a.phone_line, b.vaccination_date,
> c.name, d.occupation_desc||'<br>'
> from patients a, vaccines b, organizations c, occupations d,
> pat_adult_info e
> where e.us_id = a.us_id and e.occupation_code = d.occupation_code(+) and
> c.org_id(+) = b.refer_org_id and a.patient_id = b.patient_id and
> b.vaccine_code = 75;
>
> is the query but the first returns
>
> SQL> COLUMN '<A HREF="REPORT'||SYSDATE||'.HTML#'||A.US_ID||!'">' HEADING
> link
> SP2-0735: unknown COLUMN option beginning "||SYSDATE|..."
>
> I tried setting the escape to '/' and then putting that in front of all the
> ' in the column command but that doesn't seem to work, any ideas?
>
>
> TIA
>
>

Use an alias for the column expression in your query:

http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1007781 http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_103a.htm#2126858

Regards
Michel Cadot Received on Thu Oct 14 2004 - 12:49:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US