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 |
How can we debug in PL/SQL?
Are left and right joins the same?
Why we use join in sql?
how do you control the max size of a heap table? : Sql dba
Can you have more than one trigger on a table?
I have 2 packages A and B. Now package A references Package B and Package B references Package A. How do you compile such inter-dependent objects in PL/SQL
5 Answers Doyensys, Infosys, Metric Stream,
what is blob? : Sql dba
How to make a copy values from one column to another in sql?
What is cursor status?
Can we write dml inside a function in sql server?
what is primary key? : Sql dba
Is sql free?