问题
How can I have bytes stored in a Varchar2, and have it treated "normally" as text when it is ASCII for example? (Like in queries).
If not possible, where is the limitation?
I know the column is defined with a character sets, so if it is ANSI for example, what kind of 1-byte values can I not put there? Are there "better" solutions than ANSI for 1-byte character sets?
回答1:
You have to encode bytes into text. You can use rawtohex
function or utl_encode
package. For displaying characters you have to use inverse function and then convert raw bytes to varchar2. Use utl_raw.cast_to_varchar2
.
来源:https://stackoverflow.com/questions/14452931/how-can-i-store-bytes-in-oracle-varchar2-and-have-ascii-treated-as-text