Home » Developer & Programmer » Forms » utl_http issue (Forms 10g (9.0.4))
utl_http issue [message #433537] Wed, 02 December 2009 19:45 Go to next message
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

Re: utl_http issue [message #433559 is a reply to message #433537] Thu, 03 December 2009 00:26 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
error saying function was returned without value

Well, it is possible to get that error because there's no RETURN clause in the EXCEPTION section. It seems that, although you have checked URL being passed to the function, Oracle disagrees with you.
Re: utl_http issue [message #437348 is a reply to message #433537] Sun, 03 January 2010 23:55 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have you solved your problem? How do you get out of the loop? Try displaying the 'url' before the 'begin_request'.

David
Re: utl_http issue [message #438684 is a reply to message #433537] Mon, 11 January 2010 14:43 Go to previous message
psmith8909@aol.com
Messages: 8
Registered: October 2006
Location: Las Vegas
Junior Member
Thanks, guys. I resolved my issue. I had a problem with some of the values I was replacing in the url.
Previous Topic: Need to get the Current Cursor postion - on What record (merged)
Next Topic: open image from application server
Goto Forum:
  


Current Time: Sat Dec 03 12:29:43 CST 2016

Total time taken to generate the page: 0.24024 seconds