XCALL SQL enhancement: SQLOP_FETCH_ROW now supports fetching a row into an ordmap:
dimx $rowmap, ordmap(varstr;varx)
...
cmdhdr.opflags = FETCHR_ROWMAP
xcall SQL, SQLOP_FETCH_ROW, cmdhdr, $rowmap()
foreach $$i in $rowmap()
? "Column name: ";.key($$i);", value: ";$$i
next $$i
Requirements / Comments
• Requires libashmysql library 1.4.142+
• Related opflags added to SQL.DEF:
Symbol |
Value |
Description |
FETCHR_ROWMAP |
&h0010 |
Return row as an ordmap |
FETCHR_ORGNAME |
&h0020 |
Add to use org_name instead of name for key |
FETCHR_TBLNAME |
&h0040 |
Add to prefix name with table name |
• If a column name is blank, possibly because it is an expression, a name will be generated of the form "expr-#" (1,2,3...)
• The ordmap(varstr;varx) format will handle any field type. Text fields will appear as they are stored in the database. Numeric and other formatted field types will be converted to the standard display representation, the same as for the FETCHR_ROWSTR and FETCHR_ARRAY formats. BLOB fields will be encoded, and automatically decoded when assigned to a suitable variable type.