PL/SQL CASE语句(挑战题编号000006)
问题:执行以下脚本后,屏幕会显示什么?
DECLARE the_text VARCHAR2 (100); BEGIN DECLARE todays_date DATE := TO_DATE ('241210', 'DDMMRR'); BEGIN CASE TO_NUMBER (TO_CHAR (todays_date, 'DD')) WHEN 23 THEN the_text := 'Not yet Xmas'; WHEN 25 THEN the_text := 'Xmas day'; END CASE; the_text := 'Santa is coming (for some, sort of, maybe)'; EXCEPTION WHEN OTHERS THEN the_text := 'Today is the 24th'; END; DBMS_OUTPUT.put_line (the_text); END;
选项1:
Not yet Xmas
选项2:
Xmas day
选项3:
Santa is coming (for some, sort of, maybe)
选项4:
Today is the 24th
答案:http://www.anguora.com/plsql挑战答案/
分类: PL/SQL挑战