---
description: Identifiers in PL/SQL are nothing but names given to a PL/SQL object. The object could be constant, variable, exception, function, package, trigger, or label.
title: PL/SQL Acceptable Identifiers, Variable &#038; Naming Conventions
image: https://www.guru99.com/images/plsql-identifiers-naming-conventions.png
---

 

[Skip to content](#main) 

**⚡ Smart Summary**

PL/SQL Identifiers are the names given to PL/SQL objects such as variables, constants, cursors, and procedures. They must start with a letter, stay within 30 characters, are case-insensitive, and follow naming conventions that signal a variable’s level and type.

* 🏷️ **Definition:** An identifier names any PL/SQL object, from a variable to a package or label.
* 📏 **Rules:** Must begin with a letter, be at most 30 characters, and contain no whitespace.
* 🔠 **Allowed Signs:** Dollar sign, underscore, and hash are permitted inside an identifier.
* 🧭 **Naming Convention:** The first letter marks the level (P, L, G) and the second marks the type (C, V, N, R, T).
* 📦 **Variables:** A variable is an identifier bound to a storage area, declared with a valid data type.
* 📝 **Declaration:** Variables are declared in the declarative section before use.
* ➡️ **Assignment:** A value can be set at declaration or later using the := operator.

[ Read More ](javascript:void%280%29;) 

![PL/SQL Identifiers Naming Conventions](https://www.guru99.com/images/plsql-identifiers-naming-conventions.png)

## What are PL/SQL Identifiers?

**Identifiers** in PL/SQL are the names given to a PL/SQL object. The object could be a constant, variable, exception, cursor, procedure, function, package, trigger, object type, reserved word, or label. Identifiers contain letters, numerals, signs, underscores, and so on. They are case-insensitive and limited to 30 characters in size.

## Properties of PL/SQL Identifiers

Here are the main properties of PL/SQL identifiers:

* Must start with a letter.
* The maximum size is limited to 30 characters.
* Cannot contain whitespace characters.
* Can contain a dollar sign (‘$’), underscore (‘\_’), and hash sign (‘#’).
* Is case-insensitive.

## Naming Conventions in PL/SQL

In a complex program, we may have to include many identifiers, such as variables and cursors. To avoid confusion and increase readability, we need to follow certain naming conventions.

**The commonly used naming conventions in PL/SQL are as follows.**

The first letter specifies the declared level of the variable:

* ‘P’ – variable declared at the parameter level.
* ‘L’ – variable declared at the local block.
* ‘G’ – variable declared at the global level.

The second letter specifies the type of identifier:

* ‘C’ – cursor identifier.
* ‘V’ – VARCHAR and CHAR data type.
* ‘N’ – NUMBER data type.
* ‘R’ – [record type](https://www.guru99.com/pl-sql-record-type.html).
* ‘T’ – table type.

Below are some examples of proper naming conventions in PL/SQL:

* Lv\_name – local level variable of VARCHAR/CHAR data type.
* Pc\_num – parameter level cursor identifier.
* Gn\_user\_id – global level variable of [numerical data type](https://www.guru99.com/pl-sql-data-types.html).

## PL/SQL Variables

**Variables** in PL/SQL are basic identifiers assigned to a storage area that a program can manipulate. Variables are placeholders where the user can store values. These variables need to be associated with a valid PL/SQL data type before use. Data types define the storage and processing methods for these variables.

### RELATED ARTICLES

* [PL/SQL Hello World Program (Example) ](https://www.guru99.com/pl-sql-first-program-helloworld.html "PL/SQL Hello World Program (Example)")
* [Oracle PL/SQL Object Types: CREATE TYPE with Examples ](https://www.guru99.com/object-types-pl-sql.html "Oracle PL/SQL Object Types: CREATE TYPE with Examples")
* [Oracle PL/SQL Dynamic SQL Tutorial: Execute Immediate & DBMS\_SQL ](https://www.guru99.com/dynamic-sql-pl-sql.html "Oracle PL/SQL Dynamic SQL Tutorial: Execute Immediate & DBMS_SQL")
* [Oracle PL/SQL Cursor: Implicit, Explicit, For Loop with Example ](https://www.guru99.com/pl-sql-cursor.html "Oracle PL/SQL Cursor: Implicit, Explicit, For Loop with Example")

## PL/SQL Variable Declaration

Variables are mainly used to store data during data manipulation or processing. They must be declared before use, inside the declarative section of the [PL/SQL blocks](https://www.guru99.com/blocks-pl-sql.html).

Declaring a variable is the process of assigning a name to the placeholder and associating it with a valid data type.

### Syntax

<variable_name> <datatype>;

The syntax above shows how to declare a variable in the declarative section.

## Data Storing in PL/SQL Variables

Once a variable is declared, it is ready to hold data of the defined type. The values can be assigned either in the execution section or at the time of declaration. The value can be a literal or another variable’s value. Once assigned, it is stored in the memory space allocated for that variable.

### Syntax

<variable_name> <datatype> := <default_value>;

The syntax above shows how to declare a variable and assign a value in the declarative section.

<variable_name> <datatype>;
<variable_name> := <value>;

The syntax above shows how to assign a value to an already declared variable.

**Example 1:** In this example, we learn how to declare a variable and assign a value to it. We print ‘GURU99’ in the following program using variables.

[](https://www.guru99.com/images/PL-SQL/110215%5F1229%5FPLSQLIdenti4.png)

DECLARE
lv_name VARCHAR2(50);
lv_name_2 VARCHAR2(50) := 'GURU99';
BEGIN
lv_name := lv_name_2;
dbms_output.put_line(lv_name);
END;
/

### Code Explanation

* **Code line 2:** Declaring the variable ‘lv\_name’ of VARCHAR2 with size 50.
* **Code line 3:** Declaring the variable ‘lv\_name\_2’ of VARCHAR2 with size 50 and assigning the default value using the literal ‘GURU99’.
* **Code line 5:** The value for variable ‘lv\_name’ is assigned from the variable ‘lv\_name\_2’.
* **Code line 6:** Printing the stored value of variable ‘lv\_name’.

When the above code is executed, you get the following output.

### Output

GURU99

## FAQs

📏 What are the rules for a valid PL/SQL identifier?

It must start with a letter, be at most 30 characters, contain no whitespace, and use only letters, digits, and the signs dollar, underscore, and hash. Identifiers are case-insensitive.

🧭 Why follow a naming convention like Lv\_ or Gn\_?

The prefix encodes the scope and type at a glance, so Lv\_name reads as a local varchar variable. In a large block this reduces confusion and makes the code easier to maintain.

➡️ What is the difference between = and := in PL/SQL?

The := operator assigns a value to a variable. A single = is used for comparison inside conditions. Mixing them is a common beginner error that causes a compile-time failure.

🤖 Can AI enforce a naming convention across PL/SQL code?

Yes. AI can scan a package, flag identifiers that break the agreed prefixes, and propose renames. It can also generate consistent names for new variables based on their scope and type.

🔠 Are PL/SQL identifiers case-sensitive?

No. lv\_name and LV\_NAME refer to the same identifier. Only string literals in single quotes are case-sensitive, so a convention exists for readability, not because the compiler requires it.

#### Summarize this post with:

ChatGPT Perplexity Grok Google AI 

**Stay Updated on AI** **Get Weekly AI Skills, Trends, Actionable Advice.** 

##### Sign up for the newsletter

Subscribe for Free 

You have successfully subscribed.  
Please check your inbox. 

![AI-Newsletter]() Chosen by over **350,000+** professionals 

[Scroll to top ](#wrapper)Scroll to top 

× 

Toggle Menu Close 

Search for: 

Search

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.guru99.com/#organization","name":"Guru99","sameAs":["https://www.facebook.com/Guru99Official","https://twitter.com/guru99com"],"logo":{"@type":"ImageObject","@id":"https://www.guru99.com/#logo","url":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","contentUrl":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","caption":"Guru99","inLanguage":"en-US"}},{"@type":"WebSite","@id":"https://www.guru99.com/#website","url":"https://www.guru99.com","name":"Guru99","publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https://www.guru99.com/images/plsql-identifiers-naming-conventions.png","url":"https://www.guru99.com/images/plsql-identifiers-naming-conventions.png","width":"700","height":"250","caption":"PL/SQL Identifiers &amp; Naming Conventions","inLanguage":"en-US"},{"@type":"BreadcrumbList","@id":"https://www.guru99.com/pl-sql-identifiers.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":"1","item":{"@id":"https://www.guru99.com","name":"Home"}},{"@type":"ListItem","position":"2","item":{"@id":"https://www.guru99.com/pl-sql","name":"PL-SQL"}},{"@type":"ListItem","position":"3","item":{"@id":"https://www.guru99.com/pl-sql-identifiers.html","name":"PL/SQL Acceptable Identifiers, Variable &#038; Naming Conventions"}}]},{"@type":"WebPage","@id":"https://www.guru99.com/pl-sql-identifiers.html#webpage","url":"https://www.guru99.com/pl-sql-identifiers.html","name":"PL/SQL Acceptable Identifiers, Variable &#038; Naming Conventions","dateModified":"2026-07-22T16:22:53+05:30","isPartOf":{"@id":"https://www.guru99.com/#website"},"primaryImageOfPage":{"@id":"https://www.guru99.com/images/plsql-identifiers-naming-conventions.png"},"inLanguage":"en-US","breadcrumb":{"@id":"https://www.guru99.com/pl-sql-identifiers.html#breadcrumb"}},{"@type":"Person","@id":"https://www.guru99.com/author/fiona","name":"Fiona Brown","description":"I'm Fiona brown, a Full Stack Developer with over a decade of experience, sharing practical guides on robust and scalable application development.","url":"https://www.guru99.com/author/fiona","image":{"@type":"ImageObject","@id":"https://www.guru99.com/images/fiona-brown-author.png","url":"https://www.guru99.com/images/fiona-brown-author.png","caption":"Fiona Brown","inLanguage":"en-US"},"worksFor":{"@id":"https://www.guru99.com/#organization"}},{"articleSection":"PL-SQL","headline":"PL/SQL Acceptable Identifiers, Variable &#038; Naming Conventions","description":"Identifiers in PL/SQL are nothing but names given to a PL/SQL object. The object could be constant, variable, exception, function, package, trigger, or label.","keywords":"pl-sql","speakable":{"@type":"SpeakableSpecification","cssSelector":[".entry-title",".summary"]},"@type":"Article","author":{"@id":"https://www.guru99.com/author/fiona","name":"Fiona Brown"},"dateModified":"2026-07-22T16:22:53+05:30","image":{"@id":"https://www.guru99.com/images/plsql-identifiers-naming-conventions.png"},"copyrightYear":"2026","name":"PL/SQL Acceptable Identifiers, Variable &#038; Naming Conventions","subjectOf":[{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What are the rules for a valid PL/SQL identifier?","acceptedAnswer":{"@type":"Answer","text":"It must start with a letter, be at most 30 characters, contain no whitespace, and use only letters, digits, and the signs dollar, underscore, and hash. Identifiers are case-insensitive."}},{"@type":"Question","name":"Why follow a naming convention like Lv_ or Gn_?","acceptedAnswer":{"@type":"Answer","text":"The prefix encodes the scope and type at a glance, so Lv_name reads as a local varchar variable. In a large block this reduces confusion and makes the code easier to maintain."}},{"@type":"Question","name":"What is the difference between = and := in PL/SQL?","acceptedAnswer":{"@type":"Answer","text":"The := operator assigns a value to a variable. A single = is used for comparison inside conditions. Mixing them is a common beginner error that causes a compile-time failure."}},{"@type":"Question","name":"Can AI enforce a naming convention across PL/SQL code?","acceptedAnswer":{"@type":"Answer","text":"Yes. AI can scan a package, flag identifiers that break the agreed prefixes, and propose renames. It can also generate consistent names for new variables based on their scope and type."}},{"@type":"Question","name":"Are PL/SQL identifiers case-sensitive?","acceptedAnswer":{"@type":"Answer","text":"No. lv_name and LV_NAME refer to the same identifier. Only string literals in single quotes are case-sensitive, so a convention exists for readability, not because the compiler requires it."}}]}],"@id":"https://www.guru99.com/pl-sql-identifiers.html#schema-1148887","isPartOf":{"@id":"https://www.guru99.com/pl-sql-identifiers.html#webpage"},"publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US","mainEntityOfPage":{"@id":"https://www.guru99.com/pl-sql-identifiers.html#webpage"}}]}
```
