SQL - Insert

SQL -> Funkcie -> Funkcie pre prácu s reťazcami -> SQL - Insert

Syntax

INSERT(str,pos,len,newstr)

Popis

Príkaz jazyka SQL
Returns the string str, with the substring beginning at position pos and len characters long replaced by the string newstr. Returns the original string if pos is not within the length of the string. Replaces the rest of the string from position pos is len is not within the length of the rest of the string. Returns NULL if any argument is NULL.
This function is multi-byte safe.

Príklad

SELECT INSERT('Quadratic', 3, 4, 'What') FROM dual;
        -> 'QuWhattic'
SELECT INSERT('Quadratic', -1, 4, 'What') FROM dual;
        -> 'Quadratic'
SELECT INSERT('Quadratic', 3, 100, 'What') FROM dual;
        -> 'QuWhat'


Pozri aj

CONCAT