El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

DBE_OUTPUT

Updated on 2024-05-07 GMT+08:00
NOTE:

When DBE_OUTPUT.PUT_LINE is used to print the result obtained by the DBE_FILE.READ_LINE_NCHAR API, ensure that the UTF-8 character set encoding can be converted to the current database character set encoding. If the preceding conditions are met, the result can be properly output. DBE_OUTPUT.PRINT_LINE does not support this function.

Interface Description

Table 1 provides all interfaces supported by the DBE_OUTPUT package.

Table 1 DBE_OUTPUT

Interface

Description

DBE_OUTPUT.PRINT_LINE

Outputs the specified text with newline characters.

DBE_OUTPUT.PRINT

Outputs the specified text without newline characters.

DBE_OUTPUT.SET_BUFFER_SIZE

Sets the size of the output buffer. If the size is not specified, the buffer can contain a maximum of 20000 bytes. If the size is set to a value less than or equal to 2000 bytes, the buffer can contain a maximum of 2000 bytes.

DBE_OUTPUT.DISABLE

Disables the calling of PUT, PUT_LINE, NEW_LINE, GET_LINE and GET_LINES, and clears the output buffer.

DBE_OUTPUT.ENABLE

Enables the buffer, allows the calling of PUT, PUT_LINE, NEW_LINE, GET_LINE, and GET_LINES, and sets the buffer size.

DBE_OUTPUT.GET_LINE

Obtains a line of data from the buffer with a newline character as the boundary. The obtained data is not output to the client.

DBE_OUTPUT.GET_LINES

Obtains the character string of a specified number of lines in the buffer as a VARCHAR array. The obtained content is cleared from the buffer and is not output to the client.

DBE_OUTPUT.NEW_LINE

Places a line at the end of the buffer, places an end-of-line marker, and leaves a new line empty.

DBE_OUTPUT.PUT

Places an input string in the buffer without a newline character at the end. When the stored procedure ends, the line ending with the newline character is displayed.

DBE_OUTPUT.PUT_LINE

Places an input string in the buffer with a newline character at the end. When the stored procedure ends, the line ending with the newline character is displayed.

  • DBE_OUTPUT.PRINT_LINE

    The stored procedure PRINT_LINE writes a line of text carrying a line end symbol in the buffer. The function prototype of DBE_OUTPUT.PRINT_LINE is as follows:

    1
    2
    DBE_OUTPUT.PRINT_LINE (
    format IN VARCHAR2);
    
    Table 2 DBE_OUTPUT.PRINT_LINE interface parameters

    Parameter

    Description

    format

    Specifies the text that was written to the buffer.

  • DBE_OUTPUT.PRINT

    The stored procedure PRINT outputs the specified text to the front of the specified text without adding a newline character. The function prototype of DBE_OUTPUT.PRINT is as follows:

    1
    2
    DBE_OUTPUT.PRINT (
    format IN VARCHAR2);
    
    Table 3 DBE_OUTPUT.PRINT interface parameters

    Parameter

    Description

    format

    Specifies the text that was written to the specified text.

  • DBE_OUTPUT.SET_BUFFER_SIZE

    The stored procedure SET_BUFFER_SIZE sets the output buffer size. If the size is not specified, it contains a maximum of 20000 bytes. The function prototype of DBE_OUTPUT.SET_BUFFER_SIZE is as follows:

    1
    2
    DBE_OUTPUT.SET_BUFFER_SIZE (
    size IN INTEGER default 20000);
    
    Table 4 DBE_OUTPUT.SET_BUFFER_SIZE interface parameters

    Parameter

    Description

    size

    Sets the output buffer size.

  • DBE_OUTPUT.DISABLE

    The stored procedure DISABLE disables the calling of PUT, PUT_LINE, NEW_LINE, GET_LINE and GET_LINES, and clears the output buffer. The prototype of the DBE_OUTPUT.DISABLE function is as follows:

    1
    DBE_OUTPUT.DISABLE;
    
  • DBE_OUTPUT.ENABLE
    The stored procedure ENABLE enables the buffer, allows the calling of PUT, PUT_LINE, NEW_LINE, GET_LINE, and GET_LINES, and sets the buffer size. The prototype of the DBE_OUTPUT.ENABLE function is as follows:
    1
    2
    3
    DBE_OUTPUT.ENABLE (
        buffer_size IN INTEGER DEFAULT 20000
    );
    
    Table 5 DBE_OUTPUT.ENABLE parameters

    Parameter

    Description

    buffer_size

    Upper limit of the buffer size, in bytes. If buffer_size is set to NULL, the default value is used.

  • DBE_OUTPUT.GET_LINE

    The stored procedure GET_LINE obtains a line of data from the buffer with a newline character as the boundary. The obtained data is not output to the client. The prototype of the DBE_OUTPUT.GET_LINE function is as follows:

    1
    2
    3
    4
    DBE_OUTPUT.GET_LINE (
        line   OUT VARCHAR2,
        status OUT INTEGER
    );
    
    Table 6 DBE_OUTPUT.GET_LINE parameters

    Parameter

    Description

    line

    Indicates the obtained character string.

    status

    Indicates whether the calling is normal. If a character string is obtained, the value is 0. Otherwise, the value is 1.

  • DBE_OUTPUT.GET_LINES

    The stored procedure GET_LINES obtains the character string of a specified number of lines in the buffer as a VARCHAR array. The obtained content is cleared from the buffer and is not output to the client. The prototype of the DBE_OUTPUT.GET_LINES function is as follows:

    1
    2
    3
    4
    DBE_OUTPUT.GET_LINES (
        lines    OUT   VARCHAR[],
        numlines IN OUT INTEGER
    );
    
    Table 7 DBE_OUTPUT.GET_LINES parameters

    Parameter

    Description

    lines

    Outputs an array of multi-line strings read from the buffer.

    numlines

    Inputs the number of lines to be retrieved from the buffer. The output value is the number of lines actually retrieved. If the output value is less than the input value, there are no more lines in the buffer.

  • DBE_OUTPUT.NEW_LINE

    The stored procedure NEW_LINE places a line at the end of the buffer, places an end-of-line marker, and leaves a new line empty. The prototype of the DBE_OUTPUT.NEW_LINE function is as follows:

    1
    DBE_OUTPUT.NEW_LINE;
    
  • DBE_OUTPUT.PUT

    The stored procedure PUT places an input string in the buffer without a newline character at the end. When the stored procedure ends, the line ending with the newline character is displayed. The prototype of the DBE_OUTPUT.PUT function is as follows:

    1
    2
    DBE_OUTPUT.PUT (
        item IN VARCHAR2);
    
    Table 8 DBE_OUTPUT.PUT parameters

    Parameter

    Description

    item

    Character or string item to be placed in the buffer.

  • DBE_OUTPUT.PUT_LINE

    The stored procedure PUT_LINE places an input string in the buffer with a newline character at the end. When the stored procedure ends, the line ending with the newline character is displayed. The prototype of the DBE_OUTPUT.PUT_LINE function is as follows:

    1
    2
    DBE_OUTPUT.PUT_LINE (
        item IN VARCHAR2);
    
    Table 9 DBE_OUTPUT.PUT_LINE parameters

    Parameter

    Description

    item

    Character or string item to be placed in the buffer.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
BEGIN
    DBE_OUTPUT.SET_BUFFER_SIZE(50);
    DBE_OUTPUT.PRINT('hello, ');
    DBE_OUTPUT.PRINT_LINE('database!');-- Output "hello, database!".
END;
/

-- Test DISABLE: Disable the calling of PUT, PUT_LINE, NEW_LINE, GET_LINE, and GET_LINES. The PUT_LINE has no output.
BEGIN
 dbe_output.disable();
        dbe_output.put_line('1');
END; 
/

-- Test ENABLE: Enable the calling of PUT, PUT_LINE, NEW_LINE, GET_LINE, and GET_LINES. The output of PUT_LINE is 1.
BEGIN
 dbe_output.enable();
        dbe_output.put_line('1');
END; 
/

-- Test PUT: Place the input character string a in the buffer without adding a newline character at the end. a has no output.
BEGIN
 dbe_output.enable();
 dbe_output.put('a');
END; 
/

-- Test NEW_LINE. Add a new line. The output is a.
BEGIN
 dbe_output.enable();
 dbe_output.put('a');
        dbe_output.new_line;
END; 
/

-- Test GET_LINE: Obtain buffer data and save the data to variables and use PUT_LINE to output the data.
DECLARE
 line VARCHAR(32672);
 status INTEGER := 0;
BEGIN
 dbe_output.put_line('hello');
 dbe_output.get_line(line, status);
 dbe_output.put_line('-----------');
 dbe_output.put_line(line);
 dbe_output.put_line(status);
END; 
/
The expected result is as follows:
-----------
hello
0

-- Test GET_LINE: Obtain multiple lines of content in the buffer and use PUT_LINE to output the content.
DECLARE
    lines dbms_output.chararr;
    numlines integer;
BEGIN
    dbe_output.put_line('output line 1');
    dbe_output.put_line('output line 2');
    dbe_output.put_line('output line 3');
    numlines := 100;
    dbe_output.get_lines(lines, numlines);
    dbe_output.put_line('num: ' || numlines);
    dbe_output.put_line('get line 1: ' || lines(1));
    dbe_output.put_line('get line 2: ' || lines(2));
    dbe_output.put_line('get line 3: ' || lines(3));
END;
/
-- The expected result is as follows:
num: 3
get line 1: output line 1
get line 2: output line 2
get line 3: output line 3

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback