The ASCII function returns the numeric ASCII code associated with the first character of a string in database systems that support ASCII.
Character codes can be useful in specialized text-processing and data-validation scenarios.
Return the ASCII code of the first character in a customer code.
SELECT
CustomerCode,
ASCII(CustomerCode) AS FirstCharacterCode
FROM Customers;
ASCII can be used for text analysis, validation, troubleshooting, and specialized data-processing tasks.
- ASCII returns a numeric character code.
- It generally examines the first character.
- It is useful for specialized text processing.
- Unicode requires different functions in some systems.
- Database support varies.
What does ASCII return?
ASCII returns the numeric code associated with the first character of a string.
Is ASCII suitable for all languages?
No. ASCII covers a limited character set, so Unicode-specific functions may be needed for multilingual data.