Hi. Using version 9.2. I'm trying to create a function that will take a record from any view and assemble it into a string, for export to another system. For example, this view:
would get converted into a string with all the fields concatenated together, and space-padded to their full lengths.
I think an example is needed. I was thinking you wanted the field values transformed, but the below seems to indicate something different.
No transformation is needed, except for padding the fields out to their maximum lengths. So for example with these values
('AA','1243','20160801','2','1','1',37,24)
I need a string created that looks like this:
'AA 1243 201608012113724'
I have a whole bunch of views that I need to do this for, and am hoping to avoid coding something specific for each one.
My original idea was to do this in TCL by passing a record and a view name. The function would then look up the columns in the information_schema, and use that info to assemble and return the string. But it looks like TCL functions won't accept a record as an argument.