Mohammed Alaslani Blog

April 10, 2010

Anonymous Block PL SQL

Filed under: Uncategorized — maslani4 @ 2:53 pm

In this blog i will give an example of creating Anonymous Block in SQL :

First of all you have to use the server output on so it can show you the result of your Anonymous Block .

Secondly you can declare any variable you want to use , and then begin work on it , you can use loops if want to , it is up to you what do you want with this Anonymous Block .

And finally you have to close everythig by using the keyword END;

This a simple example of Anonymous Block PL SQL that will print (Hello World).

SET SERVEROUTPUT ON

DECLARE

TXT VARCHAR2(20) = ‘Hello World’;

BEGIN

DBMS_OUTPUT.PUT_LINE(TXT);

END;

The result will be = Hello World

Written by : Mohammed Alaslani

Advertisement

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.