Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle Reports URL error due to '&' character in password

Status
Not open for further replies.

MarawiCity

IS-IT--Management
Sep 21, 2009
1
0
0
US
Hope someone can help me on this issue. We are using Oracle Reports 6. We call the reports in the oracle forms, then before proceeding with the reports it will prompt you to enter useid and password.

If the users password contain reserved characters used in the URL such as '&' we encounter erros ("The requested URL is not found"). The userid and password is part of the URL that is why it is failing.

Please let me know if there is a work-around for this.
 
You need to URL-encode any special characters before including them in a URL. Here's a function to do that, taken from :
Code:
create or replace function urlencode( p_str in varchar2 ) return 
varchar2
as
        l_tmp   varchar2(12000);
        l_len   number default length(p_str);
        l_bad   varchar2(100) default ' >%}\~];?@&<#{|^[`/:=$+''"' || chr(10);
        l_char  char(1);
begin
        if ( p_str is NULL ) then
                return NULL;
        end if;

        for i in 1 .. l_len loop
                l_char :=  substr(p_str,i,1);
                if ( instr( l_bad, l_char ) > 0 )
                then
                        l_tmp := l_tmp || '%' || to_char(ascii(l_char), 'fm0X');
                else
                        l_tmp := l_tmp || l_char;
                end if;
        end loop;

        return l_tmp;
end;
/

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top