The output is always "anonymous block completed"

Hi ,
I have written a simple Stored Procedure as shown :
create or replace procedure display
ename out emp.ename%type
is
begin
select ename  into ename from emp  where empno='7369';
end;
I tried to execute the above using this block
declare
ename emp.ename%type;
begin
display(ename);
dbms_output.put_line(ename);
end;
I am always getting the Output as "anonymous block completed" and nothing else .
Please help . Thanks .

Hi:
First type this to enable the output.
SET SERVEROUTPUT ON;Saad,

Similar Messages

  • Anonymous block completed

    When I try to run below code, I am getting message says: anonymous block completed. What is this mean?
    I think I supposed see whether 'ths oofice is closed today or 'theoffce is open today'as the output,,, what is worng in this code?
    Declare
    v_day_of_week varchar(30);
    Begin
    v_day_of_week := To_CHAR(SYSDATE, 'DY');
    If(v_day_of_week in ('SAT', 'SUN')) THEN
    DBMS_OUTPUT.PUT_LINE('The office is closed today');
    Else
    DBMS_OUTPUT.PUt_LINE('The office open today');
    end if;
    End;

    In Oracle SQL Developer, there is a DBMS_OUTPUT-tab in the SQL Worksheet. The left most icon (that text-balloon thing) is a toggle to set serveroutput on and off.
    Running (F5 - Run Script) you anonymous block will give you the results as expected.

  • What is "anonymous block completed" ?

    I run the following package in sql developer but always come out " anonymous block completed"
    I would like to what is "anonymous block completed" ? Is it an error? What we need to bear in mind?
    BEGIN
    PKG_VERIFICATION2.SP_CHK();
    END;

    Each call to Oracle, returns a return or exit code.
    For a successful call, the code ORA-0000 is returned.
    Oracle assigned the text message "+ORA-0000: normal, successful completion+" to that code.
    Many clients will however use a tad more meaningful messages. If the call was to create a table, the client can display "+Table created+" as the response message. Or "+Table altered+" for an alter table statement.
    Likewise, for an anonymous PL/SQL block, the client can respond with a "+anonymous block completed+".

  • Printing the Package output from Anonymous block

    Hi,
    I need to call the below package from anonymous block and get the output.
    Could you let me know.
    I tried using this, but i don't get data.
    ===========Anonymous Block=====================================================================
    declare
    var              xxdc.xxdc_sr_log_his_pkg.sr_tbl_type;
    l_sr_idx_bi  BINARY_INTEGER := 0;
    BEGIN
    xxdc.xxdc_sr_log_his_pkg.service_record('14040',var);
    dbms_output.put_line('CLAIM_CREDIT_OFFERS  :'||var(l_sr_idx_bi).qa_credit_offers(l_sr_idx_bi).character1 );
    end;
    =============================================================================================
    ============================================================================================
    Package Spec
    TYPE cr_offer_type IS TABLE OF apps.qa_results_v%ROWTYPE  
    INDEX BY BINARY_INTEGER;
    TYPE sr_rec_type IS RECORD
    (task_status                      apps.jtf_task_statuses_tl.name%TYPE
    ,task_type                        apps.jtf_task_types_tl.name%TYPE
    ,qa_credit_offers                 cr_offer_type
    TYPE sr_tbl_type IS TABLE OF sr_rec_type
    INDEX BY BINARY_INTEGER;
    PROCEDURE  service_record(p_service_req_num IN  VARCHAR2
                                               ,p_service_req_tbl OUT sr_tbl_type
    Package Body
           FOR emp_row_rec IN cur_credit_off
           LOOP
             l_sr_tbl(l_sr_idx_bi).qa_credit_offers(l_sr_idx_bi).character1 := emp_row_rec.character1;
             --dbms_output.put_line( l_sr_tbl(l_sr_idx_bi).qa_credit_offers(l_sr_idx_bi).character1);   --commenting for testing
              l_sr_idx_bi := l_sr_idx_bi + 1;
           END LOOP;
          p_service_req_tbl := l_sr_tbl;
    =============================================================================================
    Thank

    Hi,
    Did you issue the SQL*Plus command
    SET  SERVEROUTPUT  ON
    or, if you're using some other front end, its equivalent?
    Can you ever see output from dbms_output?  For example, what happens when you run this?
    SET  SERVEROUTPUT  ON
    BEGIN
        dbms_output.put_line ('Hello, world!');
    END;
    Since I don't have your tables, I can't actually run your code.  If you'd post CREATE TABLE and INSERT statements, or re-write the package to reference commonly available tables, such as those in the scott schema, then I could test it.

  • Unexpected result with select max(colmn) in anonymous block

    Hi
    The following query gives me 28,800 as sum(sal)
    SELECT SUM(salary)
    FROM employees
        WHERE department_id =60
    O/P is :  28800But when i use the above query in anonymous block it gives me 684400
    DECLARE
    v_sum_sal NUMBER;
    department_id employees.department_id%TYPE := 60;
    BEGIN
        dbms_output.put_line ('The department_id is'||department_id);
       SELECT SUM(salary)
          into v_sum_sal
        FROM employees
        WHERE department_id = department_id ;
       dbms_output.put_line ('The sum of sal is'||v_sum_sal);
    END;The above output statements gives me 684400 as output.. But the expected is 28800
    Could you please hint me why the output differs in anonymous block

    Smile wrote:
    Hi
    The following query gives me 28,800 as sum(sal)
    SELECT SUM(salary)
    FROM employees
    WHERE department_id =60
    O/P is :  28800But when i use the above query in anonymous block it gives me 684400
    DECLARE
    v_sum_sal NUMBER;
    department_id employees.department_id%TYPE := 60;
    BEGIN
    dbms_output.put_line ('The department_id is'||department_id);
    SELECT SUM(salary)
    into v_sum_sal
    FROM employees
    WHERE department_id = department_id ;
    dbms_output.put_line ('The sum of sal is'||v_sum_sal);
    END;The above output statements gives me 684400 as output.. But the expected is 28800
    Could you please hint me why the output differs in anonymous blockBecause you've made the mistake of having the same name for your column and your variable.
    department_id is taken to be the column on both sides of the equality in your query - so it's picking up all rows.

  • Changing Oracle Passwords through HTML DB anonymous blocks

    I am attempting to use DAD as my authentication method. The site will only be accessible through an SSL connection, so I'm not too worried about security. Plus it is a small target audience. I don't want to mess with LDAP because of the unnecessary complexity of adding it just for a single application. One of the requirements is changing passwords through the application. I always get an ORA-01935 (missing user or role name). Any ideas?

    Just a note, I get this from an after submit process that executes the following pl/sql anonymous block:
    begin
    execute immediate 'alter user :P9_USERNAME identified by :P9_PASSWORD1';
    exception
    when others then
    raise_application_error(-20911, 'Could not change password for user: ' || :P9_USERNAME || ' ' || SQLERRM);
    end;

  • Can select resource content in anonymous block, but not in stored procedure

    I know the problem relates to the ACLs but am curious about the following behaviour:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    running on Windows XP sp2
    Trying to access an existing resource '/home/test/test.dtd'
    /home is owned by SYS
    /home/test is owned by me
    /home/test.test.dtd is owned by me
    The following SQL and anonymous block retrieve the content of the resource:
    select extract(p.res,'/*').getClobVal()
    from resource_view p
    where p.any_path = '/home/test/test.dtd'
    declare
    alldata clob;
    begin
    select extract(p.res,'/*').getClobVal()
    into alldata
    from resource_view p
    where p.any_path = '/home/test/test.dtd'
    dbms_output.put_line(substr(alldata, 1, 255));
    end;
    BUT when I encapsulate the anonymous block in a stored procedure, I am told that the folder '/home/test/' does not exist.
    As said, the problem related to the ACL on the folders, what I cannot understand, and caused me considerable confusion, is why I was unable to get the content from a stored procedure when I was able to do so from an anonymous block.
    regards
    Richard

    Use equals_path(res,'/home/test/test.dtd') = 1OK, OK, but how do you use wildcards (if you want to) since any_path like '/home/test%' works?
    Who was the stored procedure owned by. Was it a stand-alone stored procedure or a
    method on a package. If it was a method on a package is it AUTHID creator or AUTHID
    definer.Everything apart from the '/home' folder is owned by the current user.
    The PL/SQL was in a packaged procedure, a stand-alone stored procedure, and an anonymous block. It exhibited the same behaviour in each. All were defined with default AUTHID which is definers rights which is the same as the current user in this case.

  • Block the output in R/3 if order is not compliant

    Hello All
    We are currently implementing SAP GTS  compliance module.  To integrated SAP GTS with the rest of the solution, we want to block the output for purchase orders and sales orders and the creation of the subsequent document.
    For the creation of the subsequent document, there are some SAP notes related to it and it doesn't really create an issue for us
    For the output, we are currently struggling to find a correct solution
    So far, we had found the oss note 900555 to block the printed output for the Purchase order but how can we do it  for the others ?
    In addition, I didn't find any solution for the sales orders output  ( expecially we hae some EDI messages that we want to block)
    Currently we were investigating an  other way to do it:
    - Send back a user status that we will use as condition to determine the output. We have still some concerns about this solution because it means that by default we should put this user status as "non-compliant" for all the orders and only when the status is sent back from GTS we can execute the output
    An issue that raise to me also the developper is that in R/3 the output determination is executed before the first call to GTS.
    I hope that some members of the community have better solution which ideally can cover PO and SO with real time call
    Thank you in advance
    Nicolas

    Hello Bastian,
    We had the same issue and didn't find something useful to block the outputs completely.
    Instead, for EDI Outputs probably you can have an extra text segment added in the idoc structure. And put the document compliant status as Yes/No in that segment. The document status will be available.
    But however as we expect, the Outputs cannot be blocked. But atleast notification about the status can be sent to Third party. You can liaise with third party to have a logic implemented to check the status of this field and pass the information to destination.
    Regards
    Dhilipan

  • Create Accounting when completed in warning the output is coming in XML

    Hello to all,
    I am having APPS version 12.1.3 OS version OEL 5.5
    my problem is that when i am running Create Accounting concurrent request if it completes in warning the output (view output) is coming in XML in browser where as if its completing normal then the output appears correctly as expected, the output type for create accounting concurrent program is XML.
    Please advise / guide me
    thanks

    Please find below log file details
    ==============================================================================================
    Start of log messages from FND_FILE
    06-OCT-2011 10:36:08 - Beginning of the Report
    06-OCT-2011 10:36:08 - Starting of the Parent Thread
    Starting main program for the source application = 200
    06-OCT-2011 10:36:08 - Dynamic conditions built
    06-OCT-2011 10:36:08 - Event Applications Determined
    06-OCT-2011 10:36:08 - Security Context Set
    06-OCT-2011 10:36:08 - Session Identifier Set
    06-OCT-2011 10:36:08 - Setup for the ledger and Event applications Read
    06-OCT-2011 10:36:08 - executing preaccounting hook
    event key = 10-426334
    06-OCT-2011 10:36:08 - preaccounting hook executed successfully
    06-OCT-2011 10:36:08 - Pre-Accounting steps performed
    06-OCT-2011 10:36:08 - Queue Created = XLA.XLA_426334_DOC_Q
    06-OCT-2011 10:36:08 - Queue Created = XLA.XLA_426334_COMP_Q
    06-OCT-2011 10:36:08 - Queue Started = XLA.XLA_426334_DOC_Q
    06-OCT-2011 10:36:08 - Queue Started = XLA.XLA_426334_COMP_Q
    06-OCT-2011 10:36:08 - Global Context Initialized
    06-OCT-2011 10:36:08 - Calling sequencing batch_init
    06-OCT-2011 10:36:08 - Returned from sequencing batch_init
    06-OCT-2011 10:36:08 - Begin enqueue
    06-OCT-2011 10:36:08 - Ready to Enqueue documents in the queue
    06-OCT-2011 10:36:08 - Spawning unit processors
    06-OCT-2011 10:36:08 - Unit processors spawned
    06-OCT-2011 10:36:36 - Ready to Enqueue documents in the queue
    06-OCT-2011 10:36:36 - Ready to Enqueue documents in the queue
    06-OCT-2011 10:36:36 - Ready to Enqueue documents in the queue
    06-OCT-2011 10:36:36 - Ready to Enqueue documents in the queue
    06-OCT-2011 10:36:36 - Enqueueing completed
    06-OCT-2011 10:36:36 - Waiting for Unit Processor requests to complete
    06-OCT-2011 10:37:06 - Child Threads completed
    06-OCT-2011 10:37:06 - Global Context cleared
    06-OCT-2011 10:37:06 - Queue stopped = XLA.XLA_426334_DOC_Q
    06-OCT-2011 10:37:06 - Queue stopped = XLA.XLA_426334_COMP_Q
    06-OCT-2011 10:37:06 - Queue dropped = XLA.XLA_426334_DOC_Q
    06-OCT-2011 10:37:06 - Queue dropped = XLA.XLA_426334_COMP_Q
    06-OCT-2011 10:37:06 - Calling sequencing batch_exit
    06-OCT-2011 10:37:06 - Returned from sequencing batch_exit
    06-OCT-2011 10:37:06 - Executed post-accounting routine
    06-OCT-2011 10:37:06 - Accounting Program completed successfully
    06-OCT-2011 10:37:06 - executing postaccounting hook
    event key = 10-426334
    06-OCT-2011 10:37:06 - postaccounting hook executed successfully
    - Accounting Time = 58.73 secs
    - Transfer Time = 0 secs
    06-OCT-2011 10:37:06 - End of the Report
    End of log messages from FND_FILE
    Executing request completion options...
    Output file size:
    1920
    ------------- 1) PUBLISH -------------
    Beginning post-processing of request 426334 on node M at 06-OCT-2011 10:37:06.
    Post-processing of request 426334 failed at 06-OCT-2011 10:39:06 with the error message:
    The Output Post-processor is running but has not picked up this request.
    No further attempts will be made to post-process this request, and the request will be marked
    with Warning status.
    Setting the profile option Concurrent: OPP Response Timeout to a higher value may be necessary.
    ------------- 2) PRINT   -------------
    Not printing the output of this request because post-processing failed.
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 06-OCT-2011 10:39:06
    Edited by: hassanksa on Oct 8, 2011 8:15 AM
    Edited by: hassanksa on Oct 8, 2011 8:16 AM

  • In the output list Repeating one line always when generating query by sq01

    Hi,
    I have generated a query in sq01 for list material document for movment type 301 (Transfer posting) using below tables :
    MSEG          Material No. MATNR, Movt. - BWART, Qty. -MENGE
    MKPF          Material doc. field  MBLNR
    MARC          Stock in Transit UMLMC
    some times it is generating the output as i want i.e.
    Material document          material no.      qty.     movt.      stock in transit
    4001               1xx          1     301     0
    4002               2xx          2     301     0
    but some time it is repeating the same line in output ie..
    Material document          material no.      qty.     movt.      stock in transit
    4001               1xx          1     301     0
    4001               1xx          1     301     0
    4001               1xx          1     301     0
    4001               1xx          1     301     0
    Please let me know the reason. is there any control in sq01.
    Thanks

    Yeah it is clear visible that, the same combination might have available in different plants.
    So to avoid the duplicate entries, always select all the primary key fields available in all the tables in the output.
    If not atleast try restricting based on plant in the selection screen or any possible duplicate entreis.
    So add the key fields at Infoset level in SQ02

  • How come the item value does not come thru via PL/SQL anonymous block?

    Hi,
    It's a Form with 3 tables -
    1) ClinicianProfileTb (with about 40 columns, insert/update via DML),
    2) PeopleTb (with about 7 columns, insert/update via PL/SQL anonymous block) and
    3) ClinicianPracticeTb (with about 10 columns, insert/update via PL/SQL anonymous block) for after-submit-processes.
    So I have several After-Submit-Processes. For some reason, it appears that PeopleId which is supposed to come thru via the 2nd After-Submit-Process (ie: Insert/Update PeopleTb) does not do the way it's supposed to. And when I press "Create" button at the bottom, I got the following error msg:
    ORA-01400: cannot insert NULL into ("TEST_0712"."CLINICIANPRACTICETB"."PEOPLEID")
    I tried the "debug" mode (via edit page link), but to no avail. (I'm newbie, trying to learn and deliver at the same time :)).
    I uploaded the app to apex.oracle.com, if someone could kindly take a look and let me know what goes wrong, it'd be greatly appreciated.
    workspace: test_0712
    app: 43408 - TEST
    user: demo
    pswd: demoPswd
    Page#21 -> look at the After-Submit-Processes -> in "Insert/Update PeopleTb" it appears that PeopeId does not come thru; thus it cannot be updated to ClinicianProfileTb.PeopleId (allows null) -> and thus cannot be inserted into ClincianPracticeTb.PeopleId (which does NOT allow null). Basically my logic is that in order to create ANY row in ClinicianPracticeTb, BOTH PracticeId AND PeopleId must be present.
    Acutally I should have used the PeopeTb as DML (as the driving table) to enforce that PeopleId must be present in order to insert ClinicianProfileTb and ClinicianPracticeTb, but it'd be lots of codes to write to insert/update in ClinicianProfileTb (40 columns).
    In addition, does ApEx consider EVERY SINGLE after-submit-process are in ONE transaction for commit/rollback? It appears that it treats all PL/SQL anonymous blocks are in ONE transaction, while Automatic Row Processing (DML) is commited/rolled back on its own?
    Thanks much,
    Helen

    All blocks that do not commit in one of the ways I detailed (and which do not explicitly commit using a commit statement) are part of the transaction started with > the first DML statement issued in any of the page processes and continuing until a commit is issued.Say, there are the following processes in the After-Submit-Processes:
    1. Process1 -> Automatic Row Processing (DML)
    2. Process2 -> PL/SQL anonymous block
    3. Process3 -> PL/SQL anonymous block
    Based on what you describe, in the event that if there is no explicit "commit" issued in any of these processes, then an implicit "commit" will be issued at the end of Process3?
    Thanks, Scott.
    Doreen

  • Should Output parameters always be declare at the beginning of the Stored Procedure?

    Should Output parameters always be declare at the beginning of the Stored Procedure?

    Usually input parameters listed first followed by output parameters. This is just a custom, not a requirement.
    Blog: How to architect stored procedure parameters?
    BOL: http://msdn.microsoft.com/en-us/library/ms187926.aspx
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • A download, iPhoto, Version 9.4.2, released November 2012; has been on my download page for three weeks.  Despite a half dozen attempts to install it, it has never completed the download.  Near the end it always says an error has occurred.  What can I do?

    A download, iPhoto, Version 9.4.2, released November 2012; has been on my download page for three weeks.  Despite a half dozen attempts to install it, it has never completed the download.  Near the end it always says an error has occurred.  What can I do?  The unit onto/into which I am attempting to install this is a new MacBook Air.
    thank you.
    Otto

    Thanks LN.
    I tried.  It would not download.  A drop down notice said an error had occurred and to return to the purchase page; which I have done on numerous occasions.  (What I am to do on the purchase page I am not sure, other than to click on purchases and see that the same iPhoto download is available.  By the way, this was not purchased.  It just showed up with two other items free items, which did download nicely.)
    Otto

  • TS3212 I have removed my pop-up blocker completely and still receive the following error message when attempting to download iTunes:  "The file was blocked because it does not have a valid digital signature that verifies its publisher".....any ideas?

    have removed my pop-up blocker completely and still receive the following error message when attempting to download iTunes:  "The file was blocked because it does not have a valid digital signature that verifies its publisher".....any ideas?

    That suggests that the installer is getting damaged during the download.
    I'd first try downloading an installer from the Apple website using a different web browser:
    http://www.apple.com/itunes/download/
    If you use Firefox instead of IE for the download (or vice versa), do you get a working installer?

  • Customize the Anonymous Block.

    Hi All,
    DB - Oracle 9.2.0.1.0
    With the help of you Guys , I am able to create the Anonymous block.But, In the following BLOCK, I need to add One more functionality, if someone needs to grant "create view" privilge inside the block , then the massage should be " No direct grant allowed, this should be assigned to role. Also, is there any alternate, where we can achieve the same effect without using Associative
    DECLARE
    v_need_to_assign VARCHAR2(30) := '&ENTER PRIVILEGE ASSIGN';
    v_user varchar2(30) := '&USER';
    TYPE t_list IS TABLE OF NUMBER INDEX BY VARCHAR2(30);
    v_list t_list;
    v_chk NUMBER;
    e_fail_drop EXCEPTION;
    BEGIN
    v_list('SYSDBA') := 1;
    v_list('CREATE SESSION') := 1;
    BEGIN
    v_chk := v_list(v_need_to_assign);
    RAISE_APPLICATION_ERROR(-20001,'PRIVELEGE '||v_need_to_assign||' is not allowed to be grant');
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE('Privilege ' || v_need_to_assign|| ' Granted');
    EXECUTE IMMEDIATE 'GRANT '||v_need_to_assign || ' to ' || v_user;
    DBMS_OUTPUT.PUT_LINE('THE PRIVELEGE '||v_need_to_assign || ' HAS BEEN GRANTED TO ' || v_user) ;
    END;
    END;
    hare krishna

    I would appriciate, if you could offer your suggestions on this.
    hare krishna
    Alok

Maybe you are looking for

  • Sales process for outlets

    Hi friends, At the point of sale(Pos) say for an outlet where the client doesnt want to keep a sap user and only the sales qty has to be captured so that an invoice can be made for the FI postings. Also the inventary will be mainationed in sap but si

  • Update the System in C# WinForms with InstallShield

    I already created the application and install it on my own computer and other computers. I created the set up of my application using InstallShield 2013 and I want to update my system to the latest version. From version 1.00 to 1.01 . Is that possibl

  • Portal upgrade to 904 still 'looks like' 902

    Hi, I've completed an upgrade of mid tier and infrastructure 902 to 904. On checking in Global Settings it shows 9.0.4.0.99 as the portal version. However, the environment looks and feels like 9iAS. Am I missing something here? Any thoughts. Pat

  • Does anyone know why HELP doesn't open in photoshop 8

    does anyone know why HELP doesn't open in photoshop ele ements 8?

  • Best oracle RAC book

    can any one suggest me a best oracle book beyond documentation... sure, we can understand all the concepts through the documentation. have gone through clusterware administration and rac administration twice. can any one tell me best book for trouble