CREATE_PIPE function - Create a pipe
The CREATE_PIPE function explicitly creates a public or private pipe with the specified name.
For more information about explicit public and private pipes, see the topic about the DBMS_PIPE module.
Syntax
Return value
This function returns the status code 0 if the pipe is created successfully.
Function parameters
- pipename
- An input argument of type VARCHAR(128) that specifies the name of the pipe. For more information about pipes, see DBMS_PIPE module.
- maxpipesize
- An optional input argument of type INTEGER that specifies the maximum capacity of the pipe in bytes. The default is 8192 bytes.
- private
- An optional input argument that specifies the access level of
the pipe:
- For non-partitioned database environments
- A value of "0" or "FALSE" creates a public pipe.
- In a partitioned database environment
- A value of "0" creates a public pipe.
Authorization
EXECUTE privilege on the DBMS_PIPE module.
Examples
Example 1: Create a private pipe that is named messages:
SET SERVEROUTPUT ON@
CREATE PROCEDURE proc1()
BEGIN
DECLARE v_status INTEGER;
SET v_status = DBMS_PIPE.CREATE_PIPE('messages');
DBMS_OUTPUT.PUT_LINE('CREATE_PIPE status: ' || v_status);
END@
CALL proc1@
This example results in the following output:
CREATE_PIPE status: 0
Example 2: Create a public pipe that is named mailbox:
SET SERVEROUTPUT ON@
CREATE PROCEDURE proc2()
BEGIN
DECLARE v_status INTEGER;
SET v_status = DBMS_PIPE.CREATE_PIPE('mailbox',0);
DBMS_OUTPUT.PUT_LINE('CREATE_PIPE status: ' || v_status);
END@
CALL proc2@
This example results in the following output:
CREATE_PIPE status: 0