on 2010 Aug 30 2:03 PM
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
Request clarification before answering.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
@Mark: I guess it should be "CHAR (10 CHAR)" when using character-length semantics.
@Volker: Correct.... my previous comment should have been: "... you can declare CHAR( 10 CHAR ) if you want 10 characters ...".
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
53 | |
6 | |
6 | |
5 | |
5 | |
5 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.