Programmer Guide/Command Reference/QUERY: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
m (Reverted edits by Christian (talk) to last revision by Admin)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
==QUERY==
The <code>QUERY</code> command, although similar to the <code>[[Programmer Guide/Command Reference/FIND|FIND]]</code> command, offers the programmer more choice in how to search.
The <code>QUERY</code> command, although similar to the <code>[[Programmer Guide/Command Reference/FIND|FIND]]</code> command, offers the programmer more choice in how to search.


QUERY [ /i ] [ /t ] [ /m=<var>matchtype</var> ] [[Programmer_Guide/Command_Reference_Options/-|/-]] <var>table</var> <var>startentry</var> <var>field</var> <var>querystring</var>
<code>QUERY [ /i ] [ /t ] [ /m=<var>matchtype</var> ] /- <var>table startentry</var> <var>field</var> <var>querystring</var></code>
 
<code>QUERY /m=find <var>table</var> <var>startentry</var> <var>cepr</var> [ <var>copr</var> <var>cexpr</var> ... ] [ /t ] // works like SET table FIND</code>
 
;<var>matchtype</var>
 
:One of the following keywords:
 
:<code>regular
wildcard
substring
full
find</code>
 
;<var>table</var>
 
:The table to search.
 
;<var>startentry</var>
 
:The zero-based index of the entry at with which to start the search.
 
;<var>field</var>
 
:The table field to search.
 
;<var>querystring</var>
 
:The string to search for.
 
;<var>cexpr, copr cexpr</var>
 
:See <code>SET table FIND</code>.
 
;<var>/i</var>


QUERY /m=find <var>table</var> <var>startentry</var> <var>cepr</var> [ <var>copr</var> <var>cexpr</var> ... ] [ /t ] // works like <code>[[Programmer_Guide/Shell_Items/Table/SET_TABLE#FINDEXPR|SET table FIND]]</code>
:The search will be case insensitive (by default, it is case sensitive).


;<var>matchtype</var>: one of the keywords <code>regular</code>, <code>wildcard</code>, <code>substring</code>, <code>full</code>, and <code>find</code>.
;<var>/t</var>
 
:Only tagged table entries will be considered.
 
;<var>/m=regular</var>


;<var>table</var>: the table to search.
;<var>startentry</var>: the zero-based index of the entry at with which to start the search.
;<var>field</var>: the table field to search.
;<var>querystring</var>: the string to search for.
;<var>cexpr</var>, <var>copr</var> <var>cexpr</var>: {{:Programmer_Guide/General_Descriptions/Find_Expressions}}
;<code>/i</code>: The search will be case insensitive (by default, it is case sensitive).
;<code>/t</code>: only tagged table entries will be considered.
;<code>/m=regular</code>
:<var>querystring</var> will be considered a POSIX regular expression.
:<var>querystring</var> will be considered a POSIX regular expression.
;<code>/m=wildcard</code>
 
:<var>querystring</var> will be considered an {{STX}} wildcard expression (just like <code>[[Programmer Guide/Command Reference/FIND|FIND]]</code>).
;<var>/m=wildcard</var>
;<code>/m=substring</code>: All characters in <var>querystring</var> will be considered autonomous, i.e. naming themselves. The <code>[[Programmer Guide/Command Reference/FIND|FIND]]</code> command will find the first entry of which <var>querystring</var> is a substring.
 
;<code>/m=full</code>:All characters in <var>querystring</var> will be considered autonomous, i.e. naming themselves. The <code>[[Programmer Guide/Command Reference/FIND|FIND]]</code> command will find the first entry whose content is exactly identical to <var>querystring</var> (with the possible exception of case).
:<var>querystring</var> will be considered an S_TOOLS-STx wildcard expression (just like <code>[[Programmer Guide/Command Reference/FIND|FIND]]</code>).
;<code>[[Programmer_Guide/Command_Reference_Options/-|/-]]</code>: You should always use the [[Programmer_Guide/Command_Reference_Options/-|/-]] "non-option" option before the first argument in order not to cause arguments to be mistaken for options.
 
;<var>/m=substring</var>
 
:All characters in <var>querystring</var> will be considered autonomous, i.e. naming themselves. The <code>[[Programmer Guide/Command Reference/FIND|FIND]]</code> command will find the first entry of which <var>querystring</var> is a substring.
 
;<var>/m=full</var>
 
:All characters in <var>querystring</var> will be considered autonomous, i.e. naming themselves. The <code>[[Programmer Guide/Command Reference/FIND|FIND]]</code> command will find the first entry whose content is exactly identical to <var>querystring</var> (with the possible exception of case).
 
;<var>/-</var>
 
:You should always use the /- "non-option" option before the first argument in order not to cause arguments to be mistaken for options.

Revision as of 15:52, 28 April 2014

QUERY

The QUERY command, although similar to the FIND command, offers the programmer more choice in how to search.

QUERY [ /i ] [ /t ] [ /m=matchtype ] /- table startentry field querystring

QUERY /m=find table startentry cepr [ copr cexpr ... ] [ /t ] // works like SET table FIND

matchtype
One of the following keywords:
regular

wildcard substring full find

table
The table to search.
startentry
The zero-based index of the entry at with which to start the search.
field
The table field to search.
querystring
The string to search for.
cexpr, copr cexpr
See SET table FIND.
/i
The search will be case insensitive (by default, it is case sensitive).
/t
Only tagged table entries will be considered.
/m=regular
querystring will be considered a POSIX regular expression.
/m=wildcard
querystring will be considered an S_TOOLS-STx wildcard expression (just like FIND).
/m=substring
All characters in querystring will be considered autonomous, i.e. naming themselves. The FIND command will find the first entry of which querystring is a substring.
/m=full
All characters in querystring will be considered autonomous, i.e. naming themselves. The FIND command will find the first entry whose content is exactly identical to querystring (with the possible exception of case).
/-
You should always use the /- "non-option" option before the first argument in order not to cause arguments to be mistaken for options.

Navigation menu

Personal tools