Abhi
Abhi

Reputation: 1255

Get the ASCII value of a character in Redshift

I am trying to find the ASCII value of a character is a string. I am essentially looking for the opposit of CHR, CHR(65)= A. Similarly fn(A) should return 65. I could not find any function in redshift SQL manual.

Upvotes: 1

Views: 2673

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269171

Closest I could find is:

ASCII is a deprecated leader node–only function.

You could write a Python User-Defined Function that returns a character given the ASCII value.

Upvotes: 1

Related Questions