IQUEST(1)
π IQUEST(1) β an iRODS iCommand
okay bestie, so iquest is one of the iRODS iCommands, and she's basically the main character of "asking the ICAT questions." This page is filed under User Commands in the iRODS 5.0.2 manual, and we're gonna get you fluent, no cap. β¨
πΈ SYNOPSIS
iquest [-hz] [--no-page] [[hint] format_string] <query_string>
iquest --sql <predefined_sql_string> [format_string] [arguments]
iquest attrs
Three whole moods, bestie. Pick your fighter. π«Ά
β¨ OPTIONS β¨
format_stringβ a C-style format string, restricted to character strings (so like, the pretty printing part β keep it stringy, okay?).query_stringβ the selection query string. The section Selection query syntax below has all the lore on how to write it.-zzone_name β the zone you wanna query. If you leave it out or put in something invalid, it just defaults to your local zone. Lowkey forgiving. π--no-pageβ by default, once you've printed a large number of results (256), it stops and asks if you wanna keep going. This flag says "nope, I'm built different, keep it coming" and skips that prompt entirely.--sqlβ run a pre-defined SQL query instead. The query you name has to match one your admin already defined (they do it withiadmin h asq, which is short for "add specific query" β yes, the abbreviation ate π ). Your site might have a few of these set up. There's a special aliasls(as in--sql ls) that's normally defined to show you all of them. You can refer to a query by its full SQL or by its alias, if one's defined. But real talk: generally it's better to use the general-query (the non---sqlforms on this page) because that one generates the proper SQL for you β it knows how to link the ICAT tables, handles access control, and deals with all the other security aspects. Iconic behaviour, honestly. If your SQL takes arguments, you enter them right after the SQL. And just like without--sql, you can give aprintfformat statement to format the results β except when you're using aliases.-hβ display the help and exit. Short king. π
Heads up: ifno-distinctappears before thequery_string, the normaldistinctoption on the SQL gets bypassed. This is useful in rare cases only, so likeβ¦ don't make it your whole personality. π
Wanna do a case-insensitive search? Pass the uppercase option (or upper, same vibe) and make ALL your conditional input values uppercase. Like this fr:
iquest uppercase "SELECT DATA_ID WHERE COLL_NAME LIKE '%/TEST'
AND DATA_NAME = 'FOO.BIN'"
β οΈ Case-insensitive search requires that all the columns in theWHERE-clause have a string-based data type (varchar, etc.). That means columns likeDATA_SIZEwill make the query fail with aCAT_SQL_ERR. Not me crying at the terminal π β just keep it stringy!
π¦ Selection query syntax
(This is the tea for the query_string argument, bestie.)
SELECT <attribute> [, <attribute>]* [WHERE <condition> [AND <condition>]*]
- attribute β the name of an attribute, from
iquest attrs. - condition β a conditional statement. Peep the Conditional statement syntax section below.
You can also use a few aggregation operators β think SUM, COUNT, MIN, MAX, and AVG β or ORDER and ORDER_DESC (that's descending) if you need to specify an order. Slay. β¨
π Conditional statement syntax
(This is what goes inside the WHERE conditionals in your selection queries.)
<attribute> <rel-op> <value>
- attribute β the name of an attribute, from
iquest attrs. - rel-op β a relational operator, like
=,<>,>,<,LIKE,NOT LIKE,BETWEEN, etc. - value β either a constant or a wild-carded expression. Use
%and_as wildcards, and use\to escape them. π§
See https://docs.irods.org/5.0.2/system_overview/genquery/#example-queries for examples.
and that's the whole page, bestie β go query something iconic π
β sign-off: this little love letter comes from the iquest page of iRODS-5.0.2, dated January 1980 (yes, really, the date said 1980 β vintage era, periodt). ππ¦
π¦ where this page comes from
- nixos 26.05: irods-icommands 5.0.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms