Hi,I am creating a table of chats. The chat can be either a private chat or a public chat and so I have created a chat_type object and created types private_chat_type and public_chat_type under chat type as belowCREATE TYPE chat_type AS OBJECT(chat_id VARCHAR(20), content VARCHAR(100), user_id VARCHAR(20),ditto NUMBER, ditto_user_id VARCHAR(20), datechat DATE, time_zone VARCHAR(20), tags VARCHAR(100)) NOT FINAL;/CREATE TYPE private_chat_type UNDER chat_type(receiver_user_id VARCHAR(20), parent_chat_id VARCHAR(20), reply_flag VARCHAR(10));/CREATE TYPE public_chat_type UNDER chat_type();/create TABLE chat_table OF chat_type(PRIMARY KEY(chat_id));
Now, when I insert values in the chat_table I get an error sayingERROR at line 1:ORA-02315: incorrect number of arguments for default constructor
The syntax I have used to insert values are as below. INSERT INTO chat_table VALUES( public_chat_type( NULL, NULL, NULL), chat_type( 'p1', 'I lost', 'u26', 1, 'u26', to_date('9/30/2009 5:00','MM/DD/YYYY mi:ss'), -5, 'hello' ) );INSERT INTO chat_table VALUES( private_chat_type( u2, NULL, F), chat_type( 'p1', 'Hi there', 'u21', 1, 'u36', to_date('9/30/2009 5:00','MM/DD/YYYY mi:ss'), -5, 'welcome' ) );Could you please help me figure out the problem in my SQL statements.Thanks.