OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.3.5

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.3.5
    iconOceanBase Database
    SQL - V 4.3.5
    SQL
    KV
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    OPEN_CONNECTION

    Last Updated:2026-04-09 02:53:56  Updated
    share
    What is on this page
    Syntax
    Parameters
    Return value
    Considerations

    folded

    share

    OPEN_CONNECTION is used to establish a TCP or IP connection with the specified service.

    Applicability

    This content applies only to the Oracle-compatible mode of OceanBase Database.

    Syntax

    UTL_TCP.OPEN_CONNECTION  (
       remote_host          IN VARCHAR2,
       remote_port          IN PLS_INTEGER,
       local_host           IN VARCHAR2 DEFAULT NULL,
       local_port           IN PLS_INTEGER DEFAULT NULL,
       in_buffer_size       IN PLS_INTEGER DEFAULT NULL,
       out_buffer_size      IN PLS_INTEGER DEFAULT NULL,
       charset              IN VARCHAR2 DEFAULT NULL,
       newline              IN VARCHAR2 DEFAULT CRLF,
       tx_timeout           IN PLS_INTEGER DEFAULT NULL,
       wallet_path          IN  VARCHAR2 DEFAULT NULL,
       wallet_password      IN  VARCHAR2 DEFAULT NULL, 
      RETURN connection;
    

    Parameters

    Parameter Description
    remote_host The name of the host to connect to. If NULL, an error is returned.
    remote_port The port number on which the service listens for connections.
    local_host The name of the host that the service is provided to. (Reserved field)
    local_port The port number on which the service listens for connections. (Reserved field)
    in_buffer_size Size of the input buffer (in bytes). A value of 0 indicates that no buffer is used, while NULL indicates that the buffer size has not been explicitly set and is controlled by the operating system. The maximum buffer size is 32767 bytes.
    out_buffer_size The size of the output buffer in bytes. A value of 0 specifies not to use a buffer. A value of NULL specifies not to explicitly set a buffer size, and the operating system controls the size. The maximum buffer size is 32,767 bytes.
    charset The character set for data transmission. The character set is converted during data transmission.
    newline A line break. It will be added after the text line that is sent by the write_line method.
    tx_timeout The wait time (in seconds) for read and write operations on a connection established using the UTL_SMTP package before a timeout occurs. In a read operation, if no data is immediately available for reading, this package times out. In a write operation, if the output buffer is full and data cannot be sent to the network without being blocked, this package times out. The value 0 specifies not to wait, and the value NULL specifies to wait indefinitely.
    wallet_path This parameter is currently not supported. If not specified, it defaults to NULL.
    wallet_password This field is currently not supported. If not specified, it defaults to NULL.

    Return value

    Return value Description
    connection A TCP/IP connection to the service.

    Considerations

    • A maximum of 16 connections can be opened in the same session.
    • Connections opened with open_connection must be explicitly closed. These are session-level resources and cannot be used across sessions. All connections for the current session will be closed when the session is disconnected.
    • remote_host can be an IP address or a URL, which will be internally converted.
    • local_host and local_port are reserved fields. They are ignored when establishing a TCP/IP connection. In the returned connection variable, these two fields are set to NULL.

    Previous topic

    Overview of UTL_TCP
    Last

    Next topic

    CLOSE_CONNECTION
    Next
    What is on this page
    Syntax
    Parameters
    Return value
    Considerations