I have an iscript that runs one of a collection of previously created SQL statements, binds several parameters, and generates an XML result.
The SQL used in each request varies in the number of parameters and the number of (and name of) columns returned.
Everything was pretty straightforward to develop except for one outstanding issue: how can I collect the column names and include that information in the returned data?
Currently we are using the CreateSQL command and a SQL object. As far as I know, we can only loop through the result values, and not a dictionary of the column names and values.
How can I return the column names with the results in PeopleCode, in the context of an iscript, with (essentially) dynamic SQL that can't be known ahead of time?