把时间戳之差转换成时分秒格式
WITH a AS (SELECT to_timestamp('2010-7-7 11:11:11', 'yyyy-mm-dd hh24:mi:ss') - to_timestamp('2010-7-5 12:12:12', 'yyyy-mm-dd hh24:mi:ss') inter FROM dual)SELECT inter, extract(DAY FROM inter), extract(hour FROM inter), extract(minute FROM inter), extract(SECOND FROM inter) FROM a;其他参考:http://xsb.itpub.net/post/419/52334[@more@]
使用utl_http获取某个http页面内容
set head off set feed offset termout offset serveroutput onspool d:test.htmlDECLAREreq utl_http.req;resp utl_http.resp;VALUE VARCHAR2(4000);[@more@]BEGINreq := utl_http.begin_request('http://www.5ienet.com/online.asp');utl_http.set_header(req, 'Content-Type', 'text/html; charset=gb2312');resp := utl_http.get_response(req);dbms_output.enable(1000000);LOOPutl_http.read_line(resp, VALUE, TRUE);dbms_output.put_line(VALUE);END LOOP;utl_http.end_response(resp);EXCEPTIONWHEN utl_http.end_of_body THENut