TO_BINARY
Syntaxe
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> TO_BINARY[TO_BINARY]:::quoted
TO_BINARY --> End((END))
Objet
La fonction SQL TO_BINARY convertit une valeur en BLOB. Le texte est interprété au format UTF-8.
Voir également ASCII_TO_BLOB, UNICODE_TO_BLOB et HEX_TO_BLOB.
Paramètres :
- Entrée (
ANY) : valeur à convertir.
Renvoie : la valeur d'entrée convertie en BLOB.
Exemples
L'exemple suivant convertit le texte hi en BLOB et récupère sa représentation en base64 :
select base64_encode(to_binary('hi'))
-------------------
aGk=
L'exemple suivant convertit le texte abc en BLOB et récupère sa longueur en octets :
select length(to_binary('abc'))
-------------------
3