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 materialised View?
What is indexing in sql and its types?
Explain the components of sql?
What is the maximum number of rows in sql table?
How many types of relationship are there?
Compare sql & pl/sql
Does mysql support pl sql?
What is coalesce in sql?
How to add Foreign key in a table after the creation of the table?
What is materialized view in sql?
How do I filter in sql profiler?
how to check the 3rd max salary from an employee table?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)