DIFFERENCE BETWEEN NVARCHAR2(n) AND VARCHAR2(CHAR n)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SIDDARTHNGOPAL
    New Member
    • Mar 2007
    • 1

    DIFFERENCE BETWEEN NVARCHAR2(n) AND VARCHAR2(CHAR n)

    Can you help me out by letting me the know the difference in the follwoing declarations of variables(In PL/SQL BLOCKS) or attrbutes (In a table):
    NVARCHAR2(n) and
    VARCHAR2(CHAR n)

    where n is the maximum number of characters that could be accepted
  • rahulkoshti
    New Member
    • Jan 2008
    • 5

    #2
    Reply

    Seeee This=====>

    Consider the column which must hold up to a maximum of 20 characters and other application which supports multilingual column.Everythi ng works fine until we try of fill the column with 20 two-byte characters
    All of a sudden the column is trying to store twice the data it was before and we have a problem.


    VARCHAR2(20)
    VARCHAR2(20 BYTE)
    VARCHAR2(20 CHAR)

    Option 1 uses the default length semantics defined by the NLS_LENGTH_SEMA NTICS parameter which defaults to BYTE. Option 2 allows only the specified number of bytes to be stored in the column, regardless of how many characters this represents. Option 3 allows the specified number of characters to be stored in the column regardless of the number of bytes this equates to.
    Last edited by rahulkoshti; Jan 4 '08, 11:19 AM. Reason: icon

    Comment

    Working...