How can i declare a abstract datatype with not null columns.
I tried this
create or replace type temp_type as object
(id number not null) ;
/
but i am getting following error
Warning: Type created with compilation errors.
SQL> sho err
Errors for TYPE CCAS_TEMP_OBJ:
LINE/COL ERROR
-------- -----------------------------------------------------------------
2/2 PLS-00218: a variable declared NOT NULL must have an
initialization assignment
Then i tried
SQL> create or replace type ccas_temp_obj as object
2 (id number not null := 12) ;
3 /
Warning: Type created with compilation errors.
SQL> sho err
Errors for TYPE CCAS_TEMP_OBJ:
LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0 PL/SQL: Compilation unit analysis terminated
2/2 PLS-00363: expression 'RESP_CD' cannot be used as an assignment
target
Can someone please advise how should i do this.
Thanks,