<field name="source" />
<field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
<field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
+ <field name="heading" />
+ <field name="simple_heading" />
<field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
<field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
<field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
if( !val )
return NULL;
+ const char* right_percent = "";
+ const char* real_op = op;
+
+ if( !strcasecmp( op, "startwith") ) {
+ real_op = "like";
+ right_percent = "|| '%'";
+ }
+
growing_buffer* sql_buf = buffer_init( 32 );
buffer_fadd(
sql_buf,
- "\"%s\".%s %s %s",
+ "\"%s\".%s %s %s%s",
class_alias,
osrfHashGet( field, "name" ),
- op,
- val
+ real_op,
+ val,
+ right_percent
);
free( val );
op = "IS";
}
+ const char* right_percent = "";
+ const char* real_op = op;
+
+ if( !strcasecmp( op, "startwith") ) {
+ real_op = "like";
+ right_percent = "|| '%'";
+ }
+
growing_buffer* sql_buf = buffer_init( 32 );
- buffer_fadd( sql_buf, "\"%s\".%s %s %s", class_alias, osrfHashGet(field, "name"), op, val );
+ buffer_fadd( sql_buf, "\"%s\".%s %s %s%s", class_alias, osrfHashGet(field, "name"), real_op, val, right_percent );
char* pred = buffer_release( sql_buf );
free( val );