Allow the "result_field" to be used as the default alias in the output column of...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Mar 2011 14:40:40 +0000 (14:40 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Mar 2011 14:40:40 +0000 (14:40 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@19799 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/c-apps/oils_sql.c

index 09081cd..b64e22e 100644 (file)
@@ -4273,6 +4273,8 @@ char* SELECT (
                                        const char* _alias;
                                        if((tmp_const = jsonObjectGetKeyConst( selfield, "alias" ))) {
                                                _alias = jsonObjectGetString( tmp_const );
+                                       } else if((tmp_const = jsonObjectGetKeyConst( selfield, "result_field" ))) { // Use result_field name as the alias
+                                               _alias = jsonObjectGetString( tmp_const );
                                        } else {         // Use field name as the alias
                                                _alias = col_name;
                                        }