https://stackoverflow.com/questions/10848277/difference-between-object-and-record-type
Difference between object and record type
Ask Question 22 5
I am just curious whats the difference between object and record type in oracle, More specifically between the below declarations
create type emp2_oty is object
(
empno number,
ename varchar2(20),
deptno number
);
create type emp2_nt is table of emp2_oty;
and
type emp2_oty is record
(
empno number,
ename varchar2(20),
deptno number
);
create type emp2_nt is table of emp2_oty;
Please elaborate.
6,75843253
asked Jun 1 '12 at 10:06
60331123
-
1
basically, record is a pl/sql type, and object types are UDTs that can exist outside pl/sql. Which one you choose depends on your needs really. – tbone Jun 1 '12 at 11:30
-
Objects also have methods, while records only have fields; but the SQL vs. PL/SQL is more relevant here. – Alex Poole Jun 1 '12 at 11:44
add a comment
2 Answers
10
The OBJECT type can be stored in the database and can be used in both SQL and PL/SQL
answered Jun 1 '12 at 10:11
275417
add a comment
29
-
record:
Cannot be stored in the database. Cannot be recursively referenced. Cannot have logic defined as part of their definition.
-
object:
Can be stored as a database table column or as an entire row. Can be recursively referenced using the SELF parameter. Can have logic defined as part of their definition using member methods.
记录:
无法存储在数据库中。
不能递归引用。
不能将逻辑定义为其定义的一部分。
对象:
可以存储为数据库表列或整行。
可以使用self参数递归引用。
可以使用成员方法将逻辑定义为其定义的一部分。
answered Nov 6 '12 at 17:57
32134
https://stackoverflow.com/questions/10848277/difference-between-object-and-record-type
http://www.itpub.net/thread-1882302-1-1.html
关于oracle中record与object的疑惑[复制链接] |
论坛徽章: 1 | 1# 发表于 2014-8-7 10:58 | 只看该作者
| |||
| ||||
使用道具 举报 回复 | ||||
论坛徽章: 168 | 2# 发表于 2014-8-7 12:14 | 只看该作者
| |
使用道具 举报 回复 | ||
论坛徽章: 1 | 3# 楼主| 发表于 2014-8-8 09:33 | 只看该作者
| |
http://www.itpub.net/thread-1882302-1-1.html
http://www.itpub.net/thread-1265785-1-1.html
请教create object 和type XXX is record有什么区别呢[复制链接] |
论坛徽章: 5 | 1# 发表于 2010-1-29 20:22 | 只看该作者
| |
| ||
使用道具 举报 回复 | ||
论坛徽章: 530 | 2# 发表于 2010-1-29 22:23 | 只看该作者
| |
使用道具 举报 回复 | ||
论坛徽章: 38 | 3# 发表于 2010-1-29 22:24 | 只看该作者
| |
http://www.itpub.net/thread-1265785-1-1.html
http://www.itpub.net/thread-1157164-1-1.html
bject和records[复制链接] |
论坛徽章: 1
| 1# 发表于 2009-4-27 11:46 | 只看该作者
| |
| ||
使用道具 举报 回复 | ||
论坛徽章: 6
| 2# 发表于 2009-4-28 23:57 | 只看该作者
|
http://www.itpub.net/thread-1157164-1-1.html