cancel
Showing results for 
Search instead for 
Did you mean: 

SA9 to SA11 migration: right truncation of string data.

Former Member
7,230

I'm trying to migrate an SA9 database to version 11 (maybe I'll change to 12). I did unload at 9 using external options. When I run reload.sql I get "right truncation of string data" in several tables. Ok, that's fine and it is a expected behavior. But I need to solve that setting bigger varchar type for my columns.

My question is: what's the easiest way to know what columns is generation this error?

I'm planning to write some app, that select column size of syscolumns table and compares it with select max(length(column)) but it will be my last shoot.

Thanl you

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

I have change v11 database character set encoding to iso_1 and collation sequence iso1latin1 (same settings that v9 db) and it solves my problem.

It is an expected behavior? (read my reply to Mark in question comments)

MarkCulp
Participant

Yes, this is expected behavior. char(n) and varchar(n) declares character strings which are up to n bytes long. SA 10 introduced CHAR length semantics so you can declare CHAR(10) if you want 10 characters (instead of 10 bytes). Read more about this at http://dcx.sybase.com/index.html#1200en/dbreference/char-character-wsqltype1.html

VolkerBarth
Contributor

@Mark: I guess it should be "CHAR (10 CHAR)" when using character-length semantics.

MarkCulp
Participant

@Volker: Correct.... my previous comment should have been: "... you can declare CHAR( 10 CHAR ) if you want 10 characters ...".

Answers (2)

Answers (2)

0 Kudos

You can try - SET OPTION PUBLIC.ANSI_SUBSTRING = 'Off'; In this case the behavior of the SUBSTRING function is the same as in previous releases of SQL Anywhere

Former Member
0 Kudos

example: 1> select cast(Number as varchar(10)), 2> cast(PropNum as varchar(10)), 3> cast(PropName as varchar(25)), 4> -- cast(PropDescription as varchar(30)), 5> cast(Value as varchar(25)) 6> from sa_conn_properties() 7> where PropName like '%ncation%' 8> go Number PropNum PropName Value


5 492 string_rtruncation On (1 row affected)