Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Modify VARRAY to store Phone Numbers int prefix, dialling code, number

921075Mar 1 2012 — edited Mar 1 2012
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

CREATE OR REPLACE TYPE TEL_NO AS VARRAY(3) OF VARCHAR2(13);

I need to store telephone numbers in separate values (international prefix, dialling code, number) currently I have them set as a simple 13 character string.

Can this be done in pl/sql this needs to be kept as a VARRAY, and can I query it to drop the 0 after the international prefix?)

is the info I have.

CREATE TYPE PhoneNumber AS VARRAY(3) OF VARCHAR2(13);
CREATE TYPE EmployeeType AS OBJECT
(
customer_id NUMBER(5),
customer_surname VARCHAR2(20),
customer_forename VARCHAR2(25),
customer_dob DATE,
customer_address AddressType,
customer_phones PhoneNumber,
MEMBER FUNCTION get_address RETURN VARCHAR2
) NOT FINAL;

I need a query to call the phone number and display it in pl/sql oracle 11g
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 29 2012
Added on Mar 1 2012
4 comments
514 views