QUESTION 34 不可见列INVISIBLE

在 Oracle 12C 中,不可见列是一种特性,允许在不直接影响大多数查询的情况下存储数据。不可见列不会在通配符查询、DESCRIBE 命令和 PL/SQL 的 %ROWTYPE 中显示,但可以在显式引用时访问。尽管如此,不可见列仍可以设置主键约束,但不能设置引用完整性约束,且可以随时变为可见。
摘要由CSDN通过智能技术生成

QUESTION 34
Examine the following command:
CREATE TABLE products (prod_id number(4),
prod_name varchar2(20),
category_id number(30),
quantity_on_hand number(3) INVISIBLE);
Which three statements are true about using an invisible column in the PRODUCTS table?
A. The %ROWTYPE attribute declarations in PL/SQL to access a row will not display the invisible column
in the output.
B. The DESCRIBE commands in SQL *Plus will not display the invisible column in the output.
C. Referential integrity constraint cannot be set on the invisible column.
D. The invisible column cannot be made visible and can only be marked as unused.
E. A primary key constraint can be added on the invisible column.
Correct Answer: ABE
Section: (none)
Explanation
Explanation/Reference:
Explanation:
AB: You can make individual table columns invisible. Any generic access of a table does not show the
invisible columns in the table.
For example, the following operations do not display invisible columns in the output:
* SELECT * FROM statements in SQL
* DESCRIBE commands in SQL*Plus
* %ROWTYPE attribute declarations in PL/SQL
* Describes in Oracle Call Interface (OCI)
Incorrect Answers:
D: You can make invisible columns visible.
You can make a column invisible during table creation or when you add a column to a table, and you can later alter the table to make the same column visible.

 

问题34

检查以下命令:

CREATE TABLE products (prod_id number(4),prod_name varchar2(20),category_id number(30),quantity_on_hand number(3)

在12C中,当一个列被定义为"不可见"的时候,没有直接访问该列的sql语句是无法看到"不可见列"的,显式引用"不可见列"的语句是可以访问和操作该列的。

在create table、create view、alter view、alter table的时候,都可以创建"不可见列"。

 

比如以下的情形是无法使用"不可见列"的:

·使用通配符的语句,如:select * from tabname

·sql*plus中的desc命令

·pl/sql中的"%rowtype"类型

·insert into select * 语句

);

关于在产品表中使用不可见的列,哪三个陈述是正确的?

A.PL/SQL中用于访问行的%ROWTYPE属性声明不会在输出中显示不可见的列。

B. SQL *Plus中的DESCRIBE命令不会显示输出中的invisible列。

C.不能在不可见的列上设置引用完整性约束。

D.不可见栏不能显示,只能标记为未使用。

E.主键约束可以添加到不可见的列上。

正确答案:A.B.E

部分:(一)

解释

解释/参考:

解释:

在12C中,当一个列被定义为"不可见"的时候,没有直接访问该列的sql语句是无法看到"不可见列"的,显式引用"不可见列"的语句是可以访问和操作该列的。

在create table、create view、alter view、alter table的时候,都可以创建"不可见列"。

 

比如以下的情形是无法使用"不可见列"的:

·使用通配符的语句,如:select * from tabname

·sql*plus中的desc命令

·pl/sql中的"%rowtype"类型

·insert into select * 语句

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值