Description
So far SQL/PRINT result is a string containing fixed length fields as columns of a table. There is a need for the result in a Uniface list with variable length items.
Use Case
Needed for example when extracting information with variable results, in term of column type and column control (a retrieve is not possible because the strucuture of the resulting entity would be variable depnding on the request). It takes so far too much processing time to handle the resulting string: looping on 100,000 occurrences and trimming all the trailing spaces of each column is mopolizing processor time.
Importance
So far SQL/PRINT result is a string containing fixed length fields as columns of a table. There is a need for the result in a Uniface list with variable length items.
Type
Uniface 4GL
Operating System
Not Applicable
Status
Closed
We also need this change.
Our current work around is to concatenate all the result columns into a uniface list, e.g.
select ‘col1=’ || col1 || chr(27) || ‘col2=’ || col2 || chr(27) || ‘col3=’ || col3 from tableA.
and pass it thru sql/print.
The problem is that the concatenation logic would be different if the database used is Sql Server rather than oracle.
This solution (e.g. having a sql/list option) would hopefully make mutiple column sql result easier to manage and portable to different database implementations.
SQL/data command in Uniface 9.6.04 (December 2013) will resolve this.
Status = Closed
In Uniface 9.6.04 the sql Proc statement has been enhanced with an extra switch, /data, which returns data in $result as a nested Uniface list. This makes it easier to post-process the data using standard Uniface list processing functions. An optional /fieldname subswitch, enables you to include a header of field names in the returned data.
These switches are available only for solidDB, Oracle, Microsoft SQL Server, MySQL, and DB2.