如何插入 REF 表?
CREATE TYPE artist_table_type AS TABLE OF REF artist_type;
/
INSERT INTO track_table VALUES (
1,
'test title',
123,
to_date('12-09-1989', 'dd-mm-yyyy'),
artist_table_type(
-- What goes here???
),
artist_table_type());
我想在此表中插入对象引用的嵌套表。我可以这样做吗?我必须取消这张桌子的嵌套吗?
CREATE TYPE artist_table_type AS TABLE OF REF artist_type;
/
INSERT INTO track_table VALUES (
1,
'test title',
123,
to_date('12-09-1989', 'dd-mm-yyyy'),
artist_table_type(
-- What goes here???
),
artist_table_type());
I want to insert into this table a nested table of references to objects. Can I do this? Am I going to have to un-nest this table?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 COLLECT 和 CAST 函数在 SQL 中创建嵌套表。例如,如果您想根据某些条件从其他表中选择艺术家对象,我相信这应该可行:
You can create a nested table within SQL by using the COLLECT and CAST functions. For instance, if you want to select artist objects from some other table based on some condition, I believe this should work:
该列的其余部分将正常插入,上面的代码用于插入嵌套表。
如果您不明白,请告诉我。
Rest of the column will be inserted normally and the above code is used to insert into nested table.
Let me know if you didn't understand.