how to create object in plsql

Answers were Sorted based on User's Feedback



how to create object in plsql..

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

how to create object in plsql..

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 to create object in plsql..

Answer / purushottam mishra

by using dynamic sql

Is This Answer Correct ?    3 Yes 6 No

Post New Answer

More SQL PLSQL Interview Questions

How is a process of pl/sql compiled?

0 Answers  


what is the difference between myisam static and myisam dynamic? : Sql dba

0 Answers  


Hi Everyone, How to get fist and last record from a table in oracle? Thanks in advance

13 Answers   IBM,


Explain what is rdbms?

0 Answers  


What are the different types of triggers?

0 Answers  


What is a cursor for loop ?

4 Answers  


State some properties of relational databases?

0 Answers  


mail-id table contains two columns(email_id,userid) it contains different types of mail-ids,and no of users. here username length is differ na,(ex- tamil@yahoo.com,joshua@hotmail.com like) now i want to fetch the email-ids only starting from '@' (ex-@gmail.com,@yahoo.com,@hotmail.com

5 Answers  


What is the unique index?

0 Answers  


Does asenumerable execute the query?

0 Answers  


Can we connect to postgresql using sql developer?

0 Answers  


Inline the values in PL/SQL, what does it mean.?

0 Answers   MCN Solutions,


Categories