eagle_ea
asked on
oracle String Manipulation to CHAR datatype
Hello,
running the below statement does not work,
update table set col1 = col1 || 'X' ;
col1 is of CHAR datatype.
the error i'm getting is " value too large". i understand CHAR allocates the specified length as defined. would append not work at all??
could someone please help.
running the below statement does not work,
update table set col1 = col1 || 'X' ;
col1 is of CHAR datatype.
the error i'm getting is " value too large". i understand CHAR allocates the specified length as defined. would append not work at all??
could someone please help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What is the length of col1? Make sure its greater than col1|| 'X'
You can also use
update table set col1 = trim(rtrim(col1)) || 'X' ;
update table set col1 = trim(rtrim(col1)) || 'X' ;
anumoses,
" What is the length of col1? Make sure its greater than col1|| 'X' "
That is impossible!
Col1 is char, so col1||X will always be len(col1) + 1!
Hence TRIM proposed by Angel.
But if col1 is full, then the statement wills till fail.
" What is the length of col1? Make sure its greater than col1|| 'X' "
That is impossible!
Col1 is char, so col1||X will always be len(col1) + 1!
Hence TRIM proposed by Angel.
But if col1 is full, then the statement wills till fail.
update table set col1 = ltrim(rtrim(col1)) || 'X' ;