Login   Search
Skip Navigation Links
Home
Application Security Tips
Oracle , PL/SQL
IT Product Reviews
Project Management
Forum
Contact Us
Links & References
Avoid SQL Injection attack
Threats and Countermeasures: S.T.R.I.D.E
Input Validation
Session Management
Authentication Mechanism
Cross Site Scripting Vulnerabilities
Configuration Management
Scroll up
Scroll down
Oracle 9i - Programming basics PL/SQL
PL/SQL - Conditional Statements – IF
PL/SQL -Nested Block
LOOPS in PL/SQL
PL/SQL Records
Cursors in PL/SQL
PL/SQL Tables
PL/SQL Exceptions
PL/SQL Procedures
PL/SQL Functions
Oracle supplied packages
Packages
PL/SQL Ref Cursors
Types in Oracle PL/SQL
Varrays
Nested Table
Bfile and LOBs
Bulk Binding
Know Depandencies
PL/SQL Wrapper
Triggers
Scroll up
Scroll down
DBMS_SQL package
DBMS_DDL Package
DBMS_JOB Package
UTL_FILE Package
DBMS_METADATA Package
DBMS_PIPE Package
DBMS_SESSION Package
Scroll up
Scroll down

 

Blog

  • Imperativeness of agile methodology in software development
  • Get list of installed softwares on machines in your network
  • VMWare - Error - the vmware authorization service is not running
  • Add chart / graphs in ASP.net application / website
  • Microsoft Ramp Up

Blog

  • Review: uCertify.com: PrepKit for: 70-529 (C#)
  • Bird eye Review: uCertify.com: PrepKit for: 70-529 (C#)
Skip Navigation Links>Oracle , PL/SQL>Oracle supplied packages>DBMS_PIPE Package

DBMS_PIPE Package

DBMS_PIPE is a package supplied to allow two sessions to communicate with each other. It is an inter-process communication device.

One session can write a message on a pipe, and another session can read this message.

Members of DBMS_PIPE:
      Sender session
      Pack_message procedure
     Send_message procedure

      Receiver Session
      Unpack_message procedure
    Receive_message procedure

Only SYS user has the privilege to use the DBMS_PIPE package.

SYS has to grant the privilege to scott:

Grant All on DBMS_PIPE to SCOTT;
 
CREATE OR REPLACE PACKAGE message_api  AS

procedure send(p_text varchar2);

procedure receive;

END message_api;

 
CREATE OR REPLACE PACKAGE BODY message_api AS

  PROCEDURE send (p_text varchar2)

   is

       l_status  NUMBER;

      begin

                     DBMS_PIPE.pack_message(p_text);

                      l_status := DBMS_PIPE.send_message('message_pipe');

        IF l_status != 0 THEN

             RAISE_APPLICATION_ERROR(-20001, 'message_pipe error');

       END IF;

    END;

 

PROCEDURE receive

is

       l_result  INTEGER;

       l_text    VARCHAR2(32767);

     BEGIN

        l_result := DBMS_PIPE.receive_message (pipename => 'message_pipe');

         IF l_result = 0 THEN-- Message received successfully.

               DBMS_PIPE.unpack_message(l_text);

                DBMS_OUTPUT.put_line('l_text  : ' || l_text);

           ELSE

RAISE_APPLICATION_ERROR(-20002, 'message_api.receive was   unsuccessful.   Return result: ' || l_result);

         END IF;            

  END receive;

 

END message_api;

In the current session : Exec message_api.send(‘abc’);
In the another session : Exec message_api.receive;

Discussion about this article

AuthorBody
Rahul
8/29/2009 3:41 PM
Please provide feedback about this article here.
To participate in this discussion Sign up for free membership of 24x7code.
To Signup click on Login , Use create user link & the follow the instructions.
Thank you



Designed & Developed by Rahul Bagal