You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
select token_count(:str), token_get(:str, 2)
from rdb$database; -- returns 3 in 1st column and 'bbb' in 2nd
Is it possible to provide in FB 2.5.x two functions that can returns such results ? Currently developer have to use UDFs or SP with loop (i.e. cursor) or recursive CTE to get such simple data.
The text was updated successfully, but these errors were encountered:
description: It's often need to parse some string with known delimeters and obtain:
1) count of tokens inside input string
2) get token by it's name.
Examples:
Is it possible to provide in FB 2.5.x two functions that can returns such results ? Currently developer have to use UDFs or SP with loop (i.e. cursor) or recursive CTE to get such simple data.
=>
It's often need to parse some string with known delimeters and obtain:
1) count of tokens inside input string
2) get token by it's number.
Examples:
select token_count(:str), token_get(:str, 2)
from rdb$database; -- returns 3 in 1st column and 'bbb' in 2nd
Is it possible to provide in FB 2.5.x two functions that can returns such results ? Currently developer have to use UDFs or SP with loop (i.e. cursor) or recursive CTE to get such simple data.
Submitted by: @pavel-zotov
It's often need to parse some string with known delimeters and obtain:
1) count of tokens inside input string
2) get token by it's number.
Examples:
str = 'aaa,,,....,,bbb,;.;'';;ccc''', delimeters = '.;:,' || asci_char(39)
count of tokens ==> 3
token #1 ==> 'aaa'
token #2 ==> 'bbb'
token #3 ==> 'ccc'
So, the function calls could be like these:
select token_count(:str), token_get(:str, 2)
from rdb$database; -- returns 3 in 1st column and 'bbb' in 2nd
Is it possible to provide in FB 2.5.x two functions that can returns such results ? Currently developer have to use UDFs or SP with loop (i.e. cursor) or recursive CTE to get such simple data.
The text was updated successfully, but these errors were encountered: