Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Setting timeout using UTL_HTTP

2835459Apr 6 2015 — edited Apr 9 2015

Hey guys,

I am facing an issue in setting timeout. Below is my code.

IF (cou > 0) THEN

          DECLARE

                l_url            VARCHAR2(256) ;

                l_http_request   UTL_HTTP.req;

                l_http_response  UTL_HTTP.resp;

                    l_url := hostname;

                        l_http_request  := UTL_HTTP.begin_request(l_url);

                     l_http_response := UTL_HTTP.get_response(l_http_request);

                  UTL_HTTP.end_response(l_http_response);

       IF l_http_response.status_code = 200  THEN

          xxx_proc('OK','success',0,0);

    ELSIF l_http_response.status_code in (401,403,500,503) THEN

          xxx_proc('error' || to_char(l_http_response.status_code) || 'error',0,0);

    ELSE

        xxx_proc('timeout','ERROR',0,0);

    END IF;

    END IF;

Actually if the server is not active i should hit timeout. i guess there is a function set_transfer_timeout in UTL_HTTP package. i would like to set it using that function. please help.

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 7 2015
Added on Apr 6 2015
8 comments
5,001 views