INSERT (Lakehouse v1)
Retorna a string str, com a substring que começa na posição pos e tem len caracteres de comprimento substituída pela string newstr. Retorna a string original se pos não estiver dentro do comprimento da string. Substitui o restante da string a partir da posição pos se len não estiver dentro do comprimento do restante da string. Retorna NULL se algum argumento for NULL.
Sintaxe do Analyze
Seção intitulada “Sintaxe do Analyze”func.insert(<str>, <pos>, <len>, <newstr>)Exemplos do Analyze
Seção intitulada “Exemplos do Analyze”func.insert('Quadratic', 3, 4, 'What')┌────────────────────────────────────────┐│ func.insert('Quadratic', 3, 4, 'What') │├────────────────────────────────────────┤│ QuWhattic │└────────────────────────────────────────┘Sintaxe SQL
Seção intitulada “Sintaxe SQL”INSERT(<str>, <pos>, <len>, <newstr>)Argumentos
Seção intitulada “Argumentos”| Argumentos | Descrição |
|---|---|
<str> |
A string. |
<pos> |
A posição. |
<len> |
O comprimento. |
<newstr> |
A nova string. |
Tipo de retorno
Seção intitulada “Tipo de retorno”VARCHAR
Exemplos de SQL
Seção intitulada “Exemplos de SQL”SELECT INSERT('Quadratic', 3, 4, 'What');┌───────────────────────────────────┐│ INSERT('Quadratic', 3, 4, 'What') │├───────────────────────────────────┤│ QuWhattic │└───────────────────────────────────┘
SELECT INSERT('Quadratic', -1, 4, 'What');┌───────────────────────────────────────┐│ INSERT('Quadratic', (- 1), 4, 'What') │├───────────────────────────────────────┤│ Quadratic │└───────────────────────────────────────┘
SELECT INSERT('Quadratic', 3, 100, 'What');┌─────────────────────────────────────┐│ INSERT('Quadratic', 3, 100, 'What') │├─────────────────────────────────────┤│ QuWhat │└─────────────────────────────────────┘
┌────────────────────────────────────────────┬────────┐│ INSERT('123456789', number, number, 'aaa') │ number │├────────────────────────────────────────────┼────────┤│ 123456789 │ 0 ││ aaa23456789 │ 1 ││ 1aaa456789 │ 2 ││ 12aaa6789 │ 3 ││ 123aaa89 │ 4 ││ 1234aaa │ 5 ││ 12345aaa │ 6 ││ 123456aaa │ 7 ││ 1234567aaa │ 8 ││ 12345678aaa │ 9 ││ 123456789 │ 10 ││ 123456789 │ 11 ││ 123456789 │ 12 │└────────────────────────────────────────────┴────────┘