Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> POST a form in Oracle 8.1.7
I'm coding a function a document to a server using POST method.
ORA-06502: PL/SQL: numeric or value error: hex to raw conversion error
Can someone help me? I'm not a PL/SQL programmer.
Thanks a lot!
--Hugo
The code is:
CREATE OR REPLACE FUNCTION mypost (host varchar2, uri varchar2, content
clob)
RETURN CLOB
IS
conn utl_tcp.connection; rc integer; port integer := 80; CR constant varchar2(1) := chr(13); v_read_amount binary_integer; v_read_offset number; v_buffer varchar2(32767);
conn := utl_tcp.open_connection(remote_host => host, remote_port => port, charset => NULL );
dbms_output.put_line('connected');
rc := utl_tcp.write_line(conn, 'POST '||uri||' HTTP/1.0'); rc := utl_tcp.write_line(conn, 'Host: '|| host ); rc := utl_tcp.write_line(conn, 'Accept: text/*' ); rc := utl_tcp.write_line(conn, 'Accept-Charset: *' ); rc := utl_tcp.write_line(conn, 'Accept-Encoding:' ); rc := utl_tcp.write_line(conn, 'Content-Encoding: identity' ); rc := utl_tcp.write_line(conn, 'Content-Type:application/x-www-form-urlencoded');
dbms_output.put_line('Content-Length: '|| dbms_lob.getlength(content));
rc := utl_tcp.write_line(conn, '' );
utl_tcp.flush( conn );
v_read_amount := 32767;
v_read_offset := 1;
begin
loop
dbms_output.put_line('loop'); dbms_lob.read(content,v_read_amount,v_read_offset,v_buffer); rc := utl_tcp.write_line(conn,v_buffer ); v_read_offset := v_read_offset + v_read_amount;end loop;
END;
/
Received on Tue Jun 21 2005 - 06:05:48 CDT
![]() |
![]() |