October 23, 2024
Chicago 12, Melborne City, USA
SQL

Oracle UTL_TCP write text works but read text does not


All,

I am working on a procedure that uses the oracle package UTL_TCP to write data and then try to read data from it. I am able to call the write_text message but it will not compile using the read_text, get_line methods of UTL_TCP,etc.

I am not familiar with the installation of UTL_TCP on oracle but it is almost as if it was installed or configured to only allow writing and not reading of data.

If anyone has any insights into this that would be greatly appreciated.

Thanks

  -- Open connection to Eyecon device WORKS
  v_eyecon_connection := UTL_TCP.open_connection(v_eyecon_ipaddress, v_eyecon_port);

  -- Send the message WORKS
  v_eyecon_bytes_written := UTL_TCP.write_text(v_eyecon_connection, v_eyecon_message);

  -- Read the response from Eyecon DOES NOT COMPILE
  --UTL_TCP.set_timeout(v_eyecon_connection, 10000); set timout (in ms)
  --UTL_TCP.read_text(v_eyecon_connection, v_eyecon_response, 4000);
  v_eyecon_response := '';
  LOOP
    -- Fetch each line of the response. DOES NOT COMPILE
    UTL_TCP.get_line(v_eyecon_connection, v_response_line, TRUE);
    v_eyecon_response := v_eyecon_response || v_response_line;
    EXIT WHEN v_response_line IS NULL;  
  END LOOP;



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video