--Case Statement
SET SERVEROUTPUT ON
SET VERIFY OFF
DECLARE
v_user_date DATE := TO_DATE('&user_date','DD-MON-YYYY');
BEGIN
CASE TO_CHAR(v_user_date,'D')
WHEN '1' THEN
dbms_output.put_line('Today is Monday');
WHEN '2' THEN
dbms_output.put_line('Today is Tuesday');
WHEN '3' THEN
dbms_output.put_line('Today is Wednesday');
WHEN '4' THEN
dbms_output.put_line('Today is Thursday');
WHEN '5' THEN
dbms_output.put_line('Today is Friday');
WHEN '6' THEN
dbms_output.put_line('Today is Saturday');
ELSE
dbms_output.put_line('Today is Sunday');
END CASE;
END;
/
Enter value for user_date: 01-JAN-2011
Today is Saturday
PL/SQL procedure successfully completed.
Monday, December 27, 2010
Subscribe to:
Post Comments (Atom)
External Table
Oracle External Table External tables are defined as tables that do not resides in the database allows you to access data that is stor...
-
Table clustering is an optional technique of storing data. In table clustering, rows from one or more tables those are associated with ea...
-
Oracle PL/SQL block accepts user input information with the help of substitution variable. Substitute variable can not be used to output va...
-
Finally continue statement added to oracle 11g PL/SQL language. It signals an immediate end to a loop iteration and return to first statemen...
No comments:
Post a Comment