BD: Oracle 11g r2
A great challenge is being for me.
How can I return a specific value within the query (html) with output at: dbms_output
DBMS_Output
...
<td colspan = "5"> <b> <h3> <center> Basic Consultation of the ICMS Registry of Bahia </center> </h3> </b> </td>
...
I would like to return only the amount below.
Expected result:
Consulta Básica ao Cadastro do ICMS da Bahia
Como retornar somente este valor na consulta?
Query PLSQL / Mateus Ribeiro.sql
declare
req utl_http.req;
res utl_http.resp;
url varchar2(4000) := 'http://www.sefaz.ba.gov.br/scripts/cadastro/cadastroBa/result.asp';
name varchar2(4000);
DADOS varchar2(4000);
content varchar2(4000) := 'CGC=13504675000110&B1=CNPJ++-%3E&CPF=&IE=';
begin
req := utl_http.begin_request(url, 'POST',' HTTP/1.1');
--utl_http.set_header(req, 'user-agent', 'mozilla/4.0');
utl_http.set_header(req, 'content-type', 'application/x-www-form-urlencoded');
utl_http.set_header(req, 'Content-Length', length(content));
utl_http.write_text(req, content);
res := utl_http.get_response(req);
begin
loop
utl_http.read_text(res, DADOS);
dbms_output.put_line(DADOS);
end loop;
utl_http.end_response(res);
exception
when utl_http.end_of_body then
utl_http.end_response(res);
end;
end;
