utl_http issue [message #433537] |
Wed, 02 December 2009 19:45 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
psmith8909@aol.com
Messages: 8 Registered: October 2006 Location: Las Vegas
|
Junior Member |
|
|
We're attempting to use utl_http to run some jobs. Everything appears to be okay whenever we test using it with a hardcoded url. Whenever we modify the url before beginning the request, we get an error saying function was returned without value even though we have checked to make sure the proper url is being passed. Below is a sample of the code. Can anyone see anything I may be doing wrong? Thanks.
req utl_http.req;
resp utl_http.resp;
http_value VARCHAR2(1024);
url VARCHAR2(1024);
pos1 number;
pos2 number;
how_many number;
v_tochange varchar2(20);
BEGIN
pos1 := instr(p_url,'User=') + 5;
pos2 := instr(p_url,'&_ssoPass');
how_many := pos2 - pos1;
v_tochange := substr(p_url,pos1,how_many);
url := replace(p_url,v_tochange,p_user);
req := utl_http.begin_request(url);
utl_http.set_header(req, 'User-Agent', 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6; .NET CLR 1.1.4322; .NET CLR');
resp := utl_http.get_response(req);
LOOP
utl_http.read_line(resp, http_value, TRUE);
END LOOP;
utl_http.end_response(resp);
return 'True';
--return http_value;
EXCEPTION
WHEN utl_http.end_of_body THEN
utl_http.end_response(resp);
[EDITED by LF: applied [code] tags]
[Updated on: Thu, 03 December 2009 00:23] by Moderator Report message to a moderator
|
|
|
|
|
|