0

In oracle I have defined column like this:

column_name varchar2(1024 char)

how should I rewrite it to informix db ?

hudi
  • 15,555
  • 47
  • 142
  • 246
  • are you sure ? When what is the different between varchar2(1024) and varchar2(1024 char) – hudi Mar 17 '14 at 09:06
  • See here for a description of the difference: http://docs.oracle.com/cd/E11882_01/server.112/e41084/sql_elements001.htm#SQLRF50977 –  Mar 17 '14 at 09:14
  • @a_horse_with_no_name man I know this but I mean different between varchar2(1024) and varchar2(1024 char) when you rewriting to informix. PS: U can defined column varchar(1024) in informix max value is just 255 – hudi Mar 17 '14 at 09:17

1 Answers1

0

While VARCHAR Infomix type is limited to 255 chars I would use LVARCHAR type which is limited to 32,739 bytes.

The 2nd problem is (1024 char) which means that Oracle can save 1024 chars. In encoding like UTF-8 this is not equal to 1024 bytes. For example Polish letters: ąęćŃŻŚ are saved with 2 bytes so text with 1024 Polish letters will use 2048 bytes.

Informix uses bytes length so you must know your encoding and data. For Polish text in UTF8 encoding I would translate varchar2(1024 char) into lvarchar(2048).

Michał Niklas
  • 53,067
  • 18
  • 70
  • 114