Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am debugging a script that was written by another Developer.
I came across a this function: subfield(Fieldname,';' ) as Fieldname1
I would like to know what the Developer was trying to achieve by an empty substring parameter.
Can you please advise?
HI Tumela,
If index is omitted when subfield is used in a field expression in a load statement, the subfield function will cause the load statement to automatically generate one full record of input data for each substring that can be found in the string
e.g.
Loading the string 123;456;78910;1112 with Subfield(Record,.';') as Fields outputs separate records for each subfield
Fields
123
456
78910
1112
Hi,
When you dont write index number then by default it is consider 1
In Help Menu you will get detail explanation with example.
Regards
HI Tumela,
If index is omitted when subfield is used in a field expression in a load statement, the subfield function will cause the load statement to automatically generate one full record of input data for each substring that can be found in the string
e.g.
Loading the string 123;456;78910;1112 with Subfield(Record,.';') as Fields outputs separate records for each subfield
Fields
123
456
78910
1112
When it's used in a load statement without an index, it creates a full record of input data for every substring it finds in that field - so it would create a record for every "substring" it finds in "fieldname" in your example.
Thanks guy!...I learnt something new and it's quite useful I must say.