Home » SQL & PL/SQL » SQL & PL/SQL » ORA-02315: Incorrect number of arguments for default constructor (SQLPLUS Oracle database 11g express edition 11.2.0.2.0 64bit)
ORA-02315: Incorrect number of arguments for default constructor [message #677830] Mon, 14 October 2019 13:50 Go to next message
bo
Messages: 5
Registered: October 2019
Junior Member

create type paper_t as object(
  author varchar2(4),
  title varchar2(9),
  first int,
  last int
);
/
create type paper_nt as table of paper_t;
/
create type location_t as object(
  city varchar2(6),
  country varchar(6)
);
/
create type location_nt as table of location_t;
/
create type AC_t as object(
  year int,
  location location_nt,
  papers paper_nt
);
/
create type AC_nt as table of AC_t;
/
create table conference(
  name varchar2(4),
  AnnualConferences AC_nt)
  nested table AnnualConferences store as AC_tb(
  nested table location store as location_tb
  nested table papers store as paper_tb
);


--inserts values into tables
insert into conference values(
  'VLDB', AC_nt(
    AC_t(2019,
      location_nt(
        location_t('Paris', 'France'))),
    AC_t(2018,
      location_nt(
        location_t('Ottawa','Canada'))),
    paper_nt(
       paper_t('Andy', 'Databases',1,10),
       paper_t('Barb','Algebra',11,20),
       paper_t('Doug','Calculus',21,30),
       paper_t('John','ODMG',1,10),
       paper_t('Barb', 'SQL',11,20))));


error occurs when second AC_t table is being made. Help would be greatly appreciated
Re: ORA-02315: Incorrect number of arguments for default constructor [message #677831 is a reply to message #677830] Mon, 14 October 2019 14:08 Go to previous messageGo to next message
Michel Cadot
Messages: 66722
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

"paper_nt" is part of "AC_t" and so must be included in either "AC_t(2019" or "AC_t(2018" next to "location_nt" of one of them, or you have to change the definition of your types and table.

[Updated on: Mon, 14 October 2019 14:08]

Report message to a moderator

Re: ORA-02315: Incorrect number of arguments for default constructor [message #677832 is a reply to message #677831] Mon, 14 October 2019 14:26 Go to previous message
bo
Messages: 5
Registered: October 2019
Junior Member
Fixed it, thank you!
Previous Topic: ORA-02320/ 00904 nested table error
Next Topic: Oracle - path passing by multiple nodes
Goto Forum:
  


Current Time: Wed Dec 11 19:10:45 CST 2019