I need some help how to call a functions that take a TABLE as parameter:
My aim is to build a table of all parmeters in default.ui.txt linked as table with a CSV link (not as comment/TXT).
What I have is a FUNCTION extract() that analyses a string and returns a table of all parameters enframed in angle brackets. What I have is a SELECT or INSERT that feeds this function with a static string and processes the result.
-- prepare result table for the final INSERT *** commented for tests
-- CREATE TABLE [Result] ([Value] NVARCHAR);
-- * FUNCTION extract()
-- * take a single string and extract all <parameters> into the return table,
-- * no WHITESPACE allowed in parameter names
FUNCTION extrct(@txtparm NVARCHAR) TABLE AS CALL StringToRegexpMatches( @txtparm, '<\\w*>', 'c') END;
-- this works
-- * extracting all parameters of a static string example
SELECT [Value] FROM CALL extrct('ExampleString=ExampleFunction(<parm1>, <parm2>, <parm3>)');
-- this would work if not *** commented for tests
-- * extract and INSERT as separate records in [Result]
-- INSERT INTO [Result] SELECT [Value] FROM CALL extrct('ExampleString=ExampleFunction(<parm1>, <parm2>, <parm3>)');
How can I make this work on an NVARCHAR field of all records in a table? Missed the appropriate example in help for CALL, EXECUTE, FUNCTION.
I guess I can't use a CALL function() returning a TABLE in the fields list of a SELECT and don't manage to get it to work with all records of a table in a FROM clause.