DBMS_PIPE package Help

Hello

Below the block is executed successfully, but when I use it dynamically, retrieve values in SQL * no more values do print.
Please, help me to rectify the problem.

SET serveroutput size 1000000
Packaging of the SET
SET linesize 80

DECLARE
v_text VARCHAR2 (4000);
v_res NUMBER;
v_num NUMBER;
T_DATE DATE;
v_usr user_users.username%TYPE;
v_err NUMBER;
pipe_name VARCHAR2 (300);
BEGIN
pipe_name: = DBMS_PIPE.unique_session_name;

LOOP
v_res: = DBMS_PIPE.receive_message (pipe_name, 2);
DBMS_PIPE. UNPACK_MESSAGE (T_DATE);
DBMS_PIPE. UNPACK_MESSAGE (v_usr);
DBMS_PIPE. UNPACK_MESSAGE (v_num);
DBMS_PIPE. UNPACK_MESSAGE (v_text);
Dbms_output.put (TO_CHAR (T_DATE, 'HH24:MI:SS of MON-DD-YYYY') |) ' ');
Dbms_output.put (v_usr |) ' ');
Dbms_output.put (v_num);
Dbms_output.new_line;
Dbms_output.put_line (' ' | v_text);
WHEN OUTPUT v_res = 0;
END LOOP;
END;
/

This forum is for SQL * Developer questions (not for general questions of SQL/PLSQL)

You will get a better and probably longer response by posting questions on the DBMS_PIPE package in SQL and PL/SQL forum.

Published by: riedelme on 24 Sep, 2012 13:44

Tags: Database

Similar Questions

  • DBMS_PIPE package in the library

    Where can I find the DBMS_PIPE package. For now, I'm working on the migration form 6i. And I got this error in a procedure(G$_GET_PIPE_MESSAGES) that is called in a trigger.

    The DBMS_PIPE package
    1 procedure PACK_MESSAGE
    2. function SEND_MESSAGE
    3. function RECEIVE_MESSAGE
    4 procedure UNPACK_MESSAGE

    Hello

    It is a database under the owner SYS package.

    François

  • Problem with the dbms_pipe package

    I have a trigger in which I call G$ _GET_PIPE_MESSAGES. When I'm trying to migrate from the shape to 6i, during migration, I get errors in this saying following the procedure

    Error on line 22, column 17 201
    identifier "DBMS_PIPE. RECIEVE_MESSAGE' must be declared
    Error on line 22, column 17 0
    Declaration ignored
    Error at line 23, column 17 201
    identifier "DBMS_PIPE. UNPACK_MESSAGE' must be declared
    Error at line 23, column 17 0
    Declaration ignored

    I get this error in most forms.

    G$ _GET_PIPE_MESSAGES following PROCEDURE:
    PROCEDURE G$_GET_PIPE_MESSAGES IS 

    /* This procedure checks for Electronic Approvals messages through the use of 
       a dbms pipe named as the Oracle username. It alerts the user to how many
       transactions they have pending.
    */

      TIMED_OUT      EXCEPTION;
      PRAGMA         EXCEPTION_INIT(TIMED_OUT,-6556);
      STATUS         NUMBER;
      MAX_WAIT       INTEGER := 0;
      RETURN_PIPE    VARCHAR2(30);
      RETURN_MESSAGE VARCHAR(200);
      COUNT_MSG      NUMBER := 0;
      ALERT_MESSAGE  VARCHAR2(80);

    BEGIN
      DEFAULT_VALUE ('N','GLOBAL.APPROVAL_MSG_IND');
      IF :GLOBAL.APPROVAL_MSG_IND = 'Y' THEN
        RETURN_PIPE := USER;
        LOOP
          STATUS := DBMS_PIPE.RECEIVE_MESSAGE(RETURN_PIPE,MAX_WAIT);
          DBMS_PIPE.UNPACK_MESSAGE(RETURN_MESSAGE);
          IF STATUS = 0 THEN
             COUNT_MSG := COUNT_MSG + 1;
          ELSE
             EXIT ;
          END IF;
        END LOOP;
      END IF;
    --
    EXCEPTION
    WHEN TIMED_OUT THEN
       IF COUNT_MSG > 0 THEN
         ALERT_MESSAGE := RETURN_MESSAGE;
         CHANGE_ALERT_MESSAGE ('G$_PIPE_MESSAGE_ALERT',ALERT_MESSAGE);
         IF SHOW_ALERT ('G$_PIPE_MESSAGE_ALERT') = ALERT_BUTTON1 THEN
           IF :GLOBAL.SELECTFRM <> 'NOAAPSM' THEN
             G$_SECURED_FORM_CALL (:GLOBAL.CURRENT_USER,'NOAAPSM','');
           END IF;
         END IF;   
       END IF;
    WHEN OTHERS THEN
       MESSAGE ('*WARNING* Problem receiving piped messages.');
    END;

    You will have to grant execute DBMS_PIPE to the connection owner
    Or any login that uses the DBMS_PIPE

    Connect as SYS and run the following:

    GRANT EXECUTE ON DBMS_PIPE TO ;
    

    Hope this helps

    Published by: jl1997 on March 14, 2011 07:26

  • Misssing packages help

    HI I am trying to install Oracle 11 g/r2 on OEL5...

    During installation, I am asked to miss the following packages (im very new to linux... could someone iniform me how can I get them?)

    libaio-devel - 0.3.106 (i386)
    libaio-devel - 0.3.106 (x86_64)
    SYSSTAT - 7.0.2
    unixODBC - 2.2.11 (i386)
    unixODBC - 2.2.11 (x86_64)
    unixODBC-devel - 2.2.11 (i386)
    unixODBC-devel - 2.2.11 (x86_64)

    Any help would be appreciated

    If the version is higher than the condition is good.
    If the version is lower than oracle will complain.

    OK anyway good luck

  • Procedure runs package Help

    Hello

    I need to get familiar with the procedures and packages if I put in place the code below in a procedure to run a package, when to use the DBMS_OUTPUT procedure. Put_line to display that returns the package.

    Finally the package returns lines of our ColdFusion Oracle database.

    Could someone please help me get it going, and maybe I'll see where I am in foul territory? I think I'm close or across the universe.

    Thanks in advance for your help,

    Lou

    PROCEDURE
    create or replace
    PROCEDURE test2
    is
    TYPE my_cursor is REF CURSOR;


    BEGIN
    test1_pack.test1_proc(:my_cursor);
    LOOP
    NULL;
    -DBMS_OUTPUT. Put_line(my_c.col1 || my_c.col2);
    END LOOP;

    END test2;

    PACKAGE
    create or replace
    package test1_pack as

    TYPE test1_cursor IS REF CURSOR;

    PROCEDURE test1_proc)
    p_cursor in THE test1_cursor);

    end test1_pack;


    PACKAGE BODY
    create or replace
    package body test1_pack as

    PROCEDURE test1_proc)
    p_cursor in THE test1_cursor) as
    Start
    OPEN FOR P_cursor
    SELECT * FROM
    (SELECT 'Is' today AS "COL1", TO_CHAR (SYSDATE) AS 'COL2' FROM DUAL
    UNION ALL
    SELECT 'April', ' crazy! OF THE DOUBLE
    );
    end test1_proc;

    end test1_pack;

    Hello

    Try this:

    CREATE OR REPLACE PROCEDURE test2 IS
       TYPE my_cursor IS REF CURSOR;
       v_cursor my_cursor;
       v_col1   VARCHAR2(100);
       v_col2   VARCHAR2(100);
    BEGIN
       test1_pack.test1_proc(v_cursor);
    
       LOOP
          FETCH v_cursor
             INTO v_col1, v_col2;
          EXIT WHEN v_cursor%NOTFOUND;
          DBMS_OUTPUT.PUT_LINE(v_col1 || v_col2);
       END LOOP;
    
       CLOSE v_cursor;
    END test2;
    /
    

    Kind regards

  • ORA-04067: not executed, the package body 'SCOTT. DBMS_PIPE' does not exist

    Hello world

    My version of DB is

    BANNER

    --------------------------------------------------------------------------------

    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    PL/SQL Release 11.2.0.1.0 - Production

    CORE 11.2.0.1.0 Production

    AMT for 64-bit Windows: Version 11.2.0.1.0 - Production

    NLSRTL Version 11.2.0.1.0 - Production

    I ran this command SYS and SCOTT as well. But I can't see the body of DBMS_PIPE package. So, how can I test DBMS_PIPE then? Please help, suggest something here.

    @C:\app\BS\product\11.2.0\dbhome_1\RDBMS\ADMIN\dbmspipe.sql

    Kind regards

    BS2012.

    Have you had a look at the script of dbmspipe.sql?   Why not?  After all, it's just an ASCII text file.

    In any case the script is EXECUTED on the package to a role, execute_catalog_role.  So only users who have gotten this role will be able to use the DBMS_PIPE of the judgment.  You must login as SYS and grant EXECUTE to your username (do not grant them this role).  Oracle made this way because the pipes can be voracious consumers of system resources.

    Oh and drop the package from the SCOTT schema.  It's just a recipe for confusion.

    Cheers, APC

  • Error DBMS_PIPE

    This works in a schema, but does not work in the other schema, want to give privileges


    lpipe_name: = DBMS_PIPE. UNIQUE_SESSION_NAME;

    Errors of compilation for the CPBRNBSG PROCEDURE. SP_SY_SYSTEMATICS_INTERFACE

    Error: PLS-00201: identifier 'DBMS_PIPE' must be declared
    Online: 146
    Text: lpipe_name: = DBMS_PIPE. UNIQUE_SESSION_NAME;

    GRANT EXECUTE on the DBMS_PIPE package.

  • Multi-threading parallel processing of stored procedures

    Hi guys,.

    I have the following scenario, and I would like to realize parallel processing to increase the performance of data refresh:

    Stored procedure "SP1" - refresh table A
    Stored procedure 'SP2' - Update table B
    Stored procedure "SP3" - updates table C

    I would like to be able to update table A, B and C table at the same time, could someone help me identify ways in what could be achieved if something like this is possible?

    I use collections in stored procedures SP1, SP2 and SP3 to accelerate the time to refresh table, although would like to know how parallel update tables.

    I have briefly heard the dbms_pipe package, which would be useful in this scenario?

    Thank you
    Rohan

    rbha4 wrote:

    I use collections in stored procedures SP1, SP2 and SP3 to accelerate the time to refresh table, although would like to know how parallel update tables.

    As already mentioned - perform these distinct process procedures in planning jobs. DBMS_JOB and DBMS_SCHEDULER interfaces can be used. If the work queue manager supports (has been configured) with 3 or more processes working slots and these are empty and not used, then all the 3 procedures can be performed in parallel.

    This can be as simple as running the following anonymous block to schedule 3 jobs for immediate execution:

    declare
      jobID number;
    begin
      DBMS_JOB.Submit( jobID, 'procA;', sysdate );
      DBMS_JOB.Submit( jobID, 'procB;', sysdate );
      DBMS_JOB.Submit( jobID, 'procC;', sysdate );
      commit;
    end;
    

    I have briefly heard the dbms_pipe package, which would be useful in this scenario?

    Only when the IPC (Inter Process Communication) is required only if the database pipes best fits this requirement.

  • Run time output of DBMS_OUTPUT. PUT_LINE

    I would like to know why DBMS_OUTPUT. Put_line output gives only after the end of the execution of the procedure. I wonder why Oracle has not provided a package for the output of the run time.

    user10566312 wrote:
    I would like to know why DBMS_OUTPUT. Put_line output gives only after the end of the execution of the procedure. I wonder why Oracle has not provided a package for the output of the run time.

    It's because of the client server architecture.

    SQL and PL/SQL processes run on the database server.
    The database server has no access to clients, or screen keyboard, so cannot accept entries to the client keyboard, or write the output to the screen of the client.
    When the client software issues a statement to the database, it uses something like for example of SQL * more to establish a connection to the database, submit this request to the database and then waits for the request to complete, eventually return some results from that (e.g. the results of a SQL query).
    DBMS_OUTPUT does not write to any screen... it puts just the data that you specify in the DBMS_OUTPUT buffer. It is then up to the client software to request the contents of this buffer, but the client software cannot do that when the request he made was finished (only a single statement between client and server can be converted at any time). That's why you issue your request so the output once the query is complete.

    Oracle provides a way for you to run output at the time, if you want to start doing things with the DBMS_PIPE package, etc., although for the follow-up of the execution, I have a package that writes my 'output' to a table on the database by using an autonomous transaction and then the content of this table can be viewed from a second session While the first session is still being requested process. Similarly, you may have your 'exit', writes to a file on the database server using something like UTL_FILE and then you would be able to view the contents of this file running, as long as you open and close the file and make sure file buffers have been empty etc.

    DBMS_OUTPUT is not the tool to use if you want to display the output of the run time. It's not a fault of Oracle, it's just your lack of understanding of what tools do this work. ;)

  • Tips to increase performance of recovery?

    Hello

    I do a few select odp.net against my oracle database queries.

    first of all I may do: select id,... from table1 where id in some_collection.
    then I can do select id from table2 where id in some_collection and id2 in some_other_collection etc.

    Let's say I do 3 to 5 odp.net with a few collections calls to retrieve a set of results from different tables. So my settings are in collections. Some of these collections are used in many of my calls.

    Now I'm doing calls with SqlCommand.CommandTYpe = CommandType.Text;
    Is there a difference between a text query and the other to a pl/sql stored procedure? I thought that maybe it would be good to remove switches context between the engine sql and pl/sql.

    In addition, if you use a stored procedure I guess I should use a REF CURSOR to retrieve data. What are the advantages and disadvantages of which compares to a normal text sql statement?

    If I use a ref cursor in a stored procedure that I can get also all calls directly via several ref Cursor, reducing the amount of calls and again by using the parameter in collections that are used by multiple queries. Want to just a few comments on the approach to take.

    Hello
    I did no performance test between raw SQL and PL/SQL to SQL via a change of context - but a quick glance at this link:
    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:60122715103602
    «But don't not afraid at all to call SQL PLSQL - it's what makes better PLSQL.»
    I think that the main time, that you will encounter the problem of context switch is when you call a function in an SQL statement (for example SELECT d.ColA, SomeFunctionHere (d.ColB) to d etc.)
    or when you have a loop in a PL/SQL that 1000 of inserts or updates rather than manage, in a single call.

    (dating back to asktom: http://asktom.oracle.com/pls/asktom/f?p=100:11:0:::P11_QUESTION_ID:47458244605081--> his mantra is repeated often in these forums)

    Now on packages, I'm a big fan of packets (so much so I tend to try actively don't put raw SQL (set or not) in my code). This is a personal preference thing, but I found that packages I would reduce my calls, are easier to maintain my SQL logic and data into autonomous units of nice, and I used PL/SQL more, I like to use (even in SQL Server, I tend to store proc everything!).

    REF Cursor: http://www.oracle.com/technology/pub/articles/mastering_dotnet_oracle/williams_refcursors.html
    Once again I did no stable performance between REF CURSOR and run the SQL in code (as I said I am biased towards using PL/SQL, whenever I can call a procedure/package and performance 2-5 ref Cursor in a single call, so I'm happy).

    Now you can return your result sets the UDT; they are a little more complex to work with and require:
    (1) a user defined type in Oracle
    (2) for a package that complete and mail it
    (3) based on Oracle on the side of .net code (they may automatically generate your classes, but you can still change classes if necessary)
    When you install ODP if you look in your ORAHOME\product\11.1.0\client_1\odp.net\samples\2.x\UDT, you will see some examples of work that.

    and a nice walk through via oracle: http://www.oracle.com/technology/obe/hol08/dotnet/udt/udt_otn.htm

    Now, I did tests with the UDT vs REF CURSOR performance, and as result sets get bigger the UDT becomes more effective for the insertion of the collections as opposed to a loop through to insert rows (this is of course with the exception of bulk insertions and others).

    I would say that your test scenario resembles a simple trying to packages with. I recommend trying to create a single call to get back all your data sets. Don't forget to create your package as your .net code, keep the small procedures/functions, so you can keep them in the future!

    "How a package help me? You're right, it's just a class in Oracle that can expose methods to use. These methods can be public or private, have full access to the features of Oracle for data processing, etc. I find it helps me maintain my component to the application database and bugfixes from time to time do really well without the expense of a MSI roll (our configuration has db changes a little bit easier to realize that changes server .net)

    I recommend to try to reduce your number of requests as much as possible (exploring the joints) and try to have done with a single command and return the data more quickly and easily as possible. The UDT can be a good thing to play with, but I would seriously look at and make sure that it fits in your directions for development of the Department and you think it will be easier to maintain. We slowly put our toes in the waters of the UDT and mainly use a ref CURSOR returned by packets.

  • When I download itunes on my pc, I get an error of analysis package, any help?

    "When I download itunes on my pc I get a parse error in the package, any help?

    Hello xlAdrenaline,

    Thank you for using communities of Apple Support.

    If I understand your message that you receive a packet parse error when you try to install iTunes on your Windows PC. The following article has some great not to help solve this type of problem:

    If you see an error message "Windows package install" when you try to uninstall iTunes from your PC

    Best regards

  • I downloaded the update and I can't open the package I need help?

    I downloaded the update and cannotopen software package, why? I need help...

    You have a desktop Mac Pro 2009 with OSX 10.6.3?

  • When I try to install an update to iTunes on my Windows 7 computer I get the following message: "there is a problem with this Windows Installer package. A program required for this install to complete could not be run. "Help, please.

    When I try to install an update to iTunes on my Windows 7 computer I get the following message: "there is a problem with this Windows
    Installation package. A program required for this install to complete could not be run. "Help, please.

    Hello..

    Try this support article > If you see an error message "Windows package install" when you try to uninstall iTunes from your PC

  • The Knights of iron game item pack I bought 4 days ago. my credit card payment was made. but I got my package to arrive. Help, please.

    The Knights of iron game item pack I bought 4 days ago. my credit card payment was made. but I got my package to arrive. Help, please.

    Do you mean that you have not received the item ("received my package" implies that you have, in this case I don't know what your question)? If you do then you contacted the developer of this game? If they cannot / does not help, then try to contact iTunes Support: http://reportaproblem.apple.com

    (I asked for your message to be moved to the forum of the iTunes Store, where you have posted is for questions about the iTunes U app.)

  • !!!! NEED HELP URGENT! Cannot / uninstall ArcGIS Desktop: "error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personal or package.

    I use a 2005 Dell Precision 670 with OS Microsoft XP Professional x 64 Edition Version 2003, Service Pack 2.

    I tried to update my version of ESRI ArcGIS Desktop v9.3 to v9.2, but in the process of uninstalling v9.2 there error/corruption (although at the time, I don't remember getting the error messages).

    Symptoms were: program icon not slot "start > programs" or less "C; "" / Program Files "C:/Program Files (x 86) or ' but the icon still appeared in the list of installed programs in"Add or remove programs ".

    Suggestions to be by ESRI:

    -Re-registration of the service Windows Installer - Ran fine, but the error still there.

    -File system - fine Ran but error checker always run here.

    -Downloaded Windows Installer cleanup - NO error found.

    -Downloaded CCleaner - NO error found.

    -Manually deleted the program, manually remove the following program files: C:\program files\arcgis; C:\Program Files\Fichiers files\esri. C:\Documents and setting\%user name%\application data\ESRI

    -Manually remove ESRI records in the registry: I did it by start > run REGEDIT [press ENTER], then navigate hkey_local_mahine/software and sailed to hkey_current_user/software.

    -Tried to repair the program from the installation disc, but it always seems to grind to a hault about 50-75% through the configuration of the repair procedure.

    -Tried to uninstall the program with the vision more recent ArcGIS Desktop but I still get the ERROR 1721.

    I was once in contact with the package vendor (ESRI) UK support team and they sent this problem at their headquarters in the States.

    I'm really at a lost as to how this can be fixed, because this program is what I use for my career! Help, please!

    This may be a day late and a dollar short, but there is a question we've seen recently with ArcGIS facilities.  There is a registry change to ArcGIS that limits the size of the regestry and NOTHING prevents installation once this limit is reached.

    Do the following reg key change:

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\RegistrySizeLimit

    Update the value ffffffff

    Restart the computer.

    Here is some info on this registry key: http://support.microsoft.com/kb/124594

Maybe you are looking for