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.

CHAR

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:

CHAR[(maximum_length)]

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
Explicit Cursor Attributes The cursor variable or each cursor has four attributes: %FOUND, %ISOPEN, %ROWCOUNT, and %NOTFOUND. When appended to the cursor or cursor variable, th

Declaring Objects: You can use the object types wherever built-in types like CHAR or NUMBER can be used. In the block below, you can declare object r of type Rational. Then, yo

Example of UNWRAP Operator - SQL Example here shows how unwrapping can be done in longhand in SQL. Example: Unwrapping in SQL Letting CONTACT_INFO_WRAPPED denote the res

Running the PL/SQL Wrapper To run the PL/SQL Wrapper, go through the wrap command at your operating system prompt by using the syntax as shown: wrap iname=input_file [oname=

Updating by replacement Syntax: UPDATE ENROLMENT SET Name = 'Ann' WHERE StudentId = SID ('S1'); Note the use of SET, as already noted in connection with direct a

Declaring Exceptions The Exceptions can be declared only in the declarative part of the PL/SQL subprogram, block, or package. By introducing its name, you can declare an excep

Data Types in SQL - Integer INTEGER or  synonymously INT, for integers within a certain range. SQL additionally has types SMALLINT and BIGINT for certain ranges of integers. T

Type versus Representation Confusion in SQL This describes how a value might have two or more distinct representations. For example, user-defined type POINT might have a decla

Ensuring Backward Compatibility   The PL/SQL Version 2 permits some abnormal behavior which Version 8 disallows. Particularly, Version 2 permits you to (i) Make the forw

Cursor Attributes   The Cursors and cursor variables have 4 attributes which give you helpful information about the execution of a data manipulation statement. Syntax: