-
Expert Member
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
-
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 .
-
Expert Member
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.
-
Junior Member
Re: Anonymous Block
what is Anonymous Block ?
-
Expert Member
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
-
Forum Rules