Re: URL encoding for links w/ PL/SQL

From: frank <fbortel_at_home.nl>
Date: Wed, 27 Sep 2000 18:21:50 GMT
Message-ID: <39D238E3.C418654F_at_home.nl>


Found it:
it's in privht, special functions dept... <quote>
/* SPECIAL FUNCTIONS */
function escape_sc(ctext in varchar2) return varchar2 IS

begin return(replace(
             replace(
             replace(
             replace(ctext, '&', AMP),
                            '"', QUOT),
                            '<', LT),
                            '>', GT));

end;

function escape_url(p_url in varchar2) return varchar2 is begin

        return replace(escape_sc(p_url), '%', '%25'); end;
/* END SPECIAL FUNCTIONS */
</quote>
privht is part of what's now called The PL/SQL Web Toolkit. Can (a.o) be found in iAS.

Frank wrote:

> There *is* no equivalent.
> Unless you write one, or use an existing package...
> The web development packages (htp, htf, owa...) came with one, that
> was called escape_url
> --
> Frank
> Joseph Ranseth <jranseth_at_worldNO_SPAMcupfishing.com> schreef in
> berichtnieuws 70Oz5.2302$fU3.55994_at_news1.mts.net...
> > How do I format a string variable to be used as an URL?
> >
> > I have some string values containing spaces and ampersands, and they don't
> > create the proper links. ie: the following produces a result that does
 not
> > work.
> > value = "Big & Burly"
> > htp.prn("/my_page?in_value='||value);
> > creates link "/my_page?in_value=Big & Burly", which passes an incoming
> > parameter of "Big " as the & character seperates values in an URL.
> >
> > I know ASP uses a URLEncode function. What is the equivalent in PL/SQL?
> >
> > --
> > Joseph Ranseth - Webmaster
> > World Cup Fishing
> > http://www.worldcupfishing.com
> >
> >
Received on Wed Sep 27 2000 - 20:21:50 CEST

Original text of this message