Firebird 2.0
PSQL Reference



Use the VARCHAR and NCHAR VARYING datatypes to hold text values of a variable length.


<varchar_type> ::=
     <varchar_keyword> ( <psql_integer> ) [ <char_set> ]
   | <nvarchar_keyword> ( <psql_integer> )

<varchar_keyword> ::=

<nvarchar_keyword> ::=

<char_set> ::=
   CHARACTER SET <identifier>


The VARCHAR(n) datatype contains text of varying length, up to a maximum of n characters. The maximum size is 32,767 bytes, which can be 10,992 to 32,767 characters, depending on the character size (1..3 bytes). You must supply n; there is no default to 1.

Firebird converts from variable-length character data to fixed-length character data by adding spaces to the value in the varying column until the column reaches its maximum length n. In the reverse conversion, trailing blanks are removed from the text.

The main advantage of using the VARCHAR(n) datatype are that it saves memory space during the execution of PSQL programs.


The below examples define a type to hold 32 characters in Unicode and a type to hold 128 characters in the ISO8859_1 character set (a.k.a. “latin1”):


See also

Character sets and collation orders in the SQL Reference Manual

previous page goto index next page

Legal information

User comments:

Contributed by WicBPPmchCIQFxCSFIS on 1 June 2008 09:45 AM


Contributed by Affinity on 1 June 2011 02:33 PM

I\'m not easily impressed. . . but that\'s imperssing me! :)

Contributed by crorkservice on 19 July 2014 06:49 AM

lEt2n0 Thank you ever so for you post. Much obliged.

Contributed by cheap backlinks on 19 July 2014 12:58 PM

354tRx Im obliged for the blog.Really looking forward to read more. Great.

Contributed by crorkz matz on 1 August 2014 11:10 AM

BlkKRV Very good post.Really looking forward to read more. Awesome.

Contributed by matz crorkz on 23 November 2014 07:37 PM

PFYzxZ It is best to take part in a contest for among the finest blogs on the web. I\'ll advocate this site!

Contributed by diamond crorkz on 17 December 2014 02:11 PM

CVSYKh Very informative post.Much thanks again. Really Great.

Contributed by crorkz on 16 January 2015 03:26 AM

waDsTS F*ckin\' tremendous things here. I am very glad to see your article. Thank you so much and i am taking a look forward to touch you. Will you kindly drop me a mail?

Contributed by crorkz on 16 January 2015 03:44 AM

6ylBsI Nice blog here! Also your web site loads up very fast! What web host are you using? Can I get your affiliate link to your host? I wish my site loaded up as fast as yours lol

Contributed by crork matt on 7 March 2015 10:00 AM

di1WzL Thanks - Enjoyed this update, how can I make is so that I get an email whenever there is a fresh update?

Contributed by matt daemon on 7 March 2015 10:37 AM

G9fVvt You made some respectable factors there. I looked on the internet for the problem and found most people will go along with together with your website.

Extend this topic - Post a comment

Your name:
Your comment:
This post is plain text
This post is html formatted