GET_TEXT returns the text data that is read.
Applicability
This content applies only to the Oracle-compatible mode of OceanBase Database.
Syntax
UTL_TCP.GET_TEXT (
c IN OUT NOCOPY connection,
len IN PLS_INTEGER DEFAULT 1,
peek IN BOOLEAN DEFAULT FALSE)
RETURN VARCHAR2;
Parameters
| Parameter | Description |
|---|---|
| c | The TCP/IP connection. |
| len | The number of characters to receive. The default value is 1. |
| peek | When peek is set to true, the data is viewed but not removed from the input queue (requires the existence of an input buffer). |
Return value
The return value is the content of the text line that is read.
Considerations
- The connection must have been previously opened using
open_connection. - Unless explicitly overridden, the buffer size is measured in bytes, while the parameter
lenspecifies the maximum number of characters to be read. You should ensure that the buffer size is large enough to hold at least one character. Typically, the buffer size should be set to the number of characters to be read * the maximum bytes per character. - The message text is converted from the online character set specified when the connection was opened to the database character set before being returned.
- If a transfer timeout was set when opening the connection, this function will continue waiting to read packets until the timeout occurs. It will stop reading and return all successfully read data. If no data is successfully read, a
transfer_timeoutexception will be raised.