需要有关 Oracle 10g Express 版本的帮助
当我尝试在下表中插入记录时,出现错误“ora-03001:未实现的功能”。我找了一整夜,还是没有成功。我使用的是 Oracle10g Express 版本。
create or replace type MajorsType As varray(20) of varchar2(10);
create or replace type studenttype as object (
stuID varchar2(5),
lastName varchar2(15),
firstName varchar2(12),
majors MajorsType)
INSTANTIABLE
NOT FINAL;
create table Student of StudentType (
constraint student_stuID_pk PRIMARY KEY(stuID));
INSERT INTO student values StudentType ('S999', 'Smith', 'John', MajorsType('Math', 'Accounting'));
I got error "ora-03001: unimplemented feature" when I try to insert a record on table below. I've searched all night, still no luck. I'm using Oracle10g express edition.
create or replace type MajorsType As varray(20) of varchar2(10);
create or replace type studenttype as object (
stuID varchar2(5),
lastName varchar2(15),
firstName varchar2(12),
majors MajorsType)
INSTANTIABLE
NOT FINAL;
create table Student of StudentType (
constraint student_stuID_pk PRIMARY KEY(stuID));
INSERT INTO student values StudentType ('S999', 'Smith', 'John', MajorsType('Math', 'Accounting'));
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个简单的语法错误:VALUES 子句要求将所有内容都括在括号中:
无论我们传递多个标量值还是单个类型,这都适用。
它不适用的一种情况是使用 RECORD 类型在 PL/SQL 中插入。这与您的情况无关,但我提及它是为了完整性。
插入一个 RECORD 变量看起来像这样
It's a simple syntax error: the VALUES clause requires everything to be wrapped in parentheses:
This applies whether we're passing in several scalar values or a single type.
The one case when it doesn't apply is an insert in PL/SQL using a RECORD type. Which is not relevant to your situation, but I'm mentioning it for completeness.
Inserting a RECORD variable would look something like this