ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 047-076

047-076

原创 Linux操作系统 作者:jbymy2000 时间:2012-03-18 10:29:49 0 删除 编辑
76. View the Exhibit and examine the structure of the ORDERS table.
Which UPDATE statement is valid?
A. UPDATE orders SET order_date = '12mar2007',
order_total IS NULL WHERE order_id = 2455;
B. UPDATE orders SET order_date = '12-mar-2007',
order_total = NULL WHERE order_id = 2455;
C. UPDATE orders
SET order_date = '12mar2007' AND order_total = TO_NUMBER(NULL)
WHERE order_id = 2455;
D. UPDATE orders
SET order_date = TO_DATE('12mar2007','ddmonyyyy'),
SET order_total = TO_NUMBER(NULL)
WHERE order_id = 2455;
Answer: B
Null是不能转换的
1:SQL> create table orders(order_id number(12),order_date timestamp(6) with
local time zone,order_total number(2));
2: SQL> insert into orders(order_id) values(1);
3: SQL> UPDATE orders SET order_date = '12-mar-2007',
order_total = NULL WHERE order_id = 1;
第 1 行出现错误:ORA-01843: 无效的月份
4: SQL> UPDATE orders SET order_date = '20-JUN-11 02.03.18.000000 PM',
order_total = NULL WHERE order_id = 1; ok

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11312660/viewspace-718855/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 047-075
下一篇: 047-077
请登录后发表评论 登录
全部评论

注册时间:2012-01-10

  • 博文量
    416
  • 访问量
    204125