how to create object in plsql
Answers were Sorted based on User's Feedback
Answer / madhavi
SQL> set serverout on
SQL>
SQL> create or replace
2 type new_person as object (
3 last_name varchar2(100),
4 phone varchar2(100),
5 member function get_last_name return varchar2,
6 member function get_phone_number return varchar2 )
7 not final
8 /
Type created.
Is This Answer Correct ? | 11 Yes | 0 No |
Answer / chandu
create type addresstype as object
(hno varchar2(5),street varchar2(10),
city varchar2(10),pin varchar2(5));
Now we use this object in creating table like this.
create table employee(empno number(5),job varchar2(10),sal
number(5),empaddress addresstype);
insert into employee
values(101,'clerk',6000,addresstype('114a','gandhi','hyd',50001));
Is This Answer Correct ? | 0 Yes | 0 No |
what is a trigger? : Sql dba
what is Complex index. how to create it?
what is an index? : Sql dba
What type of database is sql?
What is data abstraction in sql?
what is the functionality of the function htmlentities? : Sql dba
I have a Employee table with columns ename,eid,salary,deptno. How to retrieve sum of salary for each deptno?
What is hibernate and its relation to sql?
What does an inner join do?
What is a full join?
What is pl sql package?
what is a sub query?how will you calculate working days in a month using sub query?