Struct like complex data type for SQL results set
Author: james.reynolds@tribalgroup.com (jamesruk21)
Hi Uniface, We would like a complex data type that we can post SQL/print or SSP result sets into. This complex data type would allow us to jump to rows by index number and columns by name or column number in the result set. So to visualise a bit Select * from tblGeoff Col1 Col2 a aa b bb This would go into "sqltable" type Uniface dev would go variables string columncontent numeric rownum sqlresulttable sqltable endvariables ;do the sql get into sqltable variable sqltable = sql/print "Select * from tblGeoff" ;assume /print might change to /resulttable or whatever rownum = 0 while (rownum < sqltable.count()) ;here "Col1" columnname is equivalent to the column index "1" columncontent = sqltable[rownum].[Col1] or columncontent = sqltable[rownum].[1] rownum = rownum + 1 endwhile So reasons we would like to do this. 1. We like the normal drivers/methods that Uniface provides, but we want to put logic in queries/procs (SSPs) to do work outside of Uniface to improve performance and maybe use functions that aren't available in uniface 2. We currently have to do a lot of work in processing results from SQL/print and this would make it consitent across databases, and also faster as yous could write it into the framework 3. It really makes using direct/adhoc SQL quite accessible from Uniface 4. Other customers may have logic that they do not want to rewrite out of stored procs Hope this makes the cut. Thanks Jim




