zoukankan      html  css  js  c++  java
  • [转]:在oracle中通过utl_http获得指定网页内容,支持中文

    直接使用oracle中提供的包来实现读取指定页面的内容。

    例如:
    SET serveroutput ON SIZE 40000

    DECLARE
    req utl_http.req;
    resp utl_http.resp;
    value VARCHAR2(1000);
    BEGIN

    req := utl_http.begin_request('http://www.5ienet.com/online.asp');
    resp := utl_http.get_response(req);
    LOOP
    utl_http.read_line(resp, value, TRUE);
    dbms_output.put_line(value);
    END LOOP;
    utl_http.end_response(resp);
    EXCEPTION
    WHEN utl_http.end_of_body THEN
    utl_http.end_response(resp);
    END;


    怎么样,是不是结果已经出来了,哎,不对怎么中文字符都显示成了乱码,呵呵,别急,将下面这行代码加在resp:=那行之前再试试。
    utl_http.set_header(req, 'Content-Type', 'text/html; charset=gb2312');

  • 相关阅读:
    Cocos2d-html5 笔记2: director
    Cocos2d html5 笔记 1: overview
    Device Pixel Ratio & Media Queries
    Viewport
    Viewport解决分辨率适配问题
    Ajax缓存解决办法
    capitalize()
    chr() 、ord()
    oct()
    eval()
  • 原文地址:https://www.cnblogs.com/vigarbuaa/p/2660633.html
Copyright © 2011-2022 走看看