[[Dashboard | << Back to Dashboard ]] {| align="right" | __TOC__ |} = Exploring the QueryHelper Plugin = == Overview == A query helper plugin. == getCountDistinct == Returns total/count disninct values === Returns === * This function returns ''numeric'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | qry || query || Yes || --- || cf query |- | ColumnName || string || Yes || --- || column/s name |} === Examples === == doQueryAppend == Append Query1 into Query2 === Returns === * This function returns ''query'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | qryFrom || query || Yes || --- || Append Query1 into Query2 |- | qryTo || query || Yes || --- || Query2 will have all record from Query1 |} === Examples === == sortQueryNoCase == Sorts a query by the given field non-case === Returns === * This function returns ''query'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | qry || query || Yes || --- || Query to sort |- | sortBy || string || Yes || --- || Sort by column |- | sortOrder || string || No || ASC || ASC/DESC |} === Examples === == sortQuery == Sorts a query by the given field === Returns === * This function returns ''query'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | qry || query || Yes || --- || Query to sort |- | sortBy || string || Yes || --- || Sort by column(s) |- | sortOrder || string || No || ASC || ASC/DESC |} === Examples === == filterQuery == Filters a query by the given value === Returns === * This function returns ''query'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | qry || query || Yes || --- || Query to filter |- | field || string || Yes || --- || Field to filter on |- | value || string || Yes || --- || Value to filter on |- | cfsqltype || string || No || cf_sql_varchar || The cf sql type of the value. |- | list || boolean || No || false || Whether to do a where IN list. |} === Examples === == doInnerJoin == Return inner-joined Query === Returns === * This function returns ''query'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | qryLeft || query || Yes || --- || |- | qryRight || query || Yes || --- || |- | LeftJoinColumn || string || Yes || --- || the column name, not the value of column |- | RightJoinColumn || string || Yes || --- || the column name, not the value of column |- | OrderByElement || string || No || || |- | CaseSensitive || boolean || No || false || |} === Examples === == querySim == First line are the query columns separated by commas. Then do a consecuent rows separated by line breaks separated by | to denote columns. === Returns === * This function returns ''query'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | queryData || string || Yes || --- || The data to create queries |} === Examples === == getColumnArray == Returns an array of the values === Returns === * This function returns ''any'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | qry || query || Yes || --- || cf query |- | ColumnName || string || Yes || --- || column name |} === Examples === == getCSV == returns query in delimited text file format === Returns === * This function returns ''string'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | qry || query || Yes || --- || query to return as a delimited text file |- | delimiter || string || No || , || delimiter |} === Examples === == filterNull == Filters a query by NULL === Returns === * This function returns ''query'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | qry || query || Yes || --- || Query to filter |- | field || string || Yes || --- || Field to filter on |- | null || string || No || NULL || NULL by default, also accepts NOT NULL |} === Examples === == doLeftOuterJoin == Return left outer-joined Query === Returns === * This function returns ''query'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | qryLeft || query || Yes || --- || |- | qryRight || query || Yes || --- || |- | LeftJoinColumn || string || Yes || --- || the column name, not the value of column |- | RightJoinColumn || string || Yes || --- || the column name, not the value of column |- | OrderByElement || string || No || || |- | CaseSensitive || boolean || No || false || |} === Examples === == getRowNumber == Returns the row number of the first match === Returns === * This function returns ''numeric'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | qry || query || Yes || --- || cf query |- | ColumnValue || string || Yes || --- || column value |- | ColumnName || string || Yes || --- || column name |} === Examples ===