Re: WebDB: create a link in SQL-based report

From: Jim Lewis <pojpl_at_ais.ucla.edu>
Date: 2000/05/30
Message-ID: <8h1cu9$cfb$1_at_carroll.library.ucla.edu>#1/1


Thank you for your help Leo, and I'm sorry to be so dense, but I am unable to figure out just how to code this.

For example, if the SQL is:

select org, dept, sum(amount)
from org_tb
where org = :org_parm
group by org, dept
order by org

and we would like to make the value for the org column a link to another report (say "rpt_org_02") which accepts the value in the org cell as a parm, how would I change the SQL above to include the code for a link?

Just to test it with a simple link I've tried something like:  

select org '<A HREF=http://www.mysite.edu ></A>', dept, sum(amount) from org_tb
where org = :org_parm
group by org, dept
order by org

but it results in errors when WebDB tries to parse it. It looks like the single quotes around the '<A ..... </A>' might be a problem.

Jim

"Leo Van Nieuwenhuyse" <leo.van.nieuwenhuyse_at_pandora.be> wrote:

>You can create the hyperlink in your select statement:
 

>example: you can make link on reports
>In the sql-clause put your link in the following way:
 

>Select empno,
>'<A
>HREF=yourscheme.yourpackage.yourprocedure?p_request=yourrequest&p_arg_names=
>yourparameters&p_arg_values=' || empno ||'>||ename||'</A>' the_link
>from emp
 

>Of course this is an example, you can replace the
>yourscheme.yourpackage.yourprocedure?p_request=yourrequest&p_arg_names=yourp
>arameters&p_arg_values=' || empno ||'>||ename||'
>by other url's such as 'http://www.oracle.com/support'.
 

>Better practice is to put such a things in a package containing functions:
>What we did is 1 package called 'hyperlink' with several functions (1 per
>link we want to use).
 

>Afterwards you can use the function in the select clause wich makes the
>query more readable, and of course you can re-use the function on other
>places.
 

>example:
 

>Select empno,
> hyperlink.yourfunction(empno,ename)
>from emp
 

>And you can even make a view out of this select!

>true">Diagn.</A>
>Jim Lewis <pojpl_at_ais.ucla.edu> schreef in berichtnieuws
>8h12k0$62d$1_at_carroll.library.ucla.edu...
>> It is easy in WebDB, if you use the "Query Wizard", to build a report
>> that can link from a column cell value to some other report, passing
>> the value in that cell to the new report.
>>
>> Unfortunately, in order to be able to use "sum(x)" and "group by"
>> statements in the SQL for a report, we have had to use the "Report
>> from SQL Query" method of creating our WebDB reports since "sum()" and
>> "group by()" are not made available by the "Query Wizard". But we
>> still need to be able to link from a column cell value to another
>> report ("drill-down").
>>
>> Does anyone know if a link can be used in a "Report from SQL Query"
>> type of WebDB report? If so, just how can this be coded?
>>
>>
>>
    Received on Tue May 30 2000 - 00:00:00 CEST

Original text of this message