How to split comma separated string into strings inside store procedure and insert them into a table field?
Using Firebird 2.5
How to split comma separated string into strings inside store procedure and insert them into a table field?
Using Firebird 2.5
A similar solution I use, published a while ago by Jiri Cincura http://blog.cincura.net/232347-tokenize-string-in-sql-firebird-syntax/
Here a sample how to split the string and write the sub-strings into a table:
It looks good except one thing, in my Firebird server Varchar size declaration to 32000 cause "Implementation limit exceeded" exception so be careful. I suggest to use BLOB SUB_TYPE TEXT instead :)
I am posting modified Michael's version, maybe it will be useful for someone.
The changes are:
Use POSITION http://www.firebirdsql.org/refdocs/langrefupd21-intfunc-position.html
and
SUSTRING http://www.firebirdsql.org/refdocs/langrefupd21-intfunc-substring.html
functions in WHILE DO statement