---
title: "How to Create TYPE Object in Oracle PLSQL"
description: "Here is sample PLSQL code to create internal variable using TYPE statement."
url: https://srinimf.com/2022/01/01/how-to-create-type-data-type-in-plsql/
date: 2022-01-01
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2022/01/type-object-in-plsql.jpg?fit=2240%2C1260&ssl=1
categories: ["PL/SQL"]
tags: ["PLSQL Type data type"]
type: post
lang: en
---

# How to Create TYPE Object in Oracle PLSQL

Here is a way to create **%TYPE object **[in Oracle](https://srinimf.com/2012/07/21/sql-what-is-package/). The purpose of TYPE statement is to create a variable of the same as table column data type.

![](https://i0.wp.com/srinimf.com/wp-content/uploads/2022/01/type-object-in-plsql.jpg?resize=2240%2C1260&ssl=1)

Let us say you have created a **Table called X**. It has three columns such as emp_id, emp_name, and emp_slaray. Table X columns data-types: emp_id *number(6)*, emp_name *varchar2 (20)*, and emp_salary *number(6)*

IN THIS PAGE

1. [Creating variable using TYPE](https://srinimf.com/2022/01/01/how-to-create-type-data-type-in-plsql/#logic-to-create-an-internal-variable)
2. [Creating array using TYPE](https://srinimf.com/2022/01/01/how-to-create-type-data-type-in-plsql/#creating-array-using-type)

## Creating variable using TYPE

Here V_SALARY data type and emp_salaqry data type are the same since %TYPE added for x.emp_salary.

```
DECLARE
 V_SALARY X.emp_salary%TYPE
BEGIN
 NULL;
END;
```

## Creating array using TYPE

Here is the logic to create an internal array. Define array using the **TYPE array_name**. **TYPE array_name**.

Related[PLSQL Procedures – Top Syntax Rules](https://srinimf.com/2015/04/30/pl-sql-syntax-rules/)

```
DECLARE 
    TYPE EmpSSNarray 
      IS TABLE OF X.emp_id%TYPE 
      INDEX BY SIMPLE_INTEGER;
```

Related posts

- [PL/SQL – Complex Queries (Job Interviews)](https://srinimf.com/2013/12/08/plsql-complex-queries-job-interviews/)DateDecember 8, 2013
- [PLSQL Procedures – Top Syntax Rules](https://srinimf.com/2015/04/30/pl-sql-syntax-rules/)DateApril 30, 2015
- [Top SQL, PySpark, and AWS Cluster Interview Questions with Answers](https://srinimf.com/2025/09/19/top-sql-pyspark-and-aws-cluster-interview-questions-with-answers/)DateSeptember 19, 2025

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2022%2F01%2F01%2Fhow-to-create-type-data-type-in-plsql%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2022%2F01%2Ftype-object-in-plsql.jpg%3Ffit%3D1200%252C675%26ssl%3D1&description=How%20to%20Create%20TYPE%20Object%20in%20Oracle%20PLSQL)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2022/01/01/how-to-create-type-data-type-in-plsql/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2022/01/01/how-to-create-type-data-type-in-plsql/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2022/01/01/how-to-create-type-data-type-in-plsql/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2022/01/01/how-to-create-type-data-type-in-plsql/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20How%20to%20Create%20TYPE%20Object%20in%20Oracle%20PLSQL&body=https%3A%2F%2Fsrinimf.com%2F2022%2F01%2F01%2Fhow-to-create-type-data-type-in-plsql%2F&share=email)
-

### Like this:

Like Loading…
