Character types in pl/sql, PL-SQL Programming

Character Types

The Character types allow you to store alphanumeric data, represent words and text, and manipulate the character strings.


You use the CHAR datatype to store the fixed-length character data. How the data is shown internally depends on the database character set. The CHAR datatype takes an optional parameter that specifies a maximum length of up to 32767 bytes. The syntax is shown below:


You cannot use a variable or constant to specify the maximum length; you should use an integer literal in the range 1 to 32767.

If you do not specify the maximum length, it defaults to 1. Keep in mind; you specify the maximum length in bytes, not characters. Therefore, if a CHAR (n) variable stores multi-byte characters, its maximum length is less than n characters.

CHAR Subtype

The CHAR subtype of CHARACTER has the same range of values as its base type. That is, the CHARACTER is just another name for CHAR. You can use this subtype for the compatibility with ANSI/ISO and IBM types or when you want an identifier more expressive than CHAR.

Posted Date: 10/2/2012 2:31:44 AM | Location : United States

Related Discussions:- Character types in pl/sql, Assignment Help, Ask Question on Character types in pl/sql, Get Answer, Expert's Help, Character types in pl/sql Discussions

Write discussion on Character types in pl/sql
Your posts are moderated
Related Questions
Using a join on 3 tables, select 5 columns and 10 rows from the 3 tables without the use of a Cartesian product Query: SELECT E.LAST_NAME, E.FIRST_NAME, S.BUILDING, S.BRAN

I need to write one function and one procedure to query a Oracle 10.1 DB using PL SQL. I have the schema and exact queries...along with work Ive started and a template to put the a

Parameter and Keyword Description: package_name: This construct identifies the package. AUTHID Clause: This determine whether all the packaged subprograms impleme

Example of NOT EXISTS in SQL Example: Use of NOT EXISTS CREATE ASSERTION Must_be_enrolled_to_take_exam_alternative1 CHECK ( NOT EXISTS (SELECT StudentId, CourseId

Ending Transactions A good quality programming practice is to commit or roll back every transaction explicitly. Whether you rollback or issue the commit in your PL/SQL program

Main features of PL/SQL A good way to get familiar with PL/SQL is to look at a sample program. The below program processes an order for tennis rackets. At first, it declares a

Datatype Conversion At times it is necessary to convert a value from one datatype to another. For e.g. if you want to inspect a rowid, you should convert it to a character stri

UNION ALL - SQL Further varieties of UNION arise when we replace the key word DISTINCT by ALL in any of the foregoing examples, as in Example. ALL specifies that if row r appe

%ROWTYPE: This attribute gives a record type which represents a row in the database table or a row fetched from a formerly declared cursor. The Fields in the record and corresp

Example of GROUP BY and COLLECT Operator Example: Using GROUP BY and COLLECT to obtain C_ER2 SELECT CourseId, CAST ( COLLECT (ROW (StudentId, Mark)) AS ROW (Studen