Results 1 to 5 of 5

Thread: Anonymous Block

  1. #1
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    Anonymous Block

    An anonymous block is stored in the user's current session without any name. So you can only define one anonymous block at any time. How to find whether there is any anyonymous block exists? If exists how to view the code in existing anonymous block? Could any one please suggest where can we use these anonymous block in application development?

    Thanks in advance
    Regards
    Krishna


  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Anonymous Block

    An anonymous block is not stored in the database. It is mainly used to test some of the programs. As it is not stored in database, we use named blocks(procedures,Functions,Packages) for application development .


  3. #3
    Expert Member
    Join Date
    Apr 2007
    Answers
    500

    Re: Anonymous Block

    An ANONYMOUS BLOCK is a PL/SQL program that has no name,
    takes no parameters and does not persist in the database.

    A stored procedure is created and stored in the database as a schema object.
    Once created and compiled, it is a named object that can be run without recompiling.Additionally, dependency information is stored in the data dictionary to guarantee the validity of each stored procedure.

    As an alternative to a stored procedure, you can create an anonymous PL/SQL block by sending an unnamed PL/SQL block to the Oracle server from an Oracle tool or an application. Oracle compiles the PL/SQL block and places the compiled version in the shared pool of the SGA, but it does not store the source code or compiled version in the database for reuse beyond the current instance. Shared SQL allows anonymous PL/SQL blocks in the shared pool to be reused and shared until they are flushed out of the shared pool.

    In either case, moving PL/SQL blocks out of a database application and into
    database procedures stored either in the database or in memory, you avoid
    unnecessary procedure recompilations by Oracle at runtime,
    improving the overall performance of the application and Oracle.


  4. #4
    Junior Member
    Join Date
    Jul 2008
    Answers
    1

    Question Re: Anonymous Block

    what is Anonymous Block ?


  5. #5
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    Re: Anonymous Block

    An ANONYMOUS BLOCK is a PL/SQL block without a name.

    Here is a simple example

    Begin
    dbms_output.put_line('Hello');
    end;
    /


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact