GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Oracle  >  Basics

 Print  |  
Question:  Catch The Error

Answer: SQL>DECLARE
2 dayofweek VARCHAR2(200);
3 BEGIN
4 SELECT TO_CHAR(sysdate,'Day') INTO dayofweek FROM DUAL ;
5
6 IF dayofweek = 'Tuesday'
7 THEN
8 DBMS_OUTPUT.PUT_LINE('Aloha!!! Today Is Tuesday');
9 ELSE
10 DBMS_OUTPUT.PUT_LINE('Today is '||to_char(sysdate,'Day'));
11 END IF;
12 END;
13 /
Today is Tuesday

PL/SQL procedure successfully completed.
SQL>

What's wrong in the above anonymous block if anything at all.



October 10, 2008 09:43:52 #6
 nagellikiran1283 Oracle Expert  Member Since: October 2008    Total Comments: 1 

RE: Catch The Error
 
There is nothing wrong in it.
     

 

Back To Question