In a table with a column of data type (long) binary, when altering that column to data type (long) varchar/nvarchar, will that somehow convert existing data?

And what happens when doing the opposite, i.e. altering a column of data type (long) varchar/nvarchar to (long) binary?

The v12.0.1. docs tell

"If necessary, the data in the modified column is converted to the new data type."

I'm not sure what defines the necessity here. Is something like csconvert() called here with the according charsets?

(I have stored binary data and would convert the column to nvarchar as the original data is in utf-8, so I hope they will remain as-is.)


Just to clarify: I'm not dealing with varchar/nvarchar conversion...

asked 18 Mar '16, 11:49

Volker%20Barth's gravatar image

Volker Barth
30.3k301453660
accept rate: 32%

edited 18 Mar '16, 11:50


You will need to verify this is valid in your situation and that you have valid character data actually stored in your blob columns. but ...

There should be no conversion when you attempt to do this. If you had a requirement to do so you would need to do your own CSCONVERT-style conversions yourself, since only you can know something about the encoding of the raw data stored there. But it sounds like you may not have to worry about that.

Binary object are effectively the "Any" data type and have no meaning or context information associated with them.

permanent link

answered 21 Mar '16, 17:14

Nick%20Elson%20SAP%20SQL%20Anywhere's gravatar image

Nick Elson S...
7.3k35107
accept rate: 31%

OK, thanks for the clarification, that's what I had expected, and yes, in my situation the data are valid (i.e. left unchanged) after the data type modification.

(22 Mar '16, 04:56) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×25
×14
×11

question asked: 18 Mar '16, 11:49

question was seen: 312 times

last updated: 22 Mar '16, 04:57