Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1544#discussion_r185041381
  
    --- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
    @@ -581,12 +581,12 @@ characters. See 
<<character_value_expressions,Character Value Expressions>>.
     [[considerations_for_ascii]]
     === Considerations For ASCII
     
    -For a string expression in the UTF8 character set, if the value of the
    +If the value of the
    --- End diff --
    
    I just tested this, and this doesn't seem to be the case. I inserted the 
string 'ñ' into an ISO88591 column, then selected ascii(x) from that column. 
(The 'ñ' character is the n-with-tilde, which is used in the Spanish 
language.) The value I got back was 241 (which seems right; the 'ñ' character 
has an encoding of hex 'f1' = 241 decimal in the ISO88591 code page). So, I 
think the behavior in Trafodion has changed.
    
    I also tried this on a UTF8 column. There, the ASCII function seems to work 
fine so long as the encoding is less than or equal to 127. Again, I inserted 
'ñ', and then selected ascii(x) from that column. This time I did get an 
error, but a different error:
    
    *** ERROR[8428] The argument to function ASCII is not valid.
    
    I suspect what is going on there is the SQL run-time is allowing the ASCII 
function on UTF8 characters only if the UTF8 character is single-byte.


---

Reply via email to