Monday, January 26, 2009

select a random row in oracle database

when you run a select query everytime it will return the same rows. If you wanna make it different every time that is randomly, then you can use it,
SELECT col_name  FROM
(SELECT col_name
FROM table_name
ORDER BY dbms_random.value)
WHERE rownum = 1;

Sunday, January 25, 2009

Nijhum Dip, How to go

Nijhum Dwip is an offshore island in the Bay of Bengal situated in the extreme south of Hatia island which is separated by Hatia channel. There are several approaches to the island. Passenger launches everyday plies between Sadarghat in Dhaka to Tomoruddy Ghat of Hatia upazilla. Adventure tourists can hire a trawler from Tomoruddy to Nijhum Dwip. A trawler may cost between Tk 1,200 and Tk 1,500 per day. Another approach is from Chittagong. A coastal passenger vessel plies between Chittagong and Nalchira Ghat twice a week. Our Star Holiday team took the sea-truck ride from Char Jabber Ghat to Nalchira Ghat at the the northern tip of Hatia which took around two and a half hours. For overnight stay in the island you have to contact the UNO of Hatia in advance for booking the bungalow on the island, or you can contact the DFO of Noakhali to stay at Nijhum Dwip forest office. You must carry your food and other necessities.

Saturday, January 24, 2009

Nijhum Dip , The Real Beauty.

Nijhum Deep is a very precious island, as it was concealed by water for many years. The island slowly started to surface, and since 1972 the forestry department has been involved in the planting of trees and brush such as Bain, Keowra and Geowra. The forest, which is irrigated by the bay, has also attracted a great number of bird species. By 1978, wildlife was introduced to the island, and the eight spotted deer that were originally released on the island have grown to a healthy population of approximately six thousand individuals.

The spotted deer share Nijhum Deep with various other animals such as snakes, buffalo and monkeys, and it is estimated that almost thirty-five bird species are permanent residents of the island. Migratory birds also find the island the perfect resting destination as it is almost untouched and not threatened by human interaction. The beaches and sightings of crabs, sea snails and oysters create great excitement amongst tourists, as they are able to appreciate nature against the backdrop of the lush, green landscapes.

The authorities have made the island more attractive to tourists by erecting visitor facilities along the beaches. Viewing a sunset or sunrise from the shores of this tranquil and inspiring natural paradise is unforgettable. Bangladesh has realized how significant and important their wildlife and nature can be for the economy and tourism industry and is looking at creating more protected areas within the country. Nijhum Deep is the perfect example of how conservation and forestry can, not only assist and ensure the survival of animals, but enhance an industry and a country.

Tuesday, January 13, 2009

Family Name and Given Name

We have to face question about family name and given name Lot of time while filling the forms. Basically,
Family Name: Last name
Given Name: Rest of the part of full name.

Sunday, January 11, 2009

Scope of the Loop Counter Variable

<< main>>
DECLARE
i NUMBER := 5;
BEGIN
FOR i IN 1..3 LOOP -- assign the values 1,2,3 to i
DBMS_OUTPUT.PUT_LINE( 'local: ' || TO_CHAR(i)
|| ' global: ' || TO_CHAR(main.i));
END LOOP;
END main;
/


The variable 'i' is used inside the loop as well as outside of the loop. Now if we wanna use the outer variable inside the loop having the same name as the loop counter then we have to use lebel.Here , 'main' is the name of the lebel.

Reverse FOR..LOOP in PL/SQL

Normal For Loop:
FOR k IN 1..500 LOOP
p := p + 1;
END LOOP;

Reverse For Loop:
BEGIN
FOR i IN REVERSE 1..3 LOOP -- assign the values 1,2,3 to i
DBMS_OUTPUT.PUT_LINE (TO_CHAR(i));
END LOOP;
END;
/

Exit the Loop in PL/SQL

IF and EXIT:
DECLARE
credit_rating NUMBER := 0;
BEGIN
LOOP
credit_rating := credit_rating + 1;
IF credit_rating > 3 THEN
EXIT; -- exit loop immediately
END IF;
END LOOP;
END;
/

EXIT and WHEN:
DECLARE
credit_rating NUMBER := 0;
BEGIN
LOOP
credit_rating := credit_rating + 1;
EXIT WHEN credit_rating > 3; -- exit loop immediately
END LOOP;
END;
/

search engine

Custom Search