How many bytes does Oracle use to store one character?

I tried to look here:

http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#i3253

And I understand that I need to provide the row length for the column, I just can not find out how many bytes oracle uses when storing a character. My limit is 500 characters, so if its 1 byte / character, I can create a column with 500 if its 2 bytes / character, 1000, etc.

Who has a link to the documentation or know for sure?

In case that matters, SQL is called from PHP, so these are the PHP strings that I insert into the database. Thanks.

+7
oracle oracle10g php character
source share
3 answers

the number of bytes needed to store a character will depend on the character set. If you want to save 500 characters and do not know the character set of the target database, you must create a column (or variable) as VARCHAR2 (500 CHAR ) or CHAR (500 CHAR ).

+16
source share

A regular CHAR not necessarily a single byte, depending on the NLS_LENGTH_SEMANTICS setting.

See Oracle SQL Reference for a starting point. If you need to dig deeper, take a look at the Oracle Globalization Support Guide .

+4
source share

One CHAR will take 1 byte.

Try it here:

http://ss64.com/ora/syntax-datatypes.html

-one
source share

All Articles