How To Define an Anonymous Block?
Submitted by: AdministratorAn anonymous block must have an execution part, which is a group of other PL/SQL statements enclosed in the BEGIN ... END statement. Here is a script on how to define a simple anonymous block with SQL*Plus:
SQL> set serveroutput on;
SQL> begin
2 dbms_output.put_line('Hello world!');
3 end;
4 /
Hello world!
PL/SQL procedure successfully completed.
"set serveroutput on;" allows dbms_output.put_line() to work.
"/" runs the anonymous block, which print the "Hello world!" message.
Submitted by: Administrator
SQL> set serveroutput on;
SQL> begin
2 dbms_output.put_line('Hello world!');
3 end;
4 /
Hello world!
PL/SQL procedure successfully completed.
"set serveroutput on;" allows dbms_output.put_line() to work.
"/" runs the anonymous block, which print the "Hello world!" message.
Submitted by: Administrator
Read Online Oracle Database Job Interview Questions And Answers
Top Oracle Database Questions
☺ | How To Write Date and Time Interval Literals in Oracle? |
☺ | How Oracle Handles Dead Locks? |
☺ | How To Use Values from Other Tables in UPDATE Statements using Oracle? |
☺ | How To Recover a Dropped Table in Oracle? |
☺ | What Is Input Buffer in SQL*Plus? |
Top DB Oracle Categories
☺ | Oracle PL-SQL Interview Questions. |
☺ | Oracle DBA Interview Questions. |
☺ | Oracle D2K Interview Questions. |
☺ | OCI Interview Questions. |
☺ | Oracle RMAN Interview Questions. |